chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Segmentation violation using SSAX egg


From: David Ireland
Subject: Re: [Chicken-users] Segmentation violation using SSAX egg
Date: Fri, 29 Sep 2017 09:30:56 +1000

Hi Peter,

Thanks for your suggestions. I compiled the latest Chicken (4.12.1) and found the problem goes away.

I was running 4.12.0. Thanks again.

Regards,
David

On Thu, Sep 28, 2017 at 5:24 PM, Peter Bex <address@hidden> wrote:
On Thu, Sep 28, 2017 at 04:49:10PM +1000, David Ireland wrote:
> Hi there,
>
> I am sporadically getting segmentation violations (about 1 out of 3 program
> executions fail) while processing these files. It is not dependent on the
> particular XML file but always occurs when about 50 have been processed
> already.  Here is the error:
>
> *Error: segmentation violation    Call history:    ,,,
> crow.scm:524: unpack-aiml          crow.scm:468: read-all          *
> *crow.scm:468: buffer-ports#open-input-buffer          crow.scm:469:
> ssax#ssax:xml->sxml    *

Hi David,

That kind of bug can be very nasty, sorry about that!

> And an except from the code:
>
> (define (unpack-aiml file)
>   (let* ((result    '())
>          (contents   (open-input-buffer (read-all file)))
>          (xml        (car (get-tag (*ssax:xml->sxml contents* '()) 'aiml)))
>
> Would anyone have any suggestions how I could further debug?

The most important thing is that you're running the latest release.
Next, I'd try building a new CHICKEN with DEBUGBUILD=1 on the "make"
command line.  This will insert many extra sanity checks (at the cost
of a factor 2 to 4 slowdown), and build with debugging symbols.
Remember to keep the generated C sources around, too.
Also rebuild ssax and all its dependencies with this CHICKEN, so that
it also contains the debugging stuff (ideally with CSC_OPTIONS=-k to
ensure you keep the generated sources too)

Then, you can use gdb and run the program as usual.  Pinpointing the
place of the crash in C should be straightforward.  Mapping it back
to Scheme might be harder (there are comments in the sources that
indicate where a generated C function is coming from).

Alternatively, if you'd like some help, post a complete program with
sample XML that triggers the crash (somewhat) reliably, and others can
help you figure it out.

Cheers,
Peter


reply via email to

[Prev in Thread] Current Thread [Next in Thread]