Re: segment fault in Bytecode script

46 views
Skip to first unread message

Reini Urban

unread,
Nov 4, 2010, 5:58:48 AM11/4/10
to hoow...@gmail.com, perl-c...@googlegroups.com
2010/11/4 hoow...@gmail.com <hoow...@gmail.com>:
> in centos 5.5  perl 5.8.8
> i am also tested on ubuntu 10.10 with perl 5.10.1
>
> i give you full example code attachment files:

I can reproduce it. It fails in the op destruction phase threaded-only
$ gdb perl5.10.1d
(gdb) run -I. t1a.pl
(gdb) bt
#0 0x520a9435 in Perl_pad_swipe (my_perl=0x121a190, po=5, refadjust=1
'\001') at pad.c:1121
#1 0x52001d59 in Perl_op_clear (my_perl=0x121a190, o=0x122aaa0) at op.c:600
#2 0x52001ad4 in Perl_op_free (my_perl=0x121a190, o=0x122aaa0) at op.c:518
#3 0x52001a50 in Perl_op_free (my_perl=0x121a190, o=0x122aac0) at op.c:497
#4 0x52001a50 in Perl_op_free (my_perl=0x121a190, o=0x122ab48) at op.c:497
#5 0x52026a9b in perl_destruct (my_perl=0x121a190) at perl.c:812
#6 0x00401236 in _fu0__PL_do_undump () at perlmain.c:119
#1 0x52001d59 in Perl_op_clear (my_perl=0x121a190, o=0x122aaa0) at op.c:600
600 pad_swipe(o->op_targ,1);
(gdb) p o
$1 = (OP *) 0x122aaa0
(gdb) p *o
$2 = {op_next = 0x122aa60, op_sibling = 0x122aa80, op_ppaddr =
0x52130c88 <Perl_pp_const>,
op_madprop = 0x0, op_targ = 5, op_type = 5, op_opt = 1, op_latefree
= 0, op_latefreed = 0,
op_attached = 0, op_spare = 0, op_flags = 2 '\002', op_private = 0 '\0'}

I will fix that.
Tracked as issue 54 at
http://code.google.com/p/perl-compiler/issues/detail?id=54

> test 1:
> --------------------------------------------------------------
> perl -MO=Bytecode,-H,-ot1b.pm t1b.pl
>
> [root@dev ~]# perl t1a.pl
> hello world!
> --111--
> Segmentation fault
> --------------------------------------------------------------
>
> test 2:
> --------------------------------------------------------------
> perl -MO=Bytecode,-H,-ot2b.pm t2b.pl
> perl -MO=Bytecode,-H,-ot2c.pm t2c.pl
>
> [root@dev ~]# perl t2a.pl
> hello world!
> --111--
> Segmentation fault
> --------------------------------------------------------------
>
> test 3:
> --------------------------------------------------------------
> perl -MO=Bytecode,-H,-ot3c.pm t3c.pl
> perl -MO=Bytecode,-H,-ot3b.pm t3b.pl
>
> [root@dev ~]# perl t3a.pl
> hello world!
> --111--
> Segmentation fault
> --------------------------------------------------------------
>
>
> hoowa sun
>
> 2010/11/3 Reini Urban <rur...@x-ray.at>
>>
>> 2010/11/1 hoow...@gmail.com <hoow...@gmail.com>:
>> > hello rurban:
>> > i was write test script to test bytecode, but get segment fault.
>> > code and test :
>> > ---------------------------------------------------------------------
>> > hoowa@hoowa-Vostro-V13:~$ cat t1.pl
>> > #!/usr/bin/perl
>> > use t2;
>> > print "hello world\n";
>> > &abc::runme();
>> > hoowa@hoowa-Vostro-V13:~$ cat t2.org
>> > package abc;
>> > sub runme
>> > {
>> >   $abc='sdf';
>> >  print "111-".$abc."-111\n";
>> > }
>> > 1;
>> > hoowa@hoowa-Vostro-V13:~$ perl -MO=Bytecode,-H,-ot2.pm t2.org
>> > hoowa@hoowa-Vostro-V13:~$ perl t1.pl
>> > hello world
>> > 111-sdf-111
>> > segmention fault
>> > ---------------------------------------------------------------------
>> > test system:
>> > centos 5.5 with bound perl and b-bytecode
>> > ubuntu 10.10 and installed new release version of b-c 1.27
>>
>> I don't have centos 5.5 here
>> Can you post your perl -V?
>>
>> Look strange that such simple code fails, but in recent perls > 5.12
>> there are still such failures.
--
Reini Urban

Reply all
Reply to author
Forward
0 new messages