Bug 1473411
Summary: | gdb leaks ignored SIGPIPE to child process | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Eric Blake <eblake> | |
Component: | gdb | Assignee: | Jan Kratochvil <jan.kratochvil> | |
Status: | CLOSED ERRATA | QA Contact: | Michal Kolar <mkolar> | |
Severity: | unspecified | Docs Contact: | Vladimír Slávik <vslavik> | |
Priority: | unspecified | |||
Version: | 7.4 | CC: | gdb-bugs, jan.kratochvil, mcermak, mkolar, ohudlick, palves, sergiodj, vslavik | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | gdb-7.6.1-107.el7 | Doc Type: | No Doc Update | |
Doc Text: |
undefined
|
Story Points: | --- | |
Clone Of: | ||||
: | 1884577 1884578 (view as bug list) | Environment: | ||
Last Closed: | 2018-04-10 10:25:07 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1471969, 1531838 |
Description
Eric Blake
2017-07-20 18:11:52 UTC
The all-zeros SigIgn is a bit weak. You really want to make sure that if gdb starts with something ignored, then the child process ALSO gets started with that same signal ignored. With working gdb, here's a slightly stronger test: $ ( trap - BUS; sleep 30& grep SigIgn /proc/$!/status ) SigIgn: 0000000000000006 $ ( trap '' BUS; sleep 30& grep SigIgn /proc/$!/status ) SigIgn: 0000000000000046 Proof that we can control whether 0x40 is ignored during sleep using just the shell (the shell also ignores SIGINT and SIGQUIT during background tasks; that's life, hence why I used SIGBUS to show what I'm actually toggling) $ ( trap '' BUS; gdb --args sleep 30 ) GNU gdb (GDB) Fedora 8.0-13.fc26 ... (gdb) ! grep SigIgn /proc/self/status SigIgn: 0000000001001040 # So gdb started with SIGBUS ignored, and additionally ignores SIGPIPE itself... (gdb) b main Breakpoint 1 at 0x1590 (gdb) r Starting program: /usr/bin/sleep 30 Breakpoint 1, 0x0000555555555590 in main () (gdb) info thread Id Target Id Frame * 1 process 27153 "sleep" 0x0000555555555590 in main () (gdb) ! grep SigIgn /proc/27153/status SigIgn: 0000000000000040 # ...but the child process sees JUST SIGBUS ignored (ie. the exact environment that we started gdb with, prior to gdb fudging things around) > I didn't see anything in gdb 8's /usr/share/doc/gdb/NEWS that mentions that > this was an intentional bug fix, but obviously newer gdb is being smarter > about restoring the signals that it hands to the child process. Intentional: https://sourceware.org/ml/gdb-patches/2016-08/msg00086.html > (gdb) ! grep SigIgn /proc/self/status
> SigIgn: 0000000001001040
>
> # So gdb started with SIGBUS ignored, and additionally ignores SIGPIPE itself...
GDB should probably be transparent here (!/shell command) too, I guess.
But that'd be a separate bug.
The fix is only a backport of: http://sourceware.org/bugzilla/show_bug.cgi?id=18653 It does not deal with Comment 5 issue. Seems not resolved. Problem described by reporter is still present in gdb-7.6.1-104.el7. Spawned process still inherit mask of ignored signals from gdb. Please review. Thanks. Sorry, a backport mistake. Unfortunately it did compile fine and I did not verify it myself. Reproduced against gdb-7.6.1-100.el7 and verified against gdb-7.6.1-107.el7. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0701 |