Bug 1365933
Summary: | The ls program can't be interrupted by a signal | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | David Howells <dhowells> | ||||
Component: | coreutils | Assignee: | Kamil Dudka <kdudka> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 24 | CC: | admiller, dhowells, jamartis, kdudka, kzak, ooprala, ovasik, p, twaugh | ||||
Target Milestone: | --- | Keywords: | Patch | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | coreutils-8.25-15.fc26 coreutils-8.25-15.fc25 coreutils-8.25-7.fc24 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 1421802 (view as bug list) | Environment: | |||||
Last Closed: | 2016-11-05 09:40:12 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: | 1421802 | ||||||
Attachments: |
|
Description
David Howells
2016-08-10 14:30:01 UTC
Could you please attach gdb while ls is hanging and paste the backtrace? #0 0x00007faca7731455 in __opendir (name=0x560b8766cc90 "/afs/user/dhowells") at ../sysdeps/posix/opendir.c:200 #1 0x0000560b8744caed in print_dir (command_line_arg=<optimized out>, realname=0x0, name=<optimized out>) at src/ls.c:2551 #2 main (argc=<optimized out>, argv=<optimized out>) at src/ls.c:1457 Does it work as expected with --color=none or if stdout is redirected off terminal? ls --color=none can be interrupted, as can ls >/tmp/foo. A subsequent ls without anything special will then still be uninterruptible until the network timeout occurs. If ls prints to a terminal, it postpones processing of signals to always leave terminal in a consistent state when being terminated or suspended. A possible solution would be to disable SA_RESTART before calling opendir() and process signals synchronously in an EINTR loop. Nevertheless, I am afraid we will hit the same issue with subsequent stat() calls if the -l option is used. reported upstream: http://lists.gnu.org/archive/html/bug-coreutils/2016-08/msg00010.html Created attachment 1198255 [details]
[PATCH] ls: postpone installation of signal handlers
... until they are actually needed. That is right before the first
escape sequence is printed to a terminal.
Could you please test the attached patch? Does it solve the problem for you? I can prepare a scratch build for Fedora release of your choice if needed... The patch works for me. If I make afs_open() in the kernel sleep till a signal happens than then return -ERESTARTSYS, the old ls just restarts the open() system call when I press CTRL-C, but the patched ls is correctly killed by SIGINT. Thank you for testing the patch! I have proposed it to cureutils upstream: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24232#17 Thanks for the upstream commit! Included in coreutils-8.25-15.fc26... coreutils-8.25-15.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-be13b257bb coreutils-8.25-7.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-75adc7da4f coreutils-8.25-15.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-be13b257bb coreutils-8.25-7.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-75adc7da4f coreutils-8.25-15.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report. coreutils-8.25-7.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report. coreutils-8.25-15.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report. |