Skip site navigation (1)Skip section navigation (2)
Date:      7 Aug 1999 05:10:41 -0000
From:      mark@tgsoft.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/13008: kill fails in libc_r
Message-ID:  <19990807051041.91863.qmail@moose.tgsoft.com>

next in thread | raw e-mail | index | archive | help

>Number:         13008
>Category:       bin
>Synopsis:       pthread_kill does not always work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug  6 22:20:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     mark thompson
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
tgsoft
>Environment:

3.2 stable pthread library

>Description:

I wrote an application that worked basically like this:

main:
   create a socket
   create 10 threads
   run for a while, then:

       send each thread a signal with pthread_kill and wait for it in
	   pthread_join.
       when one thread has been waited for, go back and kill the next one
   exit

Each thread (in a loop):
	does an accept on the socket
	copies some data
	closes the data socket
	repeats

The problem:

   Waiting in pthread_join was not fruitful. Examination shows that
   *most* of the threads that are in 'accept' were waiting for 
   the a lock on the socket (state: PS_FDLR_WAIT) and pthread_kill 
   does not do anything to them. One lucky thread would be in PS_FDR_WAIT, 
   and it could be killed... but it is hard for my application to know
   which thread that is.

>How-To-Repeat:

   Sorry, no sample code. I have hacked up the application to the
   point that it is no longer recognizeable.

>Fix:
	
   pthread_kill probably needs to know how to kill processes that
   are waiting for file locks.



>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990807051041.91863.qmail>