[Mono-bugs] [Bug 578243] Application freezes while writing output to the shell

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 8 08:56:47 EDT 2010



--- Comment #2 from Mark Probst <mprobst at novell.com> 2010-04-08 12:56:46 UTC ---
This test case reproduces the bug every time:

using System;
using System.Threading;

class Test
    static object o = new object ();

    static void DoStuff ()
    Console.WriteLine ("thread: started");
    lock (o) {
        Console.WriteLine ("thread: locked");
    Console.WriteLine ("thread: still here");

    static void Main ()
    Thread t = new Thread (DoStuff);
    lock (o) {
        t.Start ();
        Thread.Sleep (1000);
        Console.WriteLine ("main: slept");
        t.Abort ();
        Console.WriteLine ("main: aborted");
    Console.WriteLine ("main: unlocked");
    Thread.Sleep (1000);
    lock (o) {
        Console.WriteLine ("main: locked");
    Console.WriteLine ("main: done");

What seems to be going on here is that if a thread is aborted while it's
waiting for a lock, it proceeds to acquire that lock and then
mono_thread_execute_interruption() is called and throws the
ThreadAbortException, but the thread is not in a place where the finally
handler will be called.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list