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

Re: [ID 20000929.001] Using ARGV can cause core dump

Thread Previous | Thread Next
From:
Hugo
Date:
September 29, 2000 13:40
Subject:
Re: [ID 20000929.001] Using ARGV can cause core dump
Message ID:
200009292041.VAA18861@crypt.compulink.co.uk
In <20000930070622.3588.qmail@infonium.com>, jlawrenc@infonium.com writes:
:By assigning $ARGV[1] to a variable:
: $lang=$ARGV[1] || "e";
:and then later using it in hash references:
: $blort{'e'}="Happy day"
: print $blort{$lang}
:I sometimes core dump.

That seems very strange. If you can find a way of making it reliably
reproducible and then cut it down to a small test case it would be
very helpful. It initially sounds as if the original system memory
for the arguments is being moved out from under you, but as far as I
can see the arguments are _copied_ into newly acquired memory when
setting up the ARGV array. (In 5.6.0 this should be done by the code:
            SV *sv = newSVpv(argv[0],0);
at line 3180 of perl.c).

If that is the case, it sounds likely to be a more random corruption
that just happens to be hitting this variable. If so, I'd expect
you to see other variables causing a coredump from time to time as
well. This shouldn't be happening. :)

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