Your message dated Tue, 1 Mar 2022 19:26:24 +0200
with message-id <[email protected]>
and subject line Re: Bug#1001542: perl: Hurd: sysread() fails with a "Bad file
descriptor" error
has caused the Debian Bug report #1001542,
regarding perl: Hurd: sysread() fails with a "Bad file descriptor" error
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1001542: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001542
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: perl
Version: 5.32.1-6
Severity: normal
Hi,
First of all, thanks for keeping Perl running on all the Debian
architectures!
I ran into a problem with a test tool for one of my Debian packages -
it would refuse to read a bunch of random bytes from /dev/urandom when
running on the Hurd. It turns out that the problem is not specific to
/dev/urandom - at least on the exodar.debian.net porterbox right now,
the following command fails for /etc/passwd, /tmp/roam.txt, /bin/ls, and
/home/roam/foo.c, so it does not seem to depend on file ownership or
directory hierarchy. Of course, not being very familiar with the Hurd,
I may very well be missing something important here.
[roam@exodar ~]$ perl -e 'use v5.10; use strict; use warnings; sysopen my $fh,
"/bin/ls", 0 or die "sysopen: $!\n"; say "fd ".fileno $fh; my $data; sysread
$fh, $data, 32 or die "sysread: $!\n"; say length $data;'
fd 3
sysread: Bad file descriptor
[roam@exodar ~]$
I tried comparing the rpctrace output for this command and for a similar
Python program, but - again, not being very familiar with the Hurd -
there is nothing that immediately caught my eye.
Thanks again for all you people do for Perl and Debian in general, and
keep up the great work!
G'luck,
Peter
-- System Information:
Debian Release: bookworm/sid
APT prefers unreleased
APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hurd-i386 (i686-AT386)
Kernel: GNU-Mach 1.8+git20210809-486/Hurd-0.9
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages perl depends on:
ii dpkg 1.21.1
ii libperl5.32 5.32.1-6
ii perl-base 5.32.1-6
ii perl-modules-5.32 5.32.1-6
Versions of packages perl recommends:
ii netbase 6.3
Versions of packages perl suggests:
pn libtap-harness-archive-perl <none>
pn libterm-readline-gnu-perl | libterm-readline-perl-perl <none>
ii make 4.1-9.1
pn perl-doc <none>
-- no debconf information
signature.asc
Description: PGP signature
--- End Message ---
--- Begin Message ---
Hi, sorry for the delay.
On Sun, Dec 12, 2021 at 12:15:50AM +0200, Peter Pentchev wrote:
> Package: perl
> Version: 5.32.1-6
> Severity: normal
> [roam@exodar ~]$ perl -e 'use v5.10; use strict; use warnings; sysopen my
> $fh, "/bin/ls", 0 or die "sysopen: $!\n"; say "fd ".fileno $fh; my $data;
> sysread $fh, $data, 32 or die "sysread: $!\n"; say length $data;'
> fd 3
> sysread: Bad file descriptor
Quoting https://www.gnu.org/software/libc/manual/html_node/Access-Modes.html
On GNU/Hurd systems (but not on other systems), O_RDONLY and O_WRONLY
are independent bits that can be bitwise-ORed together, and it is
valid for either bit to be set or clear. This means that O_RDWR is the
same as O_RDONLY|O_WRONLY. A file access mode of zero is permissible;
it allows no operations that do input or output to the file, but does
allow other operations such as fchmod.
Indeed, using Fcntl::O_RDONLY instead of 0 works fine for me on exodar.
Python behaves the same btw:
exodar% python3 -c 'import os; print(len(os.read(os.open("/bin/ls", 0),
32)))'
Traceback (most recent call last):
File "<string>", line 1, in <module>
OSError: [Errno 1073741833] Bad file descriptor
Closing, but let me know if there are still issues.
--
Niko
--- End Message ---