[Mono-dev] FW: Patch for Processes.c on Mac OSX

Tom Philpot tom.philpot at logos.com
Mon Nov 30 13:03:14 EST 2009


Has anyone had a chance to review this patch for Mac OS X?

Basically, enumerating processes on Mac OS X doesn't work correctly in Mono
without this patch, but also doesn't always crash because we're malloc'ing
some large random number of bytes pulled from a garbage location in memory.
If that number is huge, we crash, if it's small enough, we silently and
erroneously succeed.

Tom

------ Forwarded Message
From: Tom Philpot <tom.philpot at logos.com>
Date: Wed, 25 Nov 2009 15:09:41 -0800
To: "mono-devel-list at ximian.com" <mono-devel-list at ximian.com>
Subject: [Mono-dev] Patch for Processes.c on Mac OSX

We have a patch for io-layer/processes.c where Mono on Mac OSX crashes if
trying to lock a named mutex which is not owned by the current process. The
problem is that Mono on Mac does not correctly know how to enumerate
processes.

The attached program assumes that you have built it, it then launches itself
and takes a lock on a named mutex. The first instance also tries to acquire
the lock and crashes.

The attached patch fixes the issue for us.

Again, props to Martin Potter for the discovery and the patch.

Tom

This patch is MIT/X11 licensed.

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

------ End of Forwarded Message

-------------- next part --------------
A non-text attachment was scrubbed...
Name: MutexTest.cs
Type: application/octet-stream
Size: 1345 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20091130/8add5dd4/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: processes-patch.txt
Type: application/octet-stream
Size: 2226 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20091130/8add5dd4/attachment-0001.obj 


More information about the Mono-devel-list mailing list