https://bugzilla.novell.com/show_bug.cgi?id=678662
https://bugzilla.novell.com/show_bug.cgi?id=678662#c0 Summary: Exception "invalid handle specified" because mono_thread_pool_cleanup() is called twice Classification: Mono Product: Mono: Runtime Version: 2.10.x Platform: All OS/Version: Windows 7 Status: NEW Severity: Normal Priority: P5 - None Component: misc AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 While debugging another problem in Visual Studio under Windows I got an exception "An invalid handle was specified" while running mono.exe . Problem here is that mono_main() calls mono_thread_pool_cleanup() twice: (1) mono_main() => mono_thread_manage() => mono_thread_pool_cleanup() (2) mono_main() => mini_cleanup() => mono_domain_finalize() => mono_thread_pool_cleanup() mono_thread_pool_cleanup() does MONO_SEM_DESTROY (&async_io_tp.new_job), and on the second call the handle is already freed resulting in an exception. A "quick fix" would be to set async_io_tp.new_job to zero after freeing and testing it before freeing again. This would be in mono_semaphore.h : - # define MONO_SEM_DESTROY(sem) CloseHandle (*(sem)) + # define MONO_SEM_DESTROY(sem) if (*sem != 0) { CloseHandle (*(sem)); *sem = 0; Reproducible: Always Steps to Reproduce: Execute any assembly with debug version of mono.exe built with Visual Studio under Windows. Actual Results: Exception at 0x77d3708f in mono.exe: An invalid handle was specified. Expected Results: No exception ;-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
