* pthread_kill problem?????
@ 2003-10-07 20:49 Ron Harter
2003-10-09 13:58 ` Andrew Duane USG
2003-10-13 14:49 ` reguera
0 siblings, 2 replies; 5+ messages in thread
From: Ron Harter @ 2003-10-07 20:49 UTC (permalink / raw)
We are using pthread_kill(threadId, 0) to determine if a particular thread
id is valid. We are running into a situation where the thread id (thread
has been terminated and joined)
is 0 and the program is getting an abort and core dumping.
According to the documentation we should get back an ESRCH error, the program
should not core dump.
Has anyone else experinced problems in this area? WE are running Tru64 5.1b
The task in question has approximatly 2000 threads
and the kernal parameters are set to allow a max of 4096 threads.
We have written a test driver that creates a dozen or so threads and checks
them using pthread_kill(threadId, 0) with no problem, even after the thread
exits and is joined so the threadId is 0. In this case a ESRCH is returned.
Any out there have any ideas or suggestions???????
Thanks in advance
Ron Harter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pthread_kill problem?????
2003-10-07 20:49 pthread_kill problem????? Ron Harter
@ 2003-10-09 13:58 ` Andrew Duane USG
2003-10-09 18:51 ` Ron Harter
2003-10-13 14:49 ` reguera
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Duane USG @ 2003-10-09 13:58 UTC (permalink / raw)
In article <vo69mvgn3t5973@corp.supernews.com> "Ron Harter" <rharter@ev1.net> writes:
>We are using pthread_kill(threadId, 0) to determine if a particular thread
>id is valid. We are running into a situation where the thread id (thread
>has been terminated and joined)
>is 0 and the program is getting an abort and core dumping.
>
>According to the documentation we should get back an ESRCH error, the program
>should not core dump.
>
>Has anyone else experinced problems in this area? WE are running Tru64 5.1b
>The task in question has approximatly 2000 threads
>and the kernal parameters are set to allow a max of 4096 threads.
>
>We have written a test driver that creates a dozen or so threads and checks
>them using pthread_kill(threadId, 0) with no problem, even after the thread
>exits and is joined so the threadId is 0. In this case a ESRCH is returned.
I do not understand what is happening. Your application gets a core
dump when threadId is 0, but a test harness doesn't?
Is there something else in your application that would dump when given
an errno of ESRCH? I have checked that pthread_kill does in fact return
ESRCH when threadId is 0, so I do not think that is the problem.
Where does a debugger say your application dumped?
--
Andrew L. Duane (JOT-7) duane@zk3.dec.com
HP/Compaq Corporation Andrew.Duane@compaq.com
110 Spit Brook Road Andrew.Duane@hp.com
M/S ZKO3-3/U14
Nashua, NH 03062-2698 (603)-884-1294
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pthread_kill problem?????
2003-10-09 13:58 ` Andrew Duane USG
@ 2003-10-09 18:51 ` Ron Harter
2003-10-14 13:04 ` David Butenhof
0 siblings, 1 reply; 5+ messages in thread
From: Ron Harter @ 2003-10-09 18:51 UTC (permalink / raw)
The debugger says that program was executing in the pthread_kill
function when it got an abort. This particular logic tests to see if a thread
(a communication thread to clients) is in fact valid before attempting to
queue an update packet to the thread to be sent down to a client. The client
could have shitdown which would cause the thread to be deleted. Other threads
receive data packets from other applications in the server and
queue them to the communication threads where theya re transmitted to the
client using CORBA middle ware. We need to be
able to reliably determine if the communication thread is still available
for use which is why we are calling pthread_kill(thread_id, 0)
duane@alpha.zk3.dec.com (Andrew Duane USG) wrote:
>In article <vo69mvgn3t5973@corp.supernews.com> "Ron Harter" <rharter@ev1.net>
writes:
>>We are using pthread_kill(threadId, 0) to determine if a particular thread
>>id is valid. We are running into a situation where the thread id (thread
>>has been terminated and joined)
>>is 0 and the program is getting an abort and core dumping.
>>
>>According to the documentation we should get back an ESRCH error, the program
>>should not core dump.
>>
>>Has anyone else experinced problems in this area? WE are running Tru64
5.1b
>>The task in question has approximatly 2000 threads
>>and the kernal parameters are set to allow a max of 4096 threads.
>>
>>We have written a test driver that creates a dozen or so threads and checks
>>them using pthread_kill(threadId, 0) with no problem, even after the thread
>>exits and is joined so the threadId is 0. In this case a ESRCH is returned.
>
>I do not understand what is happening. Your application gets a core
>dump when threadId is 0, but a test harness doesn't?
>
>Is there something else in your application that would dump when given
>an errno of ESRCH? I have checked that pthread_kill does in fact return
>ESRCH when threadId is 0, so I do not think that is the problem.
>
>Where does a debugger say your application dumped?
>
>--
>
>Andrew L. Duane (JOT-7) duane@zk3.dec.com
>HP/Compaq Corporation Andrew.Duane@compaq.com
>110 Spit Brook Road Andrew.Duane@hp.com
>M/S ZKO3-3/U14
>Nashua, NH 03062-2698 (603)-884-1294
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pthread_kill problem?????
2003-10-09 18:51 ` Ron Harter
@ 2003-10-14 13:04 ` David Butenhof
0 siblings, 0 replies; 5+ messages in thread
From: David Butenhof @ 2003-10-14 13:04 UTC (permalink / raw)
Ron Harter wrote:
> The debugger says that program was executing in the pthread_kill
> function when it got an abort.
a) define "abort". As I've said before, in response to your other
(disconnected) postings and and email, the most likely explanation is a
memory corruption; but you haven't given enough information to be sure.
> We need to be
> able to reliably determine if the communication thread is still available
> for use which is why we are calling pthread_kill(thread_id, 0)
As I believe I've also said, the result of pthread_kill(thread_id,0) is NOT
a reliable indication of whether the "thread is still available for use".
It only indicates whether thread_id contains a value that represents a
thread that currently exists. It does not care whether that ID was
generated for a thread that once existed, terminated, and was reissued to a
new thread. It doesn't care whether the thread is RUNNING or has terminated
and not yet been joined. It only cares whether the ID is valid. This is
probably not what you want if you are trying to determine whether a thread
is "available for use".
--
/--------------------[ David.Butenhof@hp.com ]--------------------\
| Hewlett-Packard Company Tru64 UNIX & VMS Thread Architect |
| My book: http://www.awl.com/cseng/titles/0-201-63392-2/ |
\----[ http://homepage.mac.com/dbutenhof/Threads/Threads.html ]---/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pthread_kill problem?????
2003-10-07 20:49 pthread_kill problem????? Ron Harter
2003-10-09 13:58 ` Andrew Duane USG
@ 2003-10-13 14:49 ` reguera
1 sibling, 0 replies; 5+ messages in thread
From: reguera @ 2003-10-13 14:49 UTC (permalink / raw)
Hi Ron.
We haven't seen this particular problem before. It is a possibility
that the thread in question did recieve an abort() that was generated
from a seperate issue.
Could you forward the core to me via anonymous ftp:
xfer.service.digital.com (192.208.35.20)
cd to_digitial
put file_name.
this is a blind ftp site. Please let me know when you have it there
@ reguera@nospam.zko.dec.com (remove nospam)
I will download it it and review what we have.
thanks
John Reguera
On Tue, 07 Oct 2003 20:49:35 -0000, "Ron Harter" <rharter@ev1.net>
wrote:
>
>We are using pthread_kill(threadId, 0) to determine if a particular thread
>id is valid. We are running into a situation where the thread id (thread
>has been terminated and joined)
>is 0 and the program is getting an abort and core dumping.
>
>According to the documentation we should get back an ESRCH error, the program
>should not core dump.
>
>Has anyone else experinced problems in this area? WE are running Tru64 5.1b
>The task in question has approximatly 2000 threads
>and the kernal parameters are set to allow a max of 4096 threads.
>
>We have written a test driver that creates a dozen or so threads and checks
>them using pthread_kill(threadId, 0) with no problem, even after the thread
>exits and is joined so the threadId is 0. In this case a ESRCH is returned.
>
>Any out there have any ideas or suggestions???????
>
>Thanks in advance
>
>Ron Harter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-10-14 13:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-07 20:49 pthread_kill problem????? Ron Harter
2003-10-09 13:58 ` Andrew Duane USG
2003-10-09 18:51 ` Ron Harter
2003-10-14 13:04 ` David Butenhof
2003-10-13 14:49 ` reguera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox