NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/53998 CVS commit: src/sys/kern



Christos Zoulas a écrit :
> The following reply was made to PR kern/53998; it has been noted by GNATS.
> 
> From: "Christos Zoulas" <christos%netbsd.org@localhost>
> To: gnats-bugs%gnats.NetBSD.org@localhost
> Cc: 
> Subject: PR/53998 CVS commit: src/sys/kern
> Date: Thu, 21 Feb 2019 16:49:23 -0500
> 
>  Module Name:	src
>  Committed By:	christos
>  Date:		Thu Feb 21 21:49:23 UTC 2019
>  
>  Modified Files:
>  	src/sys/kern: uipc_sem.c
>  
>  Log Message:
>  PR/53998: Joel Bertrand: Return ENOSPC when SEM_NSEMS_MAX is exceeded
>  instead of -1.
>  
>  
>  To generate a diff of this commit:
>  cvs rdiff -u -r1.53 -r1.54 src/sys/kern/uipc_sem.c
>  
>  Please note that diffs are not public domain; they are subject to the
>  copyright notices on the relevant files.

	Christos,

	Thanks a lot for this patch, but I'm not really sure it will fix this
issue. Of course, with your patch, sem_init() will return ENOSPC instead
of -1. but I'm not understand how a memory allocation error can occur in
my code. I have verified that my test program doesn't contain memory
leak and, when sem_init() fails, system has more than 10GB free.

	Of course, I create a semahore with sem_init() in each thread but I
destroy this semaphore also with sem_destroy() (returns 0) before
pthread_exit().

	Best regards,

	JB


Home | Main Index | Thread Index | Old Index