[Mono-dev] Here's a patch for /dev/shm/mono.pid's piling up on Linux

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Wed Mar 3 13:02:21 EST 2010


On Wed, 2010-03-03 at 05:54 -0800, cpMon wrote:
> Here's a patch you should consider for mono-2.6.1. Specifically, I noticed
> that /dev/shm/mono.pid files were piling up and not being cleaned up as they
> should have been. mono-mmap.c tries to get rid of stale ones with a kill but
> they don't check for ENOMEM return which causes the cleanup to fail.
> Additionally, every other time I tried to start mono, it would just quit.
> 
> Here's the patch:
> 
> 470c470
> < if (curpid != pid && kill (pid, SIGCONT) == -1 && (errno == ESRCH || errno
> == ENOMEM) ) {
> ---
> > if (curpid != pid && kill (pid, SIGCONT) == -1 && errno == ESRCH) {
> 
> This has been tested on various 2.6 Linux boxes successfully.
> 
> Cal Page 

I've checked in your change and also changed SIGCONT to 0 (from the
manual page: "If  sig  is 0, then no signal is sent, but error checking
is still performed; this can be used to check for the existence of a
process ID or process group ID."). It's in the mono-2-6 branch and
trunk.

Thanks.

-Gonzalo





More information about the Mono-devel-list mailing list