Bug 240986 - Break by Ctrl-C before first syscall SIGSTOPs the traced process
Break by Ctrl-C before first syscall SIGSTOPs the traced process
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: strace (Show other bugs)
rawhide
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Brian Brock
:
Depends On:
Blocks: 175398 240842
  Show dependency treegraph
 
Reported: 2007-05-23 11:37 EDT by Jan Kratochvil
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 4.5.16-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-06 13:59:39 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)
Bugfix. (8.20 KB, patch)
2007-05-23 11:37 EDT, Jan Kratochvil
no flags Details | Diff
Bugfix updated according to the Roland's comments. (17.03 KB, patch)
2007-05-25 08:45 EDT, Jan Kratochvil
no flags Details | Diff
Testcase for easier testing of attachment to a long lasting single syscall. (544 bytes, text/plain)
2007-05-25 08:45 EDT, Jan Kratochvil
no flags Details
Bugfix update #2 according to the Roland's comments. (17.34 KB, patch)
2007-06-11 08:09 EDT, Jan Kratochvil
no flags Details | Diff

  None (edit)
Description Jan Kratochvil 2007-05-23 11:37:20 EDT
Description of problem:
CTRL-C of `strace -p' attached to a process before it is able to print the first
syscall will get the application Stopped (T, by SIGSTOP) and needs to be sent
`kill -CONT'.  Shell prints:
[1]+  Stopped                 appname args

Version-Release number of selected component (if applicable):
strace-4.5.15-1.el5.ia64

How reproducible:
Always.

Steps to Reproduce [by skasal@redhat.com]:
1. Run "mke2fs /dev/sda2" or "mke2fs -F HUGE" in one terminal.
2. In another terminal, attach to the process with
      strace -p `/sbin/pidof /sbin/mke2fs`
   at the moment when the mke2fs process has just written
      "Writing superblocks and filesystem accounting information:"
3. Hit Ctrl-C to break the strace.

Actual results:
[1]+  Stopped                 appname args

Expected results:
Application left running without any strace(1) notice.

Additional info:
Comment 1 Jan Kratochvil 2007-05-23 11:37:20 EDT
Created attachment 155264 [details]
Bugfix.
Comment 2 Jan Kratochvil 2007-05-25 08:45:11 EDT
Created attachment 155446 [details]
Bugfix updated according to the Roland's comments.
Comment 3 Jan Kratochvil 2007-05-25 08:45:59 EDT
Created attachment 155447 [details]
Testcase for easier testing of attachment to a long lasting single syscall.
Comment 4 Jan Kratochvil 2007-06-11 08:09:10 EDT
Created attachment 156701 [details]
Bugfix update #2 according to the Roland's comments.
Comment 5 Roland McGrath 2007-07-05 15:50:13 EDT
should be fixed upstream
Comment 6 Jan Kratochvil 2007-08-03 07:43:33 EDT
Fixed in Rawhide strace-4.5.16-1.fc8:
* Fri Aug  3 2007 Roland McGrath <roland@redhat.com> - 4.5.16-1
- fix spurious SIGSTOP on early interrupt (#240986)

and upstream:

2007-06-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

        Never interrupt when the attached traced process would be left stopped.
        * strace.c (main): `-p' attaching moved to ...
        (startup_attach): ... a new function, renamed a variable C to TCBI.
        Block interrupting signals since the first tracee has been attached.
        New comment about INTERRUPTED in the nonthreaded case.
        [LINUX] (startup_attach): Check INTERRUPTED after each attached thread.
        (main): Command spawning moved to ...
        (startup_child): ... a new function, replaced RETURN with EXIT.
        [LINUX] (detach): New variable CATCH_SIGSTOP, do not signal
        new SIGSTOP for processes still in TCB_STARTUP.
        (main): Move signals and BLOCKED_SET init before the tracees attaching,
        [SUNOS4] (trace): Removed fixvfork () call as a dead code, SIGSTOP must
        have been already caught before clearing TCB_STARTUP.
        (trace): Removed the `!WIFSTOPPED(status)' dead code.
        Clear TCB_STARTUP only in the case the received signal was SIGSTOP.
        New comment when `TCB_BPTSET && TCB_STARTUP' combination can be set.
        Code advisory: Roland McGrath
        Fixes RH#240986.
Comment 7 Fedora Update System 2007-08-06 13:59:18 EDT
strace-4.5.16-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

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