View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000394 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2011-03-16 16:12 | 2013-04-16 13:06 |
Reporter | nick | Assigned To | ajosey | ||
Priority | normal | Severity | Comment | Type | Clarification Requested |
Status | Closed | Resolution | Accepted | ||
Name | Nick Stoughton | ||||
Organization | USENIX | ||||
User Reference | nms-longjmp-01 | ||||
Section | longjmp | ||||
Page Number | 1256 | ||||
Line Number | 41363-41364 | ||||
Interp Status | Approved | ||||
Final Accepted Text | See 0000394:0000793 | ||||
Summary | 0000394: longjmp clarification | ||||
Description | The C committee noticed the following problem when I presented the POSIX words to them: The text currently states: The longjmp() function shall restore the environment saved by the most recent invocation of setjmp() in the same thread, with the corresponding jmp_buf argument. This implies that if thread A calls setjmp(j), and then sometime later, thread B calls setjmp(j) [i.e. with the same jmp_buf] that the implementation has to track the jump_buf as a thread local variable ... and if thread A subsequently (i.e. after thread B has changed the jmp_buf) calls longjmp(j,x), then it will jump to the first setjmp location (i.e. the one in thread A). | ||||
Desired Action | Replace The longjmp() function shall restore the environment saved by the most recent invocation of setjmp() in the same thread, with the corresponding jmp_buf argument. If there is no such invocation, or if the function containing the invocation of setjmp() has terminated execution in the interim, or if the invocation of setjmp() was within the scope of an identifier with variably modified type and execution has left that scope in the interim, the behavior is undefined with The longjmp() function shall restore the environment saved by the most recent invocation of setjmp() in the same process, with the corresponding jmp_buf argument. If the most recent invocation of setjmp() with the corresponding jmp_buf occurred in another thread, or if there is no such invocation, or if the function containing the invocation of setjmp() has terminated execution in the interim, or if the invocation of setjmp() was within the scope of an identifier with variably modified type and execution has left that scope in the interim, the behavior is undefined | ||||
Tags | tc1-2008 |
|
Interpretation response ------------------------ The standard states that implementations must perform as stated even though no known implementation is able to do so, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor. Rationale: ------------- The latest C1x draft has adopted wording equivalent to the proposed change. The changes suggested document existing practice and are, therefore, suitable for a TC. Notes to the Editor (not part of this interpretation): ------------------------------------------------------- Make the changes listed in the Desired Action. |
|
Interpretation proposed 16 June 2011 for final 30 day review |
|
Corrected the page number. |
|
The interpretation is now approved. |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-03-16 16:12 | nick | New Issue | |
2011-03-16 16:12 | nick | Status | New => Under Review |
2011-03-16 16:12 | nick | Assigned To | => ajosey |
2011-03-16 16:12 | nick | Name | => Nick Stoughton |
2011-03-16 16:12 | nick | Organization | => USENIX |
2011-03-16 16:12 | nick | User Reference | => nms-longjmp-01 |
2011-03-16 16:12 | nick | Section | => longjmp |
2011-03-16 16:12 | nick | Page Number | => 1302 |
2011-03-16 16:12 | nick | Line Number | => 41363-41364 |
2011-03-16 16:12 | nick | Interp Status | => --- |
2011-05-26 15:17 | Don Cragun | Interp Status | --- => Pending |
2011-05-26 15:17 | Don Cragun | Note Added: 0000793 | |
2011-05-26 15:17 | Don Cragun | Status | Under Review => Interpretation Required |
2011-05-26 15:17 | Don Cragun | Resolution | Open => Accepted |
2011-05-26 15:18 | Don Cragun | Final Accepted Text | => See 0000394:0000793 |
2011-05-26 15:18 | Don Cragun | Tag Attached: tc1-2008 | |
2011-06-16 10:15 | ajosey | Interp Status | Pending => Proposed |
2011-06-16 10:15 | ajosey | Note Added: 0000841 | |
2011-06-20 14:14 | ajosey | Page Number | 1302 => 1256 |
2011-06-20 14:14 | ajosey | Note Added: 0000864 | |
2011-07-29 06:15 | ajosey | Interp Status | Proposed => Approved |
2011-07-29 06:15 | ajosey | Note Added: 0000911 | |
2013-04-16 13:06 | ajosey | Status | Interpretation Required => Closed |