Chris Condrat on Tue, 14 Mar 2006 06:08:21 +0100


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

Segmentation fault during output()


I'm using a CATCH(errpile) {} TRY {} ENDCATCH; block to capture stack
overflows and dump the last-known-good output to a file, before
resetting the avma and starting again. The flow of the program is much
like:

loop
{
    CATCH (errpile)
    {
        avma = last_known_good_avma;
        output(last_known_good_formula);
        avma = top_of_the_stack;
        // Get ready to start again.
        CATCH_RELEASE();
    } TRY {
        // computations with garbage collecting which will probably overflow.
    } ENDCATCH;
} while(still_more_to_do);


This works great for the first four or so runs (that is, overflows),
but on the fifth run, it segmentation faults while attempting to write
the GEN to the output.  I have narrowed it down specifically to when
it tries to output the GEN.

Am I doing something wrong here?  Any suggestions would be appreciated as well.

Thanks.