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
0001772 [1003.1(2016/18)/Issue7+TC2] Shell and Utilities Objection Clarification Requested 2023-08-21 09:58 2023-09-04 10:37
Reporter geoffclare View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Geoff Clare
Organization The Open Group
User Reference
Section make
Page Number 2971
Line Number 98562
Interp Status ---
Final Accepted Text See Note: 0006434.
Summary 0001772: make's ASYNCHRONOUS EVENTS has several problems
Description The ASYNCHRONOUS EVENTS section for the make utility says:
If not already ignored, make shall trap SIGHUP, SIGTERM, SIGINT, and SIGQUIT and remove the current target unless the target is a directory or the target is a prerequisite of the special target .PRECIOUS or unless one of the -n, -p, or -q options was specified. Any targets removed in this manner shall be reported in diagnostic messages of unspecified format, written to standard error. After this cleanup process, if any, make shall take the standard action for all other signals.
There are several problems with this...

1. It says how SIGHUP, SIGTERM, SIGINT, and SIGQUIT are handled when several conditions are all met, but says nothing about how they are handled when any of those conditions is not met.

2. It assumes there is always a "current target". This is not the case if, for example, a signal is received while "make -f -" is reading a makefile supplied on standard input.

3. It requires a "diagnostic message" to be written to standard error, which means (as per 1.4 Utility Description Defaults) that the exit status must indicate that an error occurred, but some implementations instead set the signal to default and re-signal the process to terminate it.

4. It is not clear how the phrase "After this cleanup process, if any" is supposed to be understood. Since "this" refers back to a previously described cleanup process of removing the current target, is "if any" supposed to be making this removal optional for signals other than SIGHUP, SIGTERM, SIGINT, and SIGQUIT? If the removal is allowed it would have to be without the diagnostic message, which seems unlikely to be what was intended. And if removal is allowed for other signals, that includes signals that do not terminate the process (such as SIGTSTP and SIGCONT), which obviously would not have been intended. None of the implementations I tried removed the target for other signals. (I tried Solaris, GNU, and Debian's BSD-derived bmake, but not a "real" BSD make.)

Finally, GNU make doesn't do the specified target removal for SIGHUP, SIGTERM, SIGINT, and SIGQUIT. This could either be treated as a non-conformance in GNU make that they should put right (OPTION 1), or we could allow either behaviour in the standard (OPTION 2).
Desired Action On page 2339 line 74433 section 1.4, change:
Default Behavior: When this section is listed as ``Default.'', or it refers to ``the standard action for all other signals; see Section 1.4 (on page 2336)'' it means ...
to:
Default Behavior: When this section is listed as ``Default.'', or it refers to ``the standard action'' for any signal, it means ...

On page 2971 line 98562 section make, after applying bug 523 replace the text of the ASYNCHRONOUS EVENTS section with:
OPTION 1

For SIGHUP, SIGINT, SIGQUIT, and SIGTERM signals, if the signal was not inherited as ignored, none of the -n, -p, or -q options was specified, make is currently processing a target or inference rule, the current target is not a directory, and the target is not a prerequisite of the special targets .PHONY or .PRECIOUS:
  • make shall catch the signal and remove the current target; any targets removed in this manner shall be reported in diagnostic or informational messages of unspecified format, written to standard error.

  • If make writes a diagnostic message to standard error, it shall exit with a status that indicates an error occurred; otherwise, it shall set the signal to default and re-signal itself.
In all other circumstances, make shall take the standard action for all signals; see [xref to 1.4].

OPTION 2

As above but with "may catch the signal" instead of "shall catch the signal"

On page 2972 line 98577 section make, change STDERR from:
The standard error shall be used only for diagnostic messages.
to:
The standard error shall be used for diagnostic messages and may be used for informational messages about target removals (see ASYNCHRONOUS EVENTS).

Tags applied_after_i8d3, issue8
Attached Files

- Relationships

-  Notes
(0006434)
Don Cragun (manager)
2023-08-21 16:27

Make the following changes:
On page 2339 line 74433 section 1.4, change:
Default Behavior: When this section is listed as ``Default.'', or it refers to ``the standard action for all other signals; see Section 1.4 (on page 2336)'' it means ...
to:
Default Behavior: When this section is listed as ``Default.'', or it refers to ``the standard action'' for any signal, it means ...

On page 2971 line 98562 section make, after applying bug 523 replace the text of the ASYNCHRONOUS EVENTS section with:
For SIGHUP, SIGINT, SIGQUIT, and SIGTERM signals, if the signal was not inherited as ignored, none of the -n, -p, or -q options was specified, make is currently processing a target or inference rule, the current target is neither a directory nor a prerequisite of the special targets .PHONY or .PRECIOUS:
  • make shall catch the signal and, if the time of last data modification of the current target has changed since make began processing the rule to bring that target up to date, remove that target; it may also remove that target if the time of last data modification has not changed. Any targets removed in this manner shall be reported in diagnostic or informational messages of unspecified format, written to standard error.
  • If make writes a diagnostic message to standard error, it shall exit with a status that indicates an error occurred; otherwise, it shall set the signal to default and re-signal itself.
In all other circumstances, make shall take the standard action for all signals; see [xref to 1.4].



On page 2972 line 98577 section make, change STDERR from:
The standard error shall be used only for diagnostic messages.
to:
The standard error shall be used for diagnostic messages and may be used for informational messages about target removals (see ASYNCHRONOUS EVENTS).
(0006435)
geoffclare (manager)
2023-08-22 14:07

For the record, what I said about GNU make in the Description about it not removing the target turned out to be wrong. It does normally remove it, but doesn't do so if the mtime hasn't changed. The makefile I used to check the behaviour just did a sleep as the only command, so the timestamp did not change.

- Issue History
Date Modified Username Field Change
2023-08-21 09:58 geoffclare New Issue
2023-08-21 09:58 geoffclare Name => Geoff Clare
2023-08-21 09:58 geoffclare Organization => The Open Group
2023-08-21 09:58 geoffclare Section => make
2023-08-21 09:58 geoffclare Page Number => 2971
2023-08-21 09:58 geoffclare Line Number => 98562
2023-08-21 09:58 geoffclare Interp Status => ---
2023-08-21 16:27 Don Cragun Note Added: 0006434
2023-08-21 16:28 Don Cragun Final Accepted Text => See Note: 0006434.
2023-08-21 16:28 Don Cragun Status New => Resolved
2023-08-21 16:28 Don Cragun Resolution Open => Accepted As Marked
2023-08-21 16:29 Don Cragun Tag Attached: issue8
2023-08-22 14:07 geoffclare Note Added: 0006435
2023-09-04 10:37 geoffclare Status Resolved => Applied
2023-09-04 10:38 geoffclare Tag Attached: applied_after_i8d3


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