Perl 5.10.0 crash with a segmentation fault when using module Tcl

Bug #297437 reported by spk on 2008-11-13
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
perl (Ubuntu)
Undecided
Unassigned

Bug Description

I'm not sure if this is a perl bug or a tcl-dev bug

Compiling Tcl module from source
...
Testing Tcl module

giacomo@linksys-admin:~/Desktop/Tcl-0.97$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/call.........ok
t/constants....ok
t/createcmd....ok
t/eval.........ok
t/info.........ok
t/result.......ok
t/subclass.....ok
t/trace........ok
t/unicode......ok
t/var..........ok
All tests successful.
Files=10, Tests=53, 1 wallclock secs ( 0.27 cusr + 0.08 csys = 0.35 CPU)

Tests are successfull

Locating any previous presence of the module in the system

giacomo@linksys-admin:~/Desktop/Tcl-0.97$ sudo updatedb
giacomo@linksys-admin:~/Desktop/Tcl-0.97$ locate Tcl.pm
/home/giacomo/Desktop/Tcl-0.97/Tcl.pm
/home/giacomo/Desktop/Tcl-0.97/backup/Tcl.pm
/home/giacomo/Desktop/Tcl-0.97/blib/lib/Tcl.pm

No library in library paths

Installing the module anche checking the position

giacomo@linksys-admin:~/Desktop/Tcl-0.97$ sudo make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib/perl/5.10.0/Tcl.pm
Installing /usr/local/lib/perl/5.10.0/prova.pm
Writing /usr/local/lib/perl/5.10.0/auto/Tcl/.packlist
Appending installation info to /usr/local/lib/perl/5.10.0/perllocal.pod
giacomo@linksys-admin:~/Desktop/Tcl-0.97$ sudo updatedb
giacomo@linksys-admin:~/Desktop/Tcl-0.97$ locate Tcl.pm
/home/giacomo/Desktop/Tcl-0.97/Tcl.pm
/home/giacomo/Desktop/Tcl-0.97/backup/Tcl.pm
/home/giacomo/Desktop/Tcl-0.97/blib/lib/Tcl.pm
/usr/local/lib/perl/5.10.0/Tcl.pm

Cat the file and execute

giacomo@linksys-admin:~/Desktop/Tcl-0.97$ cat prova.pm
use Tcl;

giacomo@linksys-admin:~/Desktop/Tcl-0.97$ perl prova.pm
Segmentation fault

Backtrace of the gdb

(gdb) bt
#0 0xb7f5b528 in NpInitialize (my_perl=0xbfda67d8, X=0x9663930) at Tcl.xs:445
#1 0xb7f5bcfc in boot_Tcl (my_perl=0x965f008, cv=0x96a9dd0) at Tcl.xs:1733
#2 0x080b3f02 in Perl_pp_entersub ()
#3 0x080b22e9 in Perl_runops_standard ()
#4 0x080afdb8 in Perl_call_sv ()
#5 0x080b019f in Perl_call_list ()
#6 0x08064daf in ?? ()
#7 0x08072f37 in Perl_newATTRSUB ()
#8 0x08071d60 in Perl_utilize ()
#9 0x08161ee8 in Perl_yyparse ()
#10 0x080ae2e6 in ?? ()
#11 0x080b0cc5 in perl_parse ()
#12 0x08063e81 in main ()

Same bug in multiple intrepid postations, but not on different distributions
Perl is working correctly with other modules

Download full text (3.3 KiB)

On Wed, Nov 12, 2008 at 7:36 PM, spk <email address hidden> wrote:
> Public bug reported:
>
> I'm not sure if this is a perl bug or a tcl-dev bug
>
>
> Compiling Tcl module from source
> ...
> Testing Tcl module
>
> giacomo@linksys-admin:~/Desktop/Tcl-0.97$ make test
> PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/call.........ok
> t/constants....ok
> t/createcmd....ok
> t/eval.........ok
> t/info.........ok
> t/result.......ok
> t/subclass.....ok
> t/trace........ok
> t/unicode......ok
> t/var..........ok
> All tests successful.
> Files=10, Tests=53, 1 wallclock secs ( 0.27 cusr + 0.08 csys = 0.35 CPU)
>
> Tests are successfull
>
>
> Locating any previous presence of the module in the system
>
> giacomo@linksys-admin:~/Desktop/Tcl-0.97$ sudo updatedb
> giacomo@linksys-admin:~/Desktop/Tcl-0.97$ locate Tcl.pm
> /home/giacomo/Desktop/Tcl-0.97/Tcl.pm
> /home/giacomo/Desktop/Tcl-0.97/backup/Tcl.pm
> /home/giacomo/Desktop/Tcl-0.97/blib/lib/Tcl.pm
>
> No library in library paths
>
> Installing the module anche checking the position
>
> giacomo@linksys-admin:~/Desktop/Tcl-0.97$ sudo make install
> Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
> Installing /usr/local/lib/perl/5.10.0/Tcl.pm
> Installing /usr/local/lib/perl/5.10.0/prova.pm
> Writing /usr/local/lib/perl/5.10.0/auto/Tcl/.packlist
> Appending installation info to /usr/local/lib/perl/5.10.0/perllocal.pod
> giacomo@linksys-admin:~/Desktop/Tcl-0.97$ sudo updatedb
> giacomo@linksys-admin:~/Desktop/Tcl-0.97$ locate Tcl.pm
> /home/giacomo/Desktop/Tcl-0.97/Tcl.pm
> /home/giacomo/Desktop/Tcl-0.97/backup/Tcl.pm
> /home/giacomo/Desktop/Tcl-0.97/blib/lib/Tcl.pm
> /usr/local/lib/perl/5.10.0/Tcl.pm
>
>
> Cat the file and execute
>
> giacomo@linksys-admin:~/Desktop/Tcl-0.97$ cat prova.pm
> use Tcl;
>
> giacomo@linksys-admin:~/Desktop/Tcl-0.97$ perl prova.pm
> Segmentation fault
>
>
> Backtrace of the gdb
>
> (gdb) bt
> #0 0xb7f5b528 in NpInitialize (my_perl=0xbfda67d8, X=0x9663930) at Tcl.xs:445
> #1 0xb7f5bcfc in boot_Tcl (my_perl=0x965f008, cv=0x96a9dd0) at Tcl.xs:1733
> #2 0x080b3f02 in Perl_pp_entersub ()
> #3 0x080b22e9 in Perl_runops_standard ()
> #4 0x080afdb8 in Perl_call_sv ()
> #5 0x080b019f in Perl_call_list ()
> #6 0x08064daf in ?? ()
> #7 0x08072f37 in Perl_newATTRSUB ()
> #8 0x08071d60 in Perl_utilize ()
> #9 0x08161ee8 in Perl_yyparse ()
> #10 0x080ae2e6 in ?? ()
> #11 0x080b0cc5 in perl_parse ()
> #12 0x08063e81 in main ()
>
>
> Same bug in multiple intrepid postations, but not on different distributions
> Perl is working correctly with other modules
>
> ** Affects: perl (Ubuntu)
> Importance: Undecided
> Status: New
>
> --
> Perl 5.10.0 crash with a segmentation fault when using module Tcl
> https://bugs.launchpad.net/bugs/297437
> You received this bug notification because you are subscribed to perl in
> ubuntu.
>

This is not a Perl or Tcl bug. This is a bug in the Tcl Perl module
available from CPAN. A debugging Perl causes the module to fail its
tests as follows.

t/call.........ok 1/10Assertion ((svtype)((_svi)->sv_flags & 0xff)) >=
SVt_RV fa...

Read more...

Eric Windisch (ewindisch) wrote :

A workaround is to set PERL_DL_NONLAZY=1 as the tests do. With this variable set in the environment, your Perl will no longer encounter a segmentation fault.

An alternative workaround is to generate a Makefile in the following manner:
  perl Makefile.PL --nousestubs --library=-ltcl8.5 --include=-I/usr/include/tcl8.5/

Tim Heaney (theaney) wrote :

This bug seems to still exist in the latest Tcl module (0.98) and the latest Perl (5.13.5). Both of Eric Windisch's workarounds still apply. Actually, I'm still using Tcl 8.4, not 8.5, but his second workaround still applies (s/tcl8.5/tcl8.4/g, of course).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers