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; }
Fixed in cvs.