|
Bugzilla – Full Text Bug Listing |
| Summary: | Unreleased and Un-closed Mutex keeps app from exiting. | ||
|---|---|---|---|
| Product: | [Mono] Mono: Runtime | Reporter: | Jae Stutzman <jaebird> |
| Component: | io-layer | Assignee: | Dick Porter <dick> |
| Status: | RESOLVED FIXED | QA Contact: | Mono Bugs <mono-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | forgotten_vxPDddArjq |
| Version: | 1.2.4 | ||
| Target Milestone: | --- | ||
| Hardware: | i386 | ||
| OS: | Ubuntu | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
-> runtime. This is most likely caused by _wapi_thread_set_termination_details acquiring the shared handles lock, then calling _wapi_thread_abadon_mutexes, whose documentation states that the lock should not be held by the caller. Fixed in svn r93046. The analysis was mostly correct, but _wapi_handle_unref() called from _wapi_thread_disown_mutex() could also try to obtain the shared lock. |
Description of Problem: Mutex class acts differently from MS on exit. Steps to reproduce the problem: 1. Run the app below. It should exit properly 2. Now remove the onlyOne.ReleaseMutex(); line. The app does not completely exit Actual Results: Sometimes app hangs on exit and does not return to the shell. Expected Results: Exit and return to shell How often does this happen? Mostly every time. Additional Information: static void Main() { // allow only one instance of the process Mutex onlyOne = new Mutex(true, Process.GetCurrentProcess().ProcessName); if (onlyOne.WaitOne(0, false)) { try { new Program(); } finally { onlyOne.ReleaseMutex(); onlyOne.Close(); onlyOne = null; } } } Sometimes, depending on what is in the Program() if the "onlyOne = null" is not present the app does not exit either.