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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=82286 --- shadow/82286 2007-08-08 13:46:07.000000000 -0400 +++ shadow/82286.tmp.6633 2007-08-09 05:14:57.000000000 -0400 @@ -138,6 +138,106 @@ aborting... ------- Additional Comments From [EMAIL PROTECTED] 2007-08-08 13:46 ------- The ExecutionContext crash is caused by sharing the execution context object between appdomains in the Thread class. + +------- Additional Comments From [EMAIL PROTECTED] 2007-08-09 05:14 ------- +I think I've found out why thread_cleanup is sometimes called twice +for the same thread object, but I'm not sure it's a problem, and if it +is, I'm not sure how to fix it. I've turned on thread debug output +and added printing the pointers to the thread objects whenever +possible. This is the end of one such log: + +** Message: mono_thread_current: returning 0x2aaaaaaeac40 +** Message: mono_thread_current: returning 0x2aaaaaaeac40 +** Message: mono_thread_current: returning 0x2aaaaaaeac40 +** Message: mono_thread_current: returning 0x2aaaaaaeac40 +** Message: mono_thread_current: returning 0x2aaaaaaeac40 +** Message: mono_thread_current: returning 0x2aaaafb55dc0 +** Message: mono_thread_current: returning 0x2aaaafb55dc0 +** Message: mono_thread_current: returning 0x2aaaafb55dc0 +** Message: mono_thread_exit: mono_thread_exit for 0x2aaaafb55dc0 +(1107700032) +** Message: handle_remove: thread ID 1107700032 +** Message: mono_thread_current: returning 0x2aaaafb55dc0 +** Message: ves_icall_System_Threading_Thread_Thread_internal: Trying +to start a new thread: this (0x2aaaafb558c0) start (0x2aaaafe765a0) +** Message: mono_thread_start: (46912510896944) Launching thread +0x2aaaafb558c0 (1107700032) +** Message: handle_store: thread 0x2aaaafb558c0 ID 1107700032 +** Message: mono_thread_start: (46912510896944) waiting for thread +0x2aaaafb558c0 (1107700032) to start +** Message: start_wrapper: (1107700032) Start wrapper +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: start_wrapper: (1107700032) Setting current_object_key to +0x2aaaafb558c0 +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: mono_thread_start: (46912510896944) Done launching thread +0x2aaaafb558c0 (1107700032) +** Message: ves_icall_System_Threading_Thread_Thread_internal: Started +thread ID 1107700032 (handle 0x9c1) +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: mono_thread_current: returning 0x2aaaafb558c0 +** Message: mono_thread_current: returning 0x2aaaaaaeac40 +** Message: mono_thread_current: returning 0x2aaaaaaeac40 +** Message: mono_thread_current: returning 0x2aaaaaaeac40 +** Message: ves_icall_System_Threading_Thread_Thread_internal: Trying +to start a new thread: this (0x2aaaafb55780) start (0x2aaaafaa7b40) +** Message: mono_thread_start: (46912510896944) Launching thread +0x2aaaafb55780 (1109866816) +** Message: handle_store: thread 0x2aaaafb55780 ID 1109866816 +** Message: mono_thread_start: (46912510896944) waiting for thread +0x2aaaafb55780 (1109866816) to start +** Message: start_wrapper: (1109866816) Start wrapper +** Message: mono_thread_current: returning 0x2aaaafb55780 +** Message: mono_thread_current: returning 0x2aaaafb55780 +** Message: mono_thread_current: returning 0x2aaaafb55780 +** Message: mono_thread_current: returning 0x2aaaafb55780 +** Message: start_wrapper: (1109866816) Setting current_object_key to +0x2aaaafb55780 +** Message: mono_thread_current: returning 0x2aaaafb55780 +** Message: mono_thread_start: (46912510896944) Done launching thread +0x2aaaafb55780 (1109866816) +** Message: ves_icall_System_Threading_Thread_Thread_internal: Started +thread ID 1109866816 (handle 0x9c3) +** Message: wait_for_tids: cleaning up after thread 0x2aaaafb55dc0 +(1107700032) +** Message: handle_remove: thread ID 1107700032 +** Message: mono_thread_current: returning (nil) + +** ERROR **: file threads.c: line 340 (small_id_free): assertion +failed: (id >= 0 && id < small_id_table_size) +aborting... + +Note the first mono_thread_exit there: + +** Message: mono_thread_exit: mono_thread_exit for 0x2aaaafb55dc0 +(1107700032) +** Message: handle_remove: thread ID 1107700032 + +Then note the creation of a new thread with the same tid, but a +different thread object: + +** Message: mono_thread_start: (46912510896944) Launching thread +0x2aaaafb558c0 (1107700032) + +Then, at the end, note how the old thread object suddenly shows up again: + +** Message: wait_for_tids: cleaning up after thread 0x2aaaafb55dc0 +(1107700032) + +The reason for this seems to be that wait_for_tids() uses no locking +and it can happen that after it has successfully looked up a tid in +the threads hash and deemed it safe to clean that thread up, that +thread exits by itself, but before wait_for_tids() has cleaned it up, +so the cleanup is done twice. + +Again, I'm not sure this is a problem, and I'm not sure how to +appropriately do locking there if it is. Can anybody shed some light +on this? _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
