Anonymous | Login | 2023-10-02 23:43 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 | ||
0000627 | [1003.1(2008)/Issue 7] Shell and Utilities | Editorial | Clarification Requested | 2012-10-29 01:39 | 2019-06-10 08:55 | ||
Reporter | dalias | View Status | public | ||||
Assigned To | ajosey | ||||||
Priority | normal | Resolution | Accepted As Marked | ||||
Status | Closed | ||||||
Name | Rich Felker | ||||||
Organization | musl libc | ||||||
User Reference | |||||||
Section | XSH 2.9.5 Thread Cancellation, system() | ||||||
Page Number | unknown | ||||||
Line Number | unknown | ||||||
Interp Status | Approved | ||||||
Final Accepted Text | Note: 0001419 | ||||||
Summary | 0000627: Behavior of system() when cancelled is not specified | ||||||
Description |
The system() function is specified to be a cancellation point, but as no EINTR error is specified for this function, there is no specification for its side effects when cancelled. The documentation for system() contains a sample implementation in the rationale. This is of course not normative, but if it were, the behavior of system() on cancellation would be to leak a process id (which the application has no way to subsequently wait on) and leave the signal dispositions in a modified state. I doubt this is the intended behavior. The only robust approaches to cancellation of system() that come to my mind are the following: 1. Have system() act on cancellation only if it is already pending before the child process is created. This is definitely safe, but renders its status as a cancellation point mostly useless. 2. Have system() kill and wait on the child before if cancelled, then restore the signal dispositions before invoking the application's cancellation handlers. This seems like the most desirable behavior in most cases, but it could be undesirable if it interrupts an external command in a way that leaves files or other resources in an inconsistent state. 3. Have system() act on cancellation immediately, but guarantee that the child process will be properly waited upon in some implementation-defined manner (e.g. by a new thread created from system's cancellation cleanup handler purely for this purpose). |
||||||
Desired Action |
Please clarify the intent as to the behavior of system() on cancellation, or that this behavior is implementation-defined. |
||||||
Tags | tc2-2008 | ||||||
Attached Files | |||||||
|
![]() |
|||
Date Modified | Username | Field | Change |
2012-10-29 01:39 | dalias | New Issue | |
2012-10-29 01:39 | dalias | Status | New => Under Review |
2012-10-29 01:39 | dalias | Assigned To | => ajosey |
2012-10-29 01:39 | dalias | Name | => Rich Felker |
2012-10-29 01:39 | dalias | Organization | => musl libc |
2012-10-29 01:39 | dalias | Section | => XSH 2.9.5 Thread Cancellation, system() |
2012-10-29 01:39 | dalias | Page Number | => unknown |
2012-10-29 01:39 | dalias | Line Number | => unknown |
2012-10-30 11:36 | Konrad_Schwarz | Note Added: 0001414 | |
2012-10-31 04:33 | dalias | Note Added: 0001415 | |
2012-11-08 17:26 | geoffclare | Note Added: 0001419 | |
2012-11-28 16:40 | geoffclare | Note Edited: 0001419 | |
2012-11-28 16:41 | geoffclare | Interp Status | => Pending |
2012-11-28 16:41 | geoffclare | Final Accepted Text | => Note: 0001419 |
2012-11-28 16:41 | geoffclare | Status | Under Review => Interpretation Required |
2012-11-28 16:41 | geoffclare | Resolution | Open => Accepted As Marked |
2012-11-28 16:42 | geoffclare | Tag Attached: tc2-2008 | |
2013-03-29 08:05 | ajosey | Interp Status | Pending => Proposed |
2013-03-29 08:05 | ajosey | Note Added: 0001519 | |
2013-05-03 12:19 | ajosey | Interp Status | Proposed => Approved |
2013-05-03 12:19 | ajosey | Note Added: 0001576 | |
2019-06-10 08:55 | agadmin | Status | Interpretation Required => Closed |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |