lkml.org 
[lkml]   [1999]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectBug with fcntl locks, pthread mutexes, and threads?
I think I'm running into a very complicated threading bug.

To reproduce it, I use the attached C program. The program forks off
two child processes, each with two threads. Each thread tries to grab
a two-layer lock, with a pthread lock followed by an fcntl lock. The
thread then sleeps for a long time. So, once we have a thread that has
gotten through both locks, we have:

process 1:
thread 1: holds pthread lock, holds fcntl lock, sleeping
thread 2: waiting on pthread lock
process 2:
thread 1: holds pthread lock, waiting on fcntl lock
thread 2: waiting on pthread lock

Then I kill -TERM process 1. All of its threads go away, but process
2, thread 1 never wakes up out of fcntl(). lsof claims that none of
the remaining processes/threads hold the lock.

This sounds like a bug.

--
Manoj Kasichainula - manojk@raleigh.ibm.com
IBM, Apache Development

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.023 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site