Bug 427860 - Race while attaching to a stopped process
Race while attaching to a stopped process
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jan Kratochvil
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-07 17:01 EST by Jan Kratochvil
Modified: 2008-04-15 15:59 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-15 15:59:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Testcase. (2.64 KB, text/plain)
2008-01-07 17:01 EST, Jan Kratochvil
no flags Details

  None (edit)
Description Jan Kratochvil 2008-01-07 17:01:42 EST
Description of problem:
The current attaching code implemented since GDB 6.6-27 may have a race.

Version-Release number of selected component (if applicable):
gdb-6.6-27.fc8

How reproducible:
Sparsely.

Steps to Reproduce:
1. gcc -o signalgdb signalgdb.c -Wall -ggdb2
2. ./signalgdb

Actual results:
status=0x137f
signalgdb: signalgdb.c:95: main: Assertion `((((__extension__ ({ union {
__typeof(status) __in; int __i; } __u; __u.__in = (status); __u.__i; }))) &
0xff00) >> 8) == 18' failed.

Expected results:
Endless silent run.

Additional info:
It fails depending on some scheduling mood - sometimes it runs millions cycles
fine and sometimes it aborts in the first loop.
It gets signal SIGSTOP instead of expected SIGCONT.
Abort reproduced on vanilla-2.6.22-rc4-git7.x86_64.
It seems quickly unreproducible on kernel-2.6.23.8-63.fc8.x86_64.

This testcase emulates the current Rawhide GDB's behavior as implemented since
gdb-6.6-27.fc8:

* Mon Sep 17 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-27
- Fix attaching to stopped processes and/or pending signals.

Unfortunately there is a race for already Stopped processes; this
Comment/Testcase could be submitted as a GDB bug instead.  The Stopped process
being attached to by GDB may "run a bit" despite it during the attachment
operation.

This note comes from: Bug 244162 Comment 17
Comment 1 Jan Kratochvil 2008-01-07 17:01:43 EST
Created attachment 291020 [details]
Testcase.
Comment 2 Jan Kratochvil 2008-04-15 15:59:55 EDT
Problem is no longer present in the patch proposed by Daniel J. upstream:
  http://sourceware.org/ml/gdb-patches/2008-04/msg00224.html

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