A NOTE has been added to this issue. 
====================================================================== 
https://austingroupbugs.net/view.php?id=1629 
====================================================================== 
Reported By:                mirabilos
Assigned To:                
====================================================================== 
Project:                    1003.1(2016/18)/Issue7+TC2
Issue ID:                   1629
Category:                   Shell and Utilities
Type:                       Clarification Requested
Severity:                   Editorial
Priority:                   normal
Status:                     New
Name:                       mirabilos 
Organization:               mksh 
User Reference:              
Section:                    unsure which applies 
Page Number:                (page or range of pages) 
Line Number:                (Line or range of lines) 
Interp Status:              --- 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2023-01-15 17:30 UTC
Last Modified:              2023-03-20 16:21 UTC
====================================================================== 
Summary:                    Shell vs. read(2) errors on the script
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0000367 interaction between readonly, export, g...
related to          0001490 warn app writers about flush errors not...
====================================================================== 

---------------------------------------------------------------------- 
 (0006210) geoffclare (manager) - 2023-03-20 16:21
 https://austingroupbugs.net/view.php?id=1629#c6210 
---------------------------------------------------------------------- 
Add a row (D2.1 p2330)  to the table in 2.8.1 Consequences of Shell Errors:
   
<blockquote>Unrecoverable read error when reading commands | shall exit *4
| shall exit *4 | yes</blockquote>

and add a new note after the table:
<blockquote>4.  If an unrecoverable read error occurs when reading
commands, other than from the <i>file</i> operand of the <i>dot</i> special
built-in, the shell shall execute no further commands (including any
already successfully read but not yet executed) other than any specified in
a previously defined EXIT <i>trap</i> action. An unrecoverable read error
while reading from the <i>file</i> operand of the <i>dot</i> special
built-in shall be treated as a special built-in utility
error.</blockquote>

Change P3155, L107009-107011 in the exit status section of the sh utility
from:
<blockquote>1-125<blockquote>A non-interactive shell detected an error
other than <i>command_file</i> not found or executable, including but not
limited to syntax, redirection, or variable assignment
errors.</blockquote></blockquote>
to:
<blockquote>1-125<blockquote>A non-interactive shell detected an error
other than <i>command_file</i> not found, <i>command_file</i> not
executable, or an unrecoverable read error while reading commands (except
from the <i>file</i> operand of the <i>dot</i> special built-in); including
but not limited to syntax, redirection, or variable assignment
errors.</blockquote></blockquote>
      
Add to the exit status section of the sh utility on P3155 after L107014:
<blockquote>128<blockquote>An unrecoverable read error was detected while
reading commands, except from the <i>file</i> operand of the <i>dot</i>
special built-in. 
    </blockquote></blockquote>
    
On D2.1 page 358 line 12462 section <stdlib.h> (RATIONALE), change:
<blockquote>Exit statuses of 126, 127, and greater than 128 are ambiguous
in certain circumstances because they have special meanings in the shell
(see [xref to XCU 2.8.2]).</blockquote>
to:
<blockquote>Exit statuses of 126 and greater are ambiguous in certain
circumstances because they have special meanings in the shell (see [xref to
XCU 2.8.2] and the EXIT STATUS section of [xref to XCU sh]).</blockquote>

On D2.1 page 359 line 12469 section <stdlib.h> (RATIONALE),  delete:
<blockquote>The value 128 is disallowed for simplicity, making the allowed
values 1 to 125 inclusive rather than 1 to 125 inclusive and
128.</blockquote>

After D2.1 page 531 line 18867 section _Exit() (APPLICATION USAGE), add a
new paragraph:
<blockquote>Exit statuses of 126 and greater are ambiguous in certain
circumstances because they have special meanings in the shell (see [xref to
XCU 2.8.2] and the EXIT STATUS section of [xref to XCU sh]).</blockquote>

After D2.1 page 789 line 27009 section exit() (APPLICATION USAGE), add a
new paragraph (after applying bug 1490):
<blockquote>See also _Exit().</blockquote>

On D2.1 page 2370 line 76769 section exit (RATIONALE), change:
<blockquote>As explained in other sections, certain exit status values have
been reserved for special uses and should be used by applications only for
those purposes:

126 A file to be executed was found, but it was not an executable utility.

127 A utility to be executed was not found.

>128 A command was interrupted by a signal.</blockquote>
to:
<blockquote>As explained in other sections, certain exit status values have
been reserved for special uses and should be used by applications only for
those purposes:

126 A file to be executed was found, but it was not an executable utility.

127 A utility to be executed was not found.

128 An unrecoverable read error was detected by the shell while reading
commands, except from the <i>file</i> operand of the <i>dot</i> special
built-in. 

>128 A command was interrupted by a signal.</blockquote>
On page 3238 line 110033 section tsort (RATIONALE), after applying bug 1617
change:
<blockquote>Implementations are urged to set the implementation-defined
maximum number of cycles reported via the exit status to at most 125,
leaving 128 for other errors, and leaving 126, 127, and values greater than
128 to have the special meanings that the shell assigns to them. (An
implementation that wants to distinguish other types of errors would need
to set the maximum to less than 125 so that 128 is not the only code
available for those errors).</blockquote>
to:
<blockquote>Implementations are urged to set the implementation-defined
maximum number of cycles reported via the exit status to at most 124,
leaving values above that maximum through 125 for other errors, and leaving
values 126 and greater to have the special meanings that the shell assigns
to them.</blockquote> 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2023-01-15 17:30 mirabilos      New Issue                                    
2023-01-15 17:30 mirabilos      Name                      => mirabilos       
2023-01-15 17:30 mirabilos      Organization              => mksh            
2023-01-15 17:30 mirabilos      URL                       => unsure which
applies
2023-01-15 17:30 mirabilos      Section                   => unsure which
applies
2023-01-20 21:18 chet_ramey     Note Added: 0006120                          
2023-01-30 16:45 nick           Relationship added       related to 0000367  
2023-02-02 15:51 chet_ramey     Note Added: 0006142                          
2023-02-04 17:46 chet_ramey     Note Added: 0006143                          
2023-02-09 16:59 geoffclare     Note Added: 0006145                          
2023-02-09 17:06 geoffclare     Project                  Online Pubs =>
1003.1(2016/18)/Issue7+TC2
2023-02-18 21:51 mirabilos      Note Added: 0006158                          
2023-02-18 21:54 mirabilos      Note Edited: 0006158                         
2023-02-20 21:14 chet_ramey     Note Added: 0006160                          
2023-02-20 22:47 mirabilos      Note Added: 0006161                          
2023-02-21 05:58 kre            Note Added: 0006163                          
2023-02-22 17:25 McDutchie      Note Added: 0006167                          
2023-02-22 17:32 McDutchie      Note Edited: 0006167                         
2023-02-22 17:39 McDutchie      Note Added: 0006168                          
2023-03-05 11:20 hvd            Note Added: 0006192                          
2023-03-06 19:07 hvd            Note Added: 0006195                          
2023-03-06 19:10 hvd            Note Edited: 0006195                         
2023-03-06 19:11 hvd            Note Edited: 0006195                         
2023-03-06 19:13 hvd            Note Edited: 0006195                         
2023-03-09 17:29 geoffclare     Note Added: 0006196                          
2023-03-09 17:44 hvd            Note Added: 0006197                          
2023-03-10 09:20 geoffclare     Note Added: 0006198                          
2023-03-10 10:57 hvd            Note Added: 0006199                          
2023-03-10 14:52 kre            Note Added: 0006200                          
2023-03-10 21:33 chet_ramey     Note Added: 0006201                          
2023-03-20 15:48 eblake         Relationship added       related to 0001490  
2023-03-20 16:21 geoffclare     Note Added: 0006210                          
======================================================================


        • ... Harald van Dijk via austin-group-l at The Open Group
        • ... Robert Elz via austin-group-l at The Open Group
          • ... Harald van Dijk via austin-group-l at The Open Group
            • ... Chet Ramey via austin-group-l at The Open Group
              • ... Harald van Dijk via austin-group-l at The Open Group
              • ... Chet Ramey via austin-group-l at The Open Group
              • ... Harald van Dijk via austin-group-l at The Open Group
    • Re: Syn... Robert Elz via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group

Reply via email to