| Summary: | [patch] SYSV IPC msg queues creation failed with ENOSPC | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Marcin Cieslak <saper> | ||||
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | peter | ||||
| Priority: | Normal | ||||||
| Version: | 4.1-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
State Changed From-To: open->closed Suggested patches applied: 1.25 in -current, 1.23.2.2 in RELENG_4, thanks! |
The msgget(3) began to fail strangely with errno = ENOSPC even at the system boot. The problem is with msqids struct initialization - msg_perm.mode field was tested at sys/kern/sysv_msg.c:442, but has not been previously initialized properly at sys/kern/sysv_msg.c:190. Fix: Beware, all other sysv_* files should be inspected closely, because malloc() for the structures has been introduced on May, 1st. 2000. How-To-Repeat: Try to run the following program, however we were unable to reproduce the bug on some other machines. The program failed with ENOSPC even with empty msg queue table. #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> int main() { int msgq; msgq = msgget(IPC_PRIVATE,IPC_CREAT); printf("Result: %d\n", msgq); if (msgq == -1) perror("msgget"); return 0; }