A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=689 ====================================================================== Reported By: dalias Assigned To: ajosey ====================================================================== Project: 1003.1(2008)/Issue 7 Issue ID: 689 Category: System Interfaces Type: Clarification Requested Severity: Editorial Priority: normal Status: Under Review Name: Rich Felker Organization: musl libc User Reference: Section: XSH 2.5 Page Number: unknown Line Number: unknown Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2013-05-05 15:37 UTC Last Modified: 2023-08-10 16:29 UTC ====================================================================== Summary: Possibly unintended allowance for stdio deadlock ======================================================================
---------------------------------------------------------------------- (0006428) geoffclare (manager) - 2023-08-10 16:29 https://austingroupbugs.net/view.php?id=689#c6428 ---------------------------------------------------------------------- Interpretation response ------------------------ The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor. Rationale: ------------- There are possible deadlocks in multi-threaded applications that were not considered when POSIX added support for threading. Notes to the Editor (not part of this interpretation): ------------------------------------------------------- After Issue 8 draft 3 page 520 line 18489 section 2.5:<blockquote>All functions that read, write, position, or query the position of a stream, except those with names ending _unlocked, shall lock the stream as if by a call to flockfile( ) before accessing it and release the lock as if by a call to funlockfile( ) when the access is complete.</blockquote>add:<blockquote>[CX]If the lock is not immediately available, the function shall wait for it to become available, except in the following circumstances. If the stream is line buffered and is open for writing or for update, and the reason the function is attempting to lock the stream is because it is going to request input on another stream that is unbuffered, or is line buffered and requires the transmission of characters from the host environment (see above), then the function shall attempt to determine whether a deadlock situation exists. If a deadlock situation is found to exist, the function shall fail. If the function is able to establish that a deadlock situation does not exist, it shall wait for the lock to become available. If the function does not establish whether or not a deadlock situation exists, it shall continue as if it had already locked the stream, found its buffer to be empty, and released the lock.[/CX]</blockquote> Issue History Date Modified Username Field Change ====================================================================== 2013-05-05 15:37 dalias New Issue 2013-05-05 15:37 dalias Status New => Under Review 2013-05-05 15:37 dalias Assigned To => ajosey 2013-05-05 15:37 dalias Name => Rich Felker 2013-05-05 15:37 dalias Organization => musl libc 2013-05-05 15:37 dalias Section => XSH 2.5 2013-05-05 15:37 dalias Page Number => unknown 2013-05-05 15:37 dalias Line Number => unknown 2013-05-05 17:13 jilles Note Added: 0001588 2013-05-05 18:11 dalias Note Added: 0001589 2013-05-07 11:08 geoffclare Note Added: 0001591 2015-05-07 08:34 dancol Issue Monitored: dancol 2023-08-10 16:29 geoffclare Note Added: 0006428 ======================================================================
