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 nptl/5551] pthread_cond_signal() doesn't return EINVAL for uninitialized cond per POSIX.


------- 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.


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