New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hang in ext/POSIX/t/sysconf.t on GNU/Hurd #11731
Comments
From @jmdhCreated by @jmdhThis is a bug report for perl from dom@earth.li, ----------------------------------------------------------------- Original author details and commentary enclosed. Debian bug report is <http://bugs.debian.org/646016> The patch is verified to fix the hang with blead on GNU/Hurd; but note Perl Info
|
From @jmdh0001-Fix-hang-in-ext-POSIX-t-sysconf.t-on-GNU-Hurd.patchFrom e45bf55d20b5565f5fe65593f8e5d689c02a4487 Mon Sep 17 00:00:00 2001
From: Pino Toscano <pino@debian.org>
Date: Mon, 31 Oct 2011 21:37:04 +0000
Subject: [PATCH] Fix hang in ext/POSIX/t/sysconf.t on GNU/Hurd
while compiling perl 5.14.2 on GNU/Hurd, I ran into what it seems a
undefined POSIX behaviour in ext/POSIX/t/sysconf.t.
my $fd = POSIX::open($fifo, O_RDWR)
or skip("could not open $fifo ($!)", 3 * @path_consts_fifo);
according to the POSIX open()[1] about O_RDWR,
The result is undefined if this flag is applied to a FIFO.
.... which is actually our case.
Apparently Linux and *FreeBSD (and maybe also OSes) accept this
behaviour, but on GNU/Hurd this causes the open() call to block
undefinitely. Given there's nothing done with the FIFO if not querying
{,f}pathconf() values, the proposed solution I attached is to change
the opening mode to "O_RDONLY | O_NONBLOCK".
[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
---
ext/POSIX/t/sysconf.t | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ext/POSIX/t/sysconf.t b/ext/POSIX/t/sysconf.t
index 8008996..65625a8 100644
--- a/ext/POSIX/t/sysconf.t
+++ b/ext/POSIX/t/sysconf.t
@@ -125,7 +125,7 @@ SKIP: {
or skip("could not create fifo $fifo ($!)", 2 * 3 * @path_consts_fifo);
SKIP: {
- my $fd = POSIX::open($fifo, O_RDWR)
+ my $fd = POSIX::open($fifo, O_RDONLY | O_NONBLOCK)
or skip("could not open $fifo ($!)", 3 * @path_consts_fifo);
for my $constant (@path_consts_fifo) {
--
1.7.7
|
From @nwc10On Thu, Nov 03, 2011 at 03:10:24PM -0700, Dominic Hargreaves wrote:
Thanks, applied (8040185) Nicholas Clark |
The RT System itself - Status changed from 'new' to 'open' |
@nwc10 - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#102888 (status was 'resolved')
Searchable as RT102888$
The text was updated successfully, but these errors were encountered: