Dan Sully <[EMAIL PROTECTED]> writes: >I have a reproducable case where PerlIO_seek() fails in a way I don't quite >understand in perl 5.8.1+ > >It works fine with 5.8.0 and 5.6.x (Linux & OSX). > >This fails in 5.8.1+: > > return PerlIO_seek(datasource->stream, offset, whence); > >This does not: > > return fseek(PerlIO_findFILE(datasource->stream), offset, whence);
I have seen weird fails like this when varying large file support and 64/32 bit IV Configure options. What happens is that 'offset' (your variable) is wrong size for Off_t and PerlIO_seek mis-interprets what it gets in its incoming args. You seem to have a small-file 32-bit perl (from -V output below). > >gdb isn't telling me anything very useful, and my errno is just EBADF. Which PerlIO will give if PerlIO * it gets is not valid by its lights. > >Any ideas here? And what would be useful for debugging? I tried to set a >breakpoint at Perl_PerlIO_seek(), but it appears to just be a #define, which >I'd think would propagate down to fseek(). In perl5.8 PerlIO_seek() should be a real function unless you built with -Uuseperlio - which you didn't. > > > >Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration: > Platform: > osname=linux, osvers=2.6.1, archname=i686-linux > uname='linux zot.electricrain.com 2.6.1 #5 smp sat jan 10 18:32:39 pst 2004 i686 > unknown ' > config_args='-es -Dprefix=/pkg/perl-5.8.3' > hint=recommended, useposix=true, d_sigaction=define > usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef > useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef > use64bitint=undef use64bitall=undef uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include', > optimize='-O3', > cppflags='-fno-strict-aliasing -I/usr/local/include' > ccversion='', gccversion='3.3.1', gccosandvers='' > intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 > ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 > alignbytes=4, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -L/usr/local/lib' > libpth=/usr/local/lib /lib /usr/lib > libs=-lnsl -ldl -lm -lcrypt -lutil -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > libc=/lib/libc-2.3.1.so, so=so, useshrplib=false, libperl=libperl.a > gnulibc_version='2.3.1' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' > cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' > > >Characteristics of this binary (from libperl): > Compile-time options: > Built under linux > Compiled at Jan 14 2004 22:07:02 > @INC: > /pkg/perl-5.8.3/lib/5.8.3/i686-linux > /pkg/perl-5.8.3/lib/5.8.3 > /pkg/perl-5.8.3/lib/site_perl/5.8.3/i686-linux > /pkg/perl-5.8.3/lib/site_perl/5.8.3 > /pkg/perl-5.8.3/lib/site_perl > . > >-D