Bug 21085

Summary: [patch] SYSV IPC msg queues creation failed with ENOSPC
Product: Base System Reporter: Marcin Cieslak <saper>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: peter
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Marcin Cieslak 2000-09-06 23:00:01 UTC
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;
}
Comment 1 Peter Wemm freebsd_committer freebsd_triage 2000-09-20 00:00:30 UTC
State Changed
From-To: open->closed

Suggested patches applied: 1.25 in -current, 1.23.2.2 in RELENG_4, thanks!