Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001029 [1003.1(2013)/Issue7+TC1] Shell and Utilities Objection Error 2016-02-22 22:20 2019-10-23 09:34
Reporter rhansen View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Richard Hansen
Organization
User Reference
Section 2.14 trap
Page Number 2391
Line Number 76206-76207
Interp Status ---
Final Accepted Text See Note: 0003510
Summary 0001029: typo? in specification of $? after a trap action completes
Description Page 2391 lines 76206-76207 (XCU 2.14 trap) says:
The value of <tt>"$?"</tt> after the trap action completes shall be the value it had before trap was invoked.

I believe "before the trap action was executed" was intended (it does not make sense to remember $? from before the trap utility was invoked).
Desired Action On page 2391 lines 76206-76207 (XCU 2.14 trap), change:
The value of <tt>"$?"</tt> after the trap action completes shall be the value it had before trap was invoked.

to:
The value of <tt>"$?"</tt> after the trap action completes shall be the value it had before the trap action was executed.

Tags tc3-2008
Attached Files

- Relationships

-  Notes
(0003084)
geoffclare (manager)
2016-02-23 15:04

Comparing the original POSIX.2-1992 text with the SUSv4 2013 edition, there are some places where POSIX.2 had "trap" with no special formatting and in SUSv4 these have italicised "trap" and (sometimes) dropped a preceding "the", thus turning them into references to the trap utility. The line reported here is one case. Others I have spotted are at line 76213:
The environment in which the shell executes a trap on EXIT shall be identical to the environment immediately after the last command executed before the trap on EXIT was taken.
and 76215:
Each time trap is invoked, the action argument shall be processed in a manner equivalent to:

<tt>eval action</tt>

There are probably more cases. We should double check every use of "trap" in section 2.14.
(0003085)
shware_systems (reporter)
2016-02-23 15:53

Perhaps spelling out "when a trapped signal or EXIT occurs" rather than "executes a trap" or "trap is invoked" cleaner for describing what the shell signal handlers are expected to do, and trap by itself limited to describing actions the utility performs in setting up how the shell responds.
(0003510)
rhansen (manager)
2016-12-08 16:09

(TC2 page and line numbers)

Change page 2399, lines 76765-76766 from:
A trap on EXIT shall be executed before the shell terminates, except when the exit utility is invoked in that trap itself, in which case the shell shall exit immediately.
to:
A trap action on EXIT shall be executed before the shell terminates, except when the exit utility is invoked in that trap action itself, in which case the shell shall exit immediately.

On page 2420 lines 77493-77494, change:
The value of <tt>"$?"</tt> after the trap action completes shall be the value it had before trap was invoked.
to:
The value of <tt>"$?"</tt> after the trap action completes shall be the value it had before the trap action was executed.

On page 2420 lines 77500-77502, change:
The environment in which the shell executes a trap on EXIT shall be identical to the environment immediately after the last command executed before the trap on EXIT was taken.

Each time trap is invoked, the action argument shall be processed in a manner equivalent to:

to:
The environment in which the shell executes a trap action on EXIT shall be identical to the environment immediately after the last command executed before the trap action on EXIT was executed.

If action is neither <tt>'-'</tt> nor the empty string, then each time a matching condition arises the action shall be executed in a manner equivalent to:

- Issue History
Date Modified Username Field Change
2016-02-22 22:20 rhansen New Issue
2016-02-22 22:20 rhansen Name => Richard Hansen
2016-02-22 22:20 rhansen Section => 2.14 trap
2016-02-22 22:20 rhansen Page Number => 2391
2016-02-22 22:20 rhansen Line Number => 76206-76207
2016-02-22 22:20 rhansen Interp Status => ---
2016-02-23 15:04 geoffclare Note Added: 0003084
2016-02-23 15:53 shware_systems Note Added: 0003085
2016-12-08 16:09 rhansen Note Added: 0003510
2016-12-08 16:10 nick Final Accepted Text => See Note: 0003510
2016-12-08 16:10 nick Status New => Resolved
2016-12-08 16:10 nick Resolution Open => Accepted As Marked
2016-12-08 16:10 nick Tag Attached: tc3-2008
2019-10-23 09:34 geoffclare Status Resolved => Applied


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker