The system is two parts. The parser which you download seperatly, this part complied just fine and handles all sentences fine (even the ones that segfault the perl module don't bother it.)

On first install of the perl module it segfaults immediatly. I checked the bug reports and found a suggestion to change one of the subs in teh actual parser from advance to ad_vance (and all calls in that file to it.) This seemed odd top edit the parser code and recompile to fix the module, but i did, and all works...sort of.

Now however I have come across a sentence that seg faults it every time. I have never touched XS so this is quite beyond me. I do however have a script that reproduces the error, and I tracked it as far as I could into the perl section fo the module. The script below segfaults every time on my machine.

#!/usr/bin/perl use strict; use Lingua::LinkParser; my $parser = new Lingua::LinkParser; my $test = "cats have claws and tails and eyes and whiskers"; my $sentence = $parser->create_sentence($test); my $linkage = $sentence->linkage(1); print $parser->get_diagram($linkage); warn "Before words"; my @words = $linkage->words; warn "After words";

The before words prints, but after does not. So I followed the code until I ended up in Lingua/LinkParser/Linkage/Sublinkage/Link.pm. In side it, in the lword function it calls Lingua::LinkParser::linkage_set_current_sublinkage($self->{linkage},         $self->{subindex});. It segfaults inside that sub routine but I can't seem to locate it and there for guess that it is inside the XS code somewhere.

Since this error only occurs in the perl module and not in the parser when run directly I assume that the error can hopefully be found inside the perl or c code. Hopefully someone will see this as a worthy challenge! I would also be happy to continue down my bug hunting path though my XS is non-existant and my C is quite rusty.

Thanks in advance for any assistance in finding/fixing this. Hopefully we can find a fix and submit a patch to the bug system so others wont have this trouble.

BTW I have tried with the newest version of the parser, and the one that the POD says this module is written for with the same problems in both.


___________
Eric Hodges

In reply to Lingua::LinkParser Seg Faulting by eric256

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.