Bug 427860 - Race while attaching to a stopped process
Race while attaching to a stopped process
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Jan Kratochvil
Fedora Extras Quality Assurance
Depends On:
  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:
Last Closed: 2008-04-15 15:59:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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):

How reproducible:

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

Actual results:
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-

This testcase emulates the current Rawhide GDB's behavior as implemented since

* 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

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

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