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

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

Thread Previous | Thread Next
From:
Hugo
Date:
March 15, 2000 08:07
Subject:
Re: perl 5.6.RC2 pp_sys.c problem (AIX 4.3.3.11)
Message ID:
200003151613.QAA25594@crypt.compulink.co.uk
In <38CFA76F.42FC9245@austin.ibm.com>, "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=%
:d\n",
:                    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.

Hugo

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About