This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/2766] New: Implementation of the insque() function does not satisfy POSIX.


The POSIX description of the insque() function says that "If the queue is to be 
used as a linear list, invoking insque(&element, NULL), where element is the 
initial element of the queue, shall initialize the forward and backward 
pointers of element to null pointers."
However this function in the current glibc causes the segmentation fault if the 
second parameter is NULL.

Example of the code:
#include <stdio.h>
#include <search.h>
	
typedef struct
{
    void* next;
    void* prev;
} Node;

int main()
{
    Node A;
    A.next = NULL;
    A.prev = NULL;
    insque(&A, NULL);
    return 0;
}

-- 
           Summary: Implementation of the insque() function does not satisfy
                    POSIX.
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: sortov at linuxtesting dot org
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=2766

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]