Bug 125277 - pthread_kill dumps core on non-existing thread-ids
pthread_kill dumps core on non-existing thread-ids
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: glibc (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-04 08:40 EDT by Tushar Telichari
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-17 12:53:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test case to reproduce coredump generated by pthread_kill call (1.37 KB, text/plain)
2004-06-04 08:43 EDT, Tushar Telichari
no flags Details

  None (edit)
Description Tushar Telichari 2004-06-04 08:40:36 EDT
Description of problem: pthread_kill dumps core on non-existing thread-ids

Version-Release number of selected component (if applicable):

OS - Red Hat Enterprise Linux WS release 3 (Taroon)
GCC - gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-20)


Version-Release number of selected component (if applicable):


How reproducible: occuring (reproducible)


Steps to Reproduce:
1. gcc -o test test.c -lpthread
2. ./test

  
Actual results:
core dump

Expected results:
Clean error message as designed in program

Additional info:
NIL
Comment 1 Tushar Telichari 2004-06-04 08:43:43 EDT
Created attachment 100865 [details]
test case to reproduce coredump generated by pthread_kill call
Comment 2 Jakub Jelinek 2004-06-08 05:57:57 EDT
Passing an invalid thread id is the same thing as fputs (foo, (FILE *) 0x1000) etc.

I see http://www.opengroup.org/onlinepubs/009695399/functions/pthread_kill.html
says shall fail for ESRCH, this looks like a defect in the standard
to me, it should be a may fail error.  I remember many similar shall fails
have been changed into may fails recently.
Similarly pthread_join.

When pthread_t is implemented as a pointer as opposed to small integer,
checking for validity would be extremely costly in these functions.
Comment 3 Ulrich Drepper 2004-06-17 12:53:39 EDT
As Jakub said this is an invalid test.  No part of the pthread
functionalit is supposed to be able to detect invalid thread descriptors.

Note You need to log in before you can comment on or make changes to this bug.