Bug 127060

Summary: Program waiting for a semaphore are interrupted when attached from gdb.
Product: Red Hat Enterprise Linux 3 Reporter: Fabrizio Muscarella <fabrizio.muscarella>
Component: gdbAssignee: Elena Zannoni <ezannoni>
Status: CLOSED NOTABUG QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: cagney, jjohnstn, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-07-14 17:03:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
see bug description none

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.