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
0000370 [1003.1(2008)/Issue 7] System Interfaces Objection Error 2011-01-13 16:48 2020-02-14 15:38
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Eric Blake
Organization Red Hat
User Reference ebb.posix_spawn
Section posix_spawn_file_actions_addclose
Page Number 1430
Line Number 46882
Interp Status Approved
Final Accepted Text See Note: 0000718
Summary 0000370: addclose should not cause posix_spawn to fail if closing an already closed fd
Description Right now, the standard requires posix_spawn to fail if any action registered
by posix_spawn_file_actions fails. However, in the case of close() on an
already closed file descriptor, this is unintentionally harsh.

The problem can be worked around by using adddup2 prior to addclose to ensure
that the close will be on a valid file descriptor, but this adds extra work.
Desired Action At line 46673 [XSH posix_spawn], change:

fails for any of the reasons that would cause close( ), dup2( ), or open( ) to
fail, an error value shall be returned

to:

fails for any of the reasons that would cause close( ), dup2( ), or open( ) to
fail, other than attempting a close( ) on a file descriptor that is in range
but already closed, an error value shall be returned

At line 46880 [XSH posix_spawn_file_actions_add_close], change:

The posix_spawn_file_actions_addclose( ) function shall add a close action
to the object referenced by file_actions that shall cause the file
descriptor fildes to be closed (as if close(fildes) had been called) when
a new process is spawned using this file actions object.

to:

The posix_spawn_file_actions_addclose( ) function shall add a close action
to the object referenced by file_actions that shall cause the file
descriptor fildes to be closed (as if close(fildes) had been called) when
a new process is spawned using this file actions object, except that a
nonnegative filedes less than OPEN_MAX that is already closed at the time
when the new process is spawned shall be ignored rather than failing with
EBADF.
Tags issue8
Attached Files

- Relationships
related to 0000149Closedajosey Add fdwalk system interface 
related to 0000418Closedajosey posix_spawn_file_actions_addclose() should not check against OPEN_MAX 

-  Notes
(0000718)
Don Cragun (manager)
2011-03-24 15:16
edited on: 2011-04-28 15:34

Interpretation response
------------------------
The standard states that posix_spawn() must fail with an EBADF error if a request is made to close a file descriptor that is already closed, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
-------------
There are existing implementations that behave this way and there is no reason why this should be disallowed.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Make the changes presented in the Desired Action section plus the changes suggested in Note: 0000745.

(0000724)
ajosey (manager)
2011-03-25 05:51

This proposed interpretation is being circulated for a 30 day review
(0000745)
eblake (manager)
2011-04-20 15:03

An additional change is required:

At line 123287 [XRAT B.3.3 Examples for Spawn], change:

if (close(fd) == -1)

to:

if (close(fd) == -1 && errno != EBADF)
(0000779)
ajosey (manager)
2011-05-05 20:09

The interpretation is now approved.

- Issue History
Date Modified Username Field Change
2011-01-13 16:48 eblake New Issue
2011-01-13 16:48 eblake Status New => Under Review
2011-01-13 16:48 eblake Assigned To => ajosey
2011-01-13 16:48 eblake Name => Eric Blake
2011-01-13 16:48 eblake Organization => Red Hat
2011-01-13 16:48 eblake User Reference => ebb.posix_spawn
2011-01-13 16:48 eblake Section => posix_spawn_file_actions_addclose
2011-01-13 16:48 eblake Page Number => 1430
2011-01-13 16:48 eblake Line Number => 46882
2011-01-13 16:48 eblake Interp Status => ---
2011-01-13 17:04 Don Cragun Status Under Review => Resolved
2011-01-13 17:04 Don Cragun Resolution Open => Accepted
2011-01-13 17:04 Don Cragun Tag Attached: issue8
2011-01-13 17:05 Don Cragun Relationship added related to 0000149
2011-03-24 15:16 Don Cragun Interp Status --- => Pending
2011-03-24 15:16 Don Cragun Note Added: 0000718
2011-03-24 15:16 Don Cragun Status Resolved => Interpretation Required
2011-03-24 15:17 Don Cragun Final Accepted Text => See Note: 0000718
2011-03-25 05:51 ajosey Interp Status Pending => Proposed
2011-03-25 05:51 ajosey Note Added: 0000724
2011-04-20 15:03 eblake Note Added: 0000745
2011-04-28 15:34 Don Cragun Note Edited: 0000718
2011-04-28 15:34 Don Cragun Resolution Accepted => Accepted As Marked
2011-05-05 20:09 ajosey Interp Status Proposed => Approved
2011-05-05 20:09 ajosey Note Added: 0000779
2011-06-02 16:10 eblake Relationship added related to 0000418
2020-02-14 15:38 geoffclare Status Interpretation Required => Applied


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