Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/tests/lib/libc/sys



Module Name:    src
Committed By:   riastradh
Date:           Tue Sep 22 13:32:24 UTC 2026

Modified Files:
        src/tests/lib/libc/sys: t_mkfifo.c

Log Message:
t_mkfifo: Add test for PR kern/59578.

The problem is:

thread A                        thread B
--------                        --------
enter open("fifo", O_WRONLY)
-> fi_writers++
-> sleep since fi_readers == 0
                                enter open("fifo", O_RDONLY)
                                -> fi_readers++
                                -> return since fi_writers > 0
                                open succeeds with fd
                                enter close(fd)
                                -> fi_readers--
                                close succeeds
*SIGALRM*
-> fi_writers--
open fails with EINTR

At this point, a reader open() has succeeded with no corresponding
writer open() success, and if the writer retries, it will hang
because fi_readers is back to zero.  Instead, when the reader open()
succeeds, it should cause the writer open() to succeed as well (and
handle the signal afterward).

Same problem occurs in with the reader/writer roles reversed.

PR kern/59578: open() hangs indefinitely on FIFO with frequent signal
interruption

Related bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203162
https://bugs.python.org/issue25122
https://github.com/python/cpython/issues/137397


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_mkfifo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index