[sword-devel] Segmentation fault in Perl bindings.
Greg Hellings
greg.hellings at gmail.com
Tue Aug 13 22:13:35 MST 2013
I have committed two fixes to Perl:
One fixes the intermittent builds that I was experiencing. It turns out
that CMake and Swig were both generating files named 'Makefile' in the
build directory. Now the Perl files generate Makefile.perlswig instead.
The other fixes the seg fault on exit that was in your test case for me. I
did it simply by conditionally compiling in the __str__ method of SWKey for
Perl that was the source of the offense. It will now build in Python but
not Perl. This fixes the Seg Fault for me in your minimal test case.
Hopefully it doesn't break any expected functionality.
--Greg
On Tue, Aug 13, 2013 at 2:04 AM, Mark Trompell <mark at foresightlinux.org>wrote:
> Adding some more details:
> main::(Perlbindingstest.pl:4): my $mgr = new Sword::SWMgr();
> DB<1> l
> 4==> my $mgr = new Sword::SWMgr();
> 5: my $neu = $mgr->getModule("GerNeUe");
> 6: my $key = new Sword::SWKey("Genesis 1:1");
> 7: $neu->setKey($key);
> 8: print $neu->renderText(),"\n";
> DB<1> n
> main::(Perlbindingstest.pl:5): my $neu = $mgr->getModule("GerNeUe");
> DB<1> n
> main::(Perlbindingstest.pl:6): my $key = new Sword::SWKey("Genesis 1:1");
> DB<1> n
> main::(Perlbindingstest.pl:7): $neu->setKey($key);
> DB<1> n
> main::(Perlbindingstest.pl:8): print $neu->renderText(),"\n";
> DB<1> s
> Sword::SWBuf::CODE(0x93a6c0)(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:59):
> 59: '""' => sub { $_[0]->__str__()},
> DB<1> s
> Sword::SWBuf::CODE(0x93a6c0)(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:59):
> 59: '""' => sub { $_[0]->__str__()},
> DB<1> s
> Im Anfang schuf Gott Himmel und Erde.
> Sword::SWKey::DESTROY(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:968):
> 968: return unless $_[0]->isa('HASH');
> DB<1> s
> Sword::SWKey::DESTROY(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:969):
> 969: my $self = tied(%{$_[0]});
> DB<1> s
> Sword::SWKey::DESTROY(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:969):
> 969: my $self = tied(%{$_[0]});
> DB<1> s
> Sword::SWKey::DESTROY(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:970):
> 970: return unless defined $self;
> DB<1> s
> Sword::SWKey::DESTROY(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:971):
> 971: delete $ITERATORS{$self};
> DB<1> s
>
> Sword::SWKey::CODE(0xb3fb90)(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:949):
> 949: '""' => sub { $_[0]->__str__()},
> DB<1> s
> Sword::SWKey::DESTROY(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:972):
> 972: if (exists $OWNER{$self}) {
> DB<1> s
>
> Sword::SWKey::CODE(0xb3fb90)(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:949):
> 949: '""' => sub { $_[0]->__str__()},
> DB<1> s
> Sword::SWKey::DESTROY(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:973):
> 973: Swordc::delete_SWKey($self);
> DB<1> s
>
> Sword::SWKey::CODE(0xb3fb90)(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:949):
> 949: '""' => sub { $_[0]->__str__()},
> DB<1> s
>
> Sword::SWKey::CODE(0xb3fb90)(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:949):
> 949: '""' => sub { $_[0]->__str__()},
> DB<1> s
> Sword::SWKey::DESTROY(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:974):
> 974: delete $OWNER{$self};
> DB<1> s
>
> Sword::SWKey::CODE(0xb3fb90)(/usr/lib64/perl5/site_perl/5.8.8/Sword.pm:949):
> 949: '""' => sub { $_[0]->__str__()},
> DB<1> s
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007ffff626ae73 in sword_SWKey___str__ (my_perl=<value optimized
> out>, cv=<value optimized out>)
> at Sword.cxx:2360
> 2360 return const_cast<char *>(self->getText());
>
>
> On Tue, Aug 13, 2013 at 7:36 AM, Mark Trompell <mark at foresightlinux.org>
> wrote:
> > This is all I can get out of debugging...
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x00007ffff646ee73 in sword_SWKey___str__ (my_perl=<value optimized
> > out>, cv=<value optimized out>)
> > at Sword.cxx:2360
> > 2360 return const_cast<char
> *>(self->getText());
> >
> > Probably not helpful at all...
> > btw it's r2955.
> >
> > On Mon, Aug 12, 2013 at 8:53 AM, Mark Trompell <mark at foresightlinux.org>
> wrote:
> >> With my little Perlprogramm I get a segmentation fault. I don't get
> >> them with a similiar python programm, how would I debug these?
> >>
> >> $ ./Perlbindingstest.pl
> >> Im Anfang schuf Gott Himmel und Erde.
> >> Segmentation fault
> >>
> >>
> >> Perlbindingstest.pl:
> >> #!/usr/bin/perl
> >> use Sword;
> >>
> >> my $mgr = new Sword::SWMgr();
> >> my $neu = $mgr->getModule("GerNeUe");
> >> my $key = new Sword::SWKey("Genesis 1:1");
> >> $neu->setKey($key);
> >> print $neu->renderText(),"\n";
> >>
> >> Pythonbindingstest.py:
> >> #!/usr/bin/python
> >> import Sword
> >>
> >> mgr = Sword.SWMgr()
> >> neu = mgr.getModule("GerNeUe")
> >> key = Sword.SWKey("Genesis 1:1")
> >> neu.setKey(key)
> >> print (neu.renderText())
> >>
> >>
> >> --
> >> Mark Trompell
> >>
> >> Foresight Linux Xfce Edition
> >> Cause your desktop should be freaking cool
> >> (and Xfce)
> >
> >
> >
> > --
> > Mark Trompell
> >
> > Foresight Linux Xfce Edition
> > Cause your desktop should be freaking cool
> > (and Xfce)
>
>
>
> --
> Mark Trompell
>
> Foresight Linux Xfce Edition
> Cause your desktop should be freaking cool
> (and Xfce)
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20130814/989f58d2/attachment.html>
More information about the sword-devel
mailing list