Ian Cass wrote:
>> Eh? wtf?
>
> Debugging some more.

OK, I've traced it down to the embedded perl interpreter inside main.c

I've added some debug immediately inside main() to print when main gets
executed, and to print the exit status from perl_parse and perl_run.

If I run it, main() gets executed twice, second time round, ARGV[0] gets
trimmed by 1 char.

./par -I"/home/users/imc/perl5.8/lib/5.8.1/sun4-solaris-ld" -I"/home/users/i
mc/perl5.8/lib/5.8.1" -I"/home/users/imc/perl5.8/lib/site_perl/5.8.1/sun4-so
laris-ld" -I"/home/users/imc/perl5.8/lib/site_perl/5.8.1" -I"/home/users/imc
/perl5.8/lib/site_perl" -I"." -I../myldr/.. -I../blib/lib -B -O../script/par
l
main.c : main()
main.c ARG 0 = ./par
main.c : main()
main.c ARG 0 = ./pa
par.pl : 0 = ./pa
Couldn't open ./pa
Packing "../blib/lib/PAR.pm"...
<snipped a ton of Written as, Packing stuff>
Written as "auto/Compress/Zlib/autosplit.ix"
exit status perl parse = 0
exit status perl run = 0

The thing to note here, is that perl_parse seems to execute the code!!

If I do this...

    /*fakeargv[2] = load_me_2; */
    fakeargv[2] = "print \"testing123\n\";";

and compile, I get expected results.

./par -I"/home/users/imc/perl5.8/lib/5.8.1/sun4-solaris-ld" -I"/home/users/i
mc/perl5.8/lib/5.8.1" -I"/home/users/imc/perl5.8/lib/site_perl/5.8.1/sun4-so
laris-ld" -I"/home/users/imc/perl5.8/lib/site_perl/5.8.1" -I"/home/users/imc
/perl5.8/lib/site_perl" -I"." -I../myldr/.. -I../blib/lib -B -O../script/par
l
main.c : main()
main.c ARG 0 = ./par
exit status perl parse = 0
testing123
exit status perl run = 0

It seems passing 14632 bytes of data on argv is causing some kind of buffer
overrun.

This is about the limit of my C coding skills.

-- 
Ian Cass

Reply via email to