Bug 21085 - [patch] SYSV IPC msg queues creation failed with ENOSPC
Summary: [patch] SYSV IPC msg queues creation failed with ENOSPC
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 4.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-09-06 23:00 UTC by Marcin Cieslak
Modified: 2000-09-20 00:00 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (591 bytes, patch)
2000-09-06 23:00 UTC, Marcin Cieslak
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!