Subject: kern/25118: semop() fails with EINVAL even when SEMUME is increased
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <steven@qcr.com>
List: netbsd-bugs
Date: 04/09/2004 19:51:04
>Number:         25118
>Category:       kern
>Synopsis:       semop() fails with EINVAL even when SEMUME is increased
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 09 19:52:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Steven Beard
>Release:        1.6.1, 1.6.2
>Organization:
QCR
>Environment:
NetBSD netbsd 1.6.1 NetBSD 1.6.1 (GENERIC) #0: Tue Apr  8 12:05:52 UTC 2003     autobuild@tgm.daemon.org:/autobuild/netbsd-1-6/i386/OBJ/autobuild/netbsd-1-6/src/sys/arch/i386/compile/GENERIC i386

>Description:
The semop() system call will fail and return EINVAL if more than
10 undo structures are needed. Normally the kernel parameter SEMUME
is used to increase the max # of undo entries per process which
allows semop() succeed. Unfortunately setting the SEMUME value
has no effect on NetBSD 1.6.1.
>How-To-Repeat:

>Fix:
The code in kern/sysv_sem.c incorrectly uses the older SEMUME
#define instead of reading the value from the seminfo structure.

Line 248 of kern/sysv_sem.c

Current code:
	if (suptr->un_cnt == SEMUME)

Correct code:
	if (suptr->un_cnt >= seminfo.semume)
>Release-Note:
>Audit-Trail:
>Unformatted: