Bug 127060 - Program waiting for a semaphore are interrupted when attached from gdb.
Summary: Program waiting for a semaphore are interrupted when attached from gdb.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gdb
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Elena Zannoni
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-07-01 08:28 UTC by Fabrizio Muscarella
Modified: 2015-01-08 00:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-07-14 17:03:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
see bug description (1001 bytes, text/plain)
2004-07-01 08:31 UTC, Fabrizio Muscarella
no flags Details

Description Fabrizio Muscarella 2004-07-01 08:28:50 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686) Gecko/20040428 Galeon/1.3.7

Description of problem:
The bug is related with gdb and system V semaphore.

A program waiting for a semaphore are interrupted if you attach gdb to
to the process and continue the execution.

I write an example to reproduce the problem.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. compile the example program with 'gcc -g3 -Wall -lpthread
-DREENTRANT -o infinite main.c'
2. start the programm
3. start gdb 'gdb <path_to_infinite>/infinite <pid_of_infinite>'
4. in gdb type continue. 
    

Actual Results:  The example program 'infinite' will exit with the
error 'sem_wait: Interrupted system call'.

Expected Results:  Normally should continue to run.

Additional info:

The same result are reached using fork(). So the problem is not
releated with posix thread. 
I founded a bug description at
http://sources.redhat.com/ml/bug-gdb/1999-12/msg00038.html
but don_t exist a fix related to this bug

Comment 1 Fabrizio Muscarella 2004-07-01 08:31:16 UTC
Created attachment 101556 [details]
see bug description

Comment 2 Fabrizio Muscarella 2004-07-14 17:05:37 UTC
Hi,

i fount the problem. If i use evaluate EINTR in a while loop the
program  will work.
This is different from all other Unix Systems (i tested on HP-UX,
Solaris)  but is ok, it works.


Note You need to log in before you can comment on or make changes to this bug.