Bug 125277

Summary: pthread_kill dumps core on non-existing thread-ids
Product: Red Hat Enterprise Linux 3 Reporter: Tushar Telichari <tushar>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: drepper, roland, tao
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
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:
Description Flags
test case to reproduce coredump generated by pthread_kill call none

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.