[Mono-bugs] [Bug 81011][Maj] New - Assembly load deadlock in multithreaded application
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Mar 2 16:35:29 EST 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by robertw at ssgx.com.
http://bugzilla.ximian.com/show_bug.cgi?id=81011
--- shadow/81011 2007-03-02 16:35:29.000000000 -0500
+++ shadow/81011.tmp.17634 2007-03-02 16:35:29.000000000 -0500
@@ -0,0 +1,89 @@
+Bug#: 81011
+Product: Mono: Runtime
+Version: 1.2
+OS: other
+OS Details: FreeBSD 6.2-STABLE amd64
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: misc
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: robertw at ssgx.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Assembly load deadlock in multithreaded application
+
+Description of Problem:
+
+I seem to be getting deadlocks in my multithreaded application on line 1467
+below in metadata/assembly.c:
+
+1462 mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Image addref %s
+%p -> %s %p: %d\n", ass->aname.name, ass, image->name, image,
+image->ref_count);
+1463
+1464 /*·
+1465 * Atomically search the loaded list and add ourselves to it if
+necessary.
+1466 */
+1467 mono_assemblies_lock ();
+
+A ktrace when it locks up shows:
+
+...snip...
+13097 mono GIO fd 1 wrote 136 bytes
+ "Mono-INFO: Image addref Mono.Posix 0x73c180 ->
+/usr/local/lib/mono/gac/Mono.Posix/2.0.0.0__0738eb9f132ed756/Mono.Posix.dll
+0xa5d800: 2
+·
+ "
+13097 mono RET write 136/0x88
+13097 mono CALL kse_release(0x72ef20)
+13097 mono RET kse_release 0
+13097 mono CALL gettimeofday(0x7fffff5eaab0,0)
+13097 mono RET gettimeofday 0
+13097 mono CALL kse_release(0x72ef20)
+13097 mono RET kse_release 0
+13097 mono CALL gettimeofday(0x7fffff5eaab0,0)
+13097 mono RET gettimeofday 0
+13097 mono CALL kse_release(0x72ef20)
+13097 mono RET kse_release 0
+... and that repeats
+13097 mono CALL wait4(0x3329,0x7fffff9fdec0,0x1,0)
+13097 mono RET wait4 -1 errno 10 No child processes
+13097 mono CALL kse_release(0x72ef20)
+13097 mono RET kse_release 0
+13097 mono CALL gettimeofday(0x7fffff9fdf30,0)
+13097 mono RET gettimeofday 0
+13097 mono CALL semop(0x50880005,0x7fffff9fdf10,0x1)
+13097 mono RET semop 0
+13097 mono CALL semop(0x50880005,0x7fffff9fdf20,0x1)
+13097 mono RET semop 0
+13097 mono CALL semop(0x50880005,0x7fffff9fdf20,0x1)
+13097 mono RET semop 0
+13097 mono CALL semop(0x50880005,0x7fffff9fdf10,0x1)
+13097 mono RET semop 0
+13097 mono CALL wait4(0x3329,0x7fffff9fdec0,0x1,0)
+13097 mono RET wait4 -1 errno 10 No child processes
+... and more of that
+
+and we have a deadlock.
+
+Steps to reproduce the problem:
+In a multi-threaded application I'm using Npgsql which loads Mono.Posix.dll
+creating an end point and it deadlocks every few hundred executions (in a
+tight loop).
+
+Actual Results:
+Deadlock on mono_assemblies_lock.
+
+Expected Results:
+Assembly loads without a deadlock.
+
+How often does this happen?
+One out of every few hundred executions.
+
+I will be attaching a few traces for analysis.
More information about the mono-bugs
mailing list