Bug 125277 - pthread_kill dumps core on non-existing thread-ids
Summary: pthread_kill dumps core on non-existing thread-ids
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: glibc   
(Show other bugs)
Version: 3.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-06-04 12:40 UTC by Tushar Telichari
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-17 16:53:39 UTC
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 12:43 UTC, Tushar Telichari
no flags Details

Description Tushar Telichari 2004-06-04 12:40:36 UTC
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 12:43:43 UTC
Created attachment 100865 [details]
test case to reproduce coredump generated by pthread_kill call

Comment 2 Jakub Jelinek 2004-06-08 09:57:57 UTC
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 16:53:39 UTC
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.