develooper Front page | perl.perl5.porters | Postings from March 2000

Re: perl 5.6.RC2 pp_sys.c problem (AIX

Thread Previous | Thread Next
March 15, 2000 08:07
Re: perl 5.6.RC2 pp_sys.c problem (AIX
Message ID:
In <>, "David R. Favor" writes:
:High weirdness abounds... I am totally confused about what is suppose to
:be happening here:
:When I replace the code in pp_sys.c with the following and run it (outside dbx
:        {
:            /* See the note at doio.c:do_print about filesize limits. --jhi */
:            int fn = PerlIO_fileno(IoIFP(io));
:            Off_t ilen = 1943;
:            length = PerlLIO_write(fn, buffer+offset, ilen);
:            printf("fn=%d buffer=%X offset=%d isize=%d ilen=%d osize=%d olen=%
:                    fn,    buffer,  offset, sizeof(ilen), ilen, sizeof(length)
:, length);
:        }
:I get the following output:
:   dgsp>cat ~/bin/junker
:   #!/rpm/BUILD/perl-5.6.0-RC2/miniperl -I/rpm/BUILD/perl-5.6.0-RC2/lib
:   use File::Copy;
:   print "pid is $$\n";
:   copy('/etc/hosts','/home/dfavor/bin/junk.txt');
:   dgsp>~/bin/junker
:   pid is 23330
:   fn=4 buffer=20035ED8 offset=0 isize=0 ilen=8 osize=0 olen=1943
:The fileno is correct, but I'm unsure what I'm seeing for the other values.
:It's as if the stack is corrupt and the printf() values are shifted some way.

Looks like 'offset' is bigger than you think: try handling as either
"%ld" and (long)offset, or "%Ld" and (long long)offset.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About