This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/5551] pthread_cond_signal() doesn't return EINVAL for uninitialized cond per POSIX.
- From: "rsa at us dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 7 Jan 2008 22:49:08 -0000
- Subject: [Bug nptl/5551] pthread_cond_signal() doesn't return EINVAL for uninitialized cond per POSIX.
- References: <20080107224605.5551.rsa@us.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From rsa at us dot ibm dot com 2008-01-07 22:49 -------
Created an attachment (id=2180)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=2180&action=view)
Testcase
The following test-case demonstrates how a condition variable memset to zero
does not return EINVAL. Currently the condition variable structure in GLIBC
does not contain a method to indicate whether a condition variable has been
initialized. Nor does the pthread_cond_signal() function check that the cond
pointer is non-zero before dereferencing the pointer.
Build test case with:
gcc test_cond_signal.c -o cond_signal -lpthread
Execute with:
./cond_signal 1
Expected result:
creating thread 0
0 starting
0 exiting
pthread cond signal failed for thread 0 with return value 22
Actual result:
creating thread 0
0 starting
0 exiting
calling cond signal 0
--
http://sourceware.org/bugzilla/show_bug.cgi?id=5551
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.