[Mono-bugs] [Bug 528830] appdomain-unload.exe unit test fails

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Aug 12 05:50:08 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=528830

User romain at blogreen.org added comment
http://bugzilla.novell.com/show_bug.cgi?id=528830#c3


Romain Tartière <romain at blogreen.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |romain at blogreen.org




--- Comment #3 from Romain Tartière <romain at blogreen.org>  2009-08-12 03:50:07 MDT ---
I know that FreeBSD is not a supported plateform. I am from BSD# where we try
to have working Mono on FreeBSD. I am just asking for some pointers maybe :-)


After further experimentations, the bug is not as systematic as I though at
first.

Running the applications multiple times does not have the same result:

% MONO_PATH=/home/romain/Projects/mcs/class/lib/net_2_0 ../mini/mono
appdomain-unload.exe
FINALIZING IN DOMAIN appdomain-unload.exe: False
FINALIZING IN DOMAIN Test-is-finalizing: True
Thread aborted correctly.
in DeadInvokeTest
test_0_invoke_after_unload failed: got 1, expected 0
Regression tests: 8 ran, 1 failed in Tests
% MONO_PATH=/home/romain/Projects/mcs/class/lib/net_2_0 ../mini/mono
appdomain-unload.exe
FINALIZING IN DOMAIN appdomain-unload.exe: False
FINALIZING IN DOMAIN Test-is-finalizing: True
Thread aborted correctly.
Regression tests: 8 ran, 0 failed in Tests
% MONO_PATH=/home/romain/Projects/mcs/class/lib/net_2_0 ../mini/mono
appdomain-unload.exe
FINALIZING IN DOMAIN appdomain-unload.exe: False
FINALIZING IN DOMAIN Test-is-finalizing: True
Thread aborted correctly.
in DeadInvokeTestStacktrace:


zsh: abort (core dumped)  MONO_PATH=/home/romain/Projects/mcs/class/lib/net_2_0
./mini/mono 
%

Here, 1 test fails, then everything is okay, then mono crash...

% gdb ../mini/mono mono.core
(gdb) bt
#0  0x2875f1cb in thr_kill () from /lib/libc.so.7
#1  0x287117d6 in pthread_kill () from /lib/libthr.so.3
#2  0x2870f363 in raise () from /lib/libthr.so.3
#3  0x287f21ca in abort () from /lib/libc.so.7
#4  0x081072a2 in mono_handle_native_sigsegv (signal=11, ctx=0xbf2e6bc0) at
./../../mono/mono/mini/mini-exceptions.c:1598
#5  0x0806390e in mono_sigsegv_signal_handler (_dummy=11, info=0xbf2e6e80,
context=0xbf2e6bc0) at ../../../mono/mono/mini/mini.c:4570
#6  <signal handler called>
#7  0x08223c17 in mono_thread_pool_remove_domain_jobs (domain=0x0, timeout=-1)
at ../../../mono/mono/metadata/threadpool.c:1301
#8  0x08158d75 in unload_thread_main (arg=0xbfbfe0f0) at
./../../mono/mono/metadata/appdomain.c:2037
#9  0x0825a67a in thread_start_routine (args=0x2966e5a4) at
./../../mono/mono/io-layer/wthreads.c:286
#10 0x0827aa6e in GC_start_routine (arg=0x8448c10) at
./../mono/libgc/pthread_support.c:1390
#11 0x2870b6ff in pthread_getprio () from /lib/libthr.so.3
#12 0x00000000 in ?? ()
(gdb) f 7
#7  0x08223c17 in mono_thread_pool_remove_domain_jobs (domain=0x0, timeout=-1)
at ../../../mono/mono/metadata/threadpool.c:1301
1301        domain->cleanup_semaphore = sem_handle;
(gdb) l
1296         * There might be some threads out that could be about to execute
stuff from the given domain.
1297         * We avoid that by setting up a semaphore to be pulsed by the
thread that reaches zero.
1298         */
1299        sem_handle = CreateSemaphore (NULL, 0, 1, NULL);
1300        
1301        domain->cleanup_semaphore = sem_handle;
1302        /*
1303         * The memory barrier here is required to have global ordering
between assigning to cleanup_semaphone
1304         * and reading threadpool_jobs.
1305         * Otherwise this thread could read a stale version of
threadpool_jobs and wait forever.
(gdb) f 8
#8  0x08158d75 in unload_thread_main (arg=0xbfbfe0f0) at
./../../mono/mono/metadata/appdomain.c:2037
2037        if (!mono_thread_pool_remove_domain_jobs (domain, -1)) {
(gdb) l
2032        if (!mono_threads_abort_appdomain_threads (domain, -1)) {
2033            data->failure_reason = g_strdup_printf ("Aborting of threads in
domain %s timed out.", domain->friendly_name);
2034            return 1;
2035        }
2036    
2037        if (!mono_thread_pool_remove_domain_jobs (domain, -1)) {
2038            data->failure_reason = g_strdup_printf ("Cleanup of threadpool
jobs of domain %s timed out.", domain->friendly_name);
2039            return 1;
2040        }
2041    
(gdb) p data
$1 = (unload_data *) 0xbfbfe0f0
(gdb) p data->domain
$2 = (MonoDomain *) 0x0


Reading planet GNOME a few days ago I found:
http://0pointer.de/blog/projects/pthread-key-create.html

Grep tells me that pthread_key_create is called with a non-null destructor
parameter here:
/mono/metadata/sgen-gc.c:6253
/libgc/pthread_support.c:281

But I could not find any reference to the "-z nodelete" adviced.  Maybe this is
related to the crash... or not?

Any idea?

Thanks,
Romain, on behalf of the BSD# Team

-- 
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