Anonymous | Login | 2024-05-04 15:00 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0000751 | [1003.1(2013)/Issue7+TC1] Shell and Utilities | Comment | Clarification Requested | 2013-09-17 15:10 | 2019-06-10 08:55 | ||
Reporter | geoffclare | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted | ||||
Status | Closed | ||||||
Name | Geoff Clare | ||||||
Organization | The Open Group | ||||||
User Reference | |||||||
Section | 2.11 | ||||||
Page Number | 2353 | ||||||
Line Number | 74957 | ||||||
Interp Status | Approved | ||||||
Final Accepted Text | Note: 0001859 | ||||||
Summary | 0000751: Using trap to reset SIGINT/QUIT in an asynchronous subshell | ||||||
Description |
Several current shells have a feature/bug, which seems to be the result of historical accident, whereby they silently ignore attempts to use trap to set SIGINT or SIGQUIT to the default action or to set a trap for them after they have been set to be ignored by the shell when it executes an asynchronous subshell (and job control is disabled). For example, if a script containing the following is run in the foreground at a terminal: (trap - INT; exec sleep 10) & wait and is then terminated by typing the interrupt character, in these shells the sleep does not get the signal and continues running in the background. I would like clarification that this behaviour is not allowed by the standard and should be considered a bug in the shells that do it. The behaviour seems to have no benefit at all, and prevents shell script authors from executing multiple subshells in parallel and making them interruptible (which is desirable if the script is going to wait for them). Note that this behaviour has no connection with the following statement in the description of trap: Signals that were ignored on entry to a non-interactive shell cannot be trapped or reset, although no error need be reported when attempting to do so. which applies only on entry to the shell itself, not on entry to a subshell. Nor is it due to a misinterpretation of this text as applying to subshells, since it does not happen in the affected shells if trap is used to ignore SIGINT before executing a (non-asynchronous) subshell, as in: trap "" INT; (trap - INT; exec sleep 10) |
||||||
Desired Action |
1. Issue a "standard is clear; standard is right" interpretation. 2. Add some rationale about the issue in XRAT... After page 3700 line 126619 section C.2.11 add a new first paragraph: Historically, some shell implementations silently ignored attempts to use trap to set SIGINT or SIGQUIT to the default action or to set a trap for them after they have been set to be ignored by the shell when it executes an asynchronous subshell (and job control is disabled). This behavior is not conforming. For example, if a shell script containing the following line is run in the foreground at a terminal: (trap - INT; exec sleep 10) & wait and is then terminated by typing the interrupt character, this standard requires that the sleep command is terminated by the SIGINT signal. |
||||||
Tags | tc2-2008 | ||||||
Attached Files | |||||||
|
Relationships | ||||||
|
Issue History | |||
Date Modified | Username | Field | Change |
2013-09-17 15:10 | geoffclare | New Issue | |
2013-09-17 15:10 | geoffclare | Name | => Geoff Clare |
2013-09-17 15:10 | geoffclare | Organization | => The Open Group |
2013-09-17 15:10 | geoffclare | Section | => 2.11 |
2013-09-17 15:10 | geoffclare | Page Number | => 2353 |
2013-09-17 15:10 | geoffclare | Line Number | => 74957 |
2013-09-17 15:10 | geoffclare | Interp Status | => --- |
2013-09-17 15:11 | geoffclare | Relationship added | related to 0000750 |
2013-10-03 16:22 | msbrown | Interp Status | --- => Pending |
2013-10-03 16:22 | msbrown | Note Added: 0001859 | |
2013-10-03 16:22 | msbrown | Status | New => Interpretation Required |
2013-10-03 16:22 | msbrown | Resolution | Open => Accepted |
2013-10-03 16:23 | msbrown | Final Accepted Text | => Note: 0001859 |
2013-10-03 16:23 | msbrown | Tag Attached: tc2-2008 | |
2013-10-03 16:25 | msbrown | Note Edited: 0001859 | |
2013-10-04 08:52 | shware_systems | Note Added: 0001860 | |
2013-10-04 12:17 | geoffclare | Note Added: 0001861 | |
2013-10-06 01:45 | shware_systems | Note Added: 0001862 | |
2014-02-21 15:40 | ajosey | Interp Status | Pending => Proposed |
2014-02-21 15:40 | ajosey | Note Added: 0002156 | |
2014-03-25 13:44 | ajosey | Interp Status | Proposed => Approved |
2014-03-25 13:44 | ajosey | Note Added: 0002207 | |
2019-06-10 08:55 | agadmin | Status | Interpretation Required => Closed |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |