eric256 has asked for the wisdom of the Perl Monks concerning the following question:

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