Skip Menu |
Report information
Id: 123977
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: jhi <jhi [at] iki.fi>
Cc:
AdminCc:

Operating System: irix64
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



Subject: t/io/errno.t failures with stdio layer in IRIX
Download (untitled) / with headers
text/plain 2.1k
(IRIX 6.5 IRIX64) There's something fishy about the stdio layer. The 'stdio' half of t/io/errno.t fails, but only under certain circumstances. What works is e.g. "make minitest" or "make test". And the 'perlio' half of the test always seems to work. But what fails, for example, is: cd t ../perl -I../lib io/errno.t (which is what t/harness does, basicallt) which fails with: ... not ok 9 - Wrong errno, PERLIO=stdio stdin='test\n', # got "test\nNo such file or directory" # expected "test\n" not ok 10 - Wrong errno, PERLIO=stdio stdin='test\n', $/=undef # Failed test 10 - Wrong errno, PERLIO=stdio stdin='test\n', $/=undef at io/errno.t line 44 # got "test\nNo such file or directory" # expected "test\n" not ok 11 - Wrong errno, PERLIO=stdio stdin='test\n', $/=\2 # Failed test 11 - Wrong errno, PERLIO=stdio stdin='test\n', $/=\2 at io/errno.t line 44 # got "test\nNo such file or directory" # expected "test\n" not ok 12 - Wrong errno, PERLIO=stdio stdin='test\n', $/=\1024 # Failed test 12 - Wrong errno, PERLIO=stdio stdin='test\n', $/=\1024 at io/errno.t line 44 # got "test\nNo such file or directory" # expected "test\n" not ok 13 - Wrong errno, PERLIO=stdio stdin='test', # Failed test 13 - Wrong errno, PERLIO=stdio stdin='test', at io/errno.t line 44 # got "testNo such file or directory" # expected "test" not ok 14 - Wrong errno, PERLIO=stdio stdin='test', $/=undef # Failed test 14 - Wrong errno, PERLIO=stdio stdin='test', $/=undef at io/errno.t line 44 # got "testNo such file or directory" # expected "test" not ok 15 - Wrong errno, PERLIO=stdio stdin='test', $/=\2 # Failed test 15 - Wrong errno, PERLIO=stdio stdin='test', $/=\2 at io/errno.t line 44 # got "testNo such file or directory" # expected "test" not ok 16 - Wrong errno, PERLIO=stdio stdin='test', $/=\1024 # Failed test 16 - Wrong errno, PERLIO=stdio stdin='test', $/=\1024 at io/errno.t line 44 # got "testNo such file or directory" # expected "test" Just guessing but some well-placed SETERRNO(0,0) is missing, to zap the obvious ENOENT? (as of blead http://perl5.git.perl.org/perl.git/commit/94a0894418670e8bdd2c1d63e76a77225365995d)
RT-Send-CC: perl5-porters [...] perl.org
Notice the "cousin" error in openbsd: https://rt.perl.org/Ticket/Display.html?id=126306
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.6k
Some more debugging. Here's a minimal failure case (run in the t subdirectory): jhi@irix$ echo test | env PERLIO=stdio ../perl -I../lib -e '<>; print $!' No such file or directoryjhi@irix$ Here's a minimal success case: jhi@irix$ echo test | env PERLIO=stdio ../perl -e '<>; print $!' jhi@irix$ Curious, isn't it? The -I../lib is necessary. Also needed are PERLIO=stdio, and the <>. (One can do undef $! or $!=0 before the <>, but it makes no difference.) So I did some system call tracing, par(1) in IRIX. The logs attached. It seems that with the -Ilib there are two groups of open() calls that fail and set the errno: ... 8mS[ 0] : stat("../lib/5.23.4/IP35-irix", 0x7fff28d0) errno = 2 (No such file or directory) 8mS[ 0] : stat("../lib/5.23.4", 0x7fff28d0) errno = 2 (No such file or directory) 8mS[ 0] : stat("../lib/IP35-irix", 0x7fff28d0) errno = 2 (No such file or directory) ... 11mS[ 0] : stat("/usr/lib/locale/C/LC_MESSAGES/uxsyserr", 0x7fff26a0) errno = 2 (No such file or directory) 11mS[ 0] : stat("/usr/lib/locale/C/Xopen/LC_MESSAGES/uxsyserr", 0x7fff26a0) errno = 2 (No such file or directory) 11mS[ 0] : stat("/usr/lib/locale/C/LC_MESSAGES/uxsyserr.cat", 0x7fff26a0) errno = 2 (No such file or directory) The read(0, ...) from stdin (the readline) happens just before the second group of open() calls. (The first group is obviously some -I magic, checking whether per-version per-arch dirs exist.) But the second group is equally obviously locale-related.
Subject: par.log.with.lib.gz
Download par.log.with.lib.gz
application/x-gzip 2.1k

Message body not shown because it is not plain text.

Subject: par.log.without.lib.gz
Download par.log.without.lib.gz
application/x-gzip 1.9k

Message body not shown because it is not plain text.

RT-Send-CC: perl5-porters [...] perl.org
Show quoted text
> ... > 11mS[ 0] : > stat("/usr/lib/locale/C/LC_MESSAGES/uxsyserr", 0x7fff26a0) errno = 2 > (No such file or directory) > 11mS[ 0] : > stat("/usr/lib/locale/C/Xopen/LC_MESSAGES/uxsyserr", 0x7fff26a0) errno > = 2 (No such file or directory) > 11mS[ 0] : > stat("/usr/lib/locale/C/LC_MESSAGES/uxsyserr.cat", 0x7fff26a0) errno = > 2 (No such file or directory) > > ... > > But the second group is equally obviously locale-related.
Not that it's anything to with Perl's locale-code, mind. It seems to be trying to open some operating system level message catalog, for some unknown reason, because the previous system call looks like it succeeded: 11mS[ 0] : syssgi(0x5c, 0x1, 0, 0x2f, 0x101d7ea0, 0x101d7ebb) = 0 syssgi(0x5c, ...) seems to be gloriously undocumented... but purely guessing by its name #define SGI_RXEV_GET 92 it could be to do with the par(1) tracing itself. But in any case, it returned zero.
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 804b
Looks like the stat() calls were red herrings; they were not setting the errno. What was setting it is something in the IRIX stdio implementation. The rabbit hole was pp_readline -> do_readline -> sv_gets -> PerlIO_getc -> PerlIO_read -> PerlIOStdio_read And in the PerlIOStdio_read both the branches: * the count == 1 branch which uses stdio fgetc() * the non-1-else branch which uses stdio fread() got their errno=0 stomped on with errno=2 (ENOENT) with fgetc() and fread() respectively, using the minimized test code originally from t/io/errno.t: echo | env PERLIO=stdio ../perl -I../lib -e '<>; print $!' or echo test | env PERLIO=stdio ../perl -I../lib -e '<>; print $!' Now worked around with commit bdae4172. Before the change "No such file or directory" got printed, after, not.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org