On 3 Sep 1999 14:09:33 +0900, [EMAIL PROTECTED] wrote:
>> Now uncommenting in figinset.C:
>
>It seems you have modified Makefile and use figinset.org.C
Which is figinset.C. (Did some preliminary cleanup in figinset.mod.C).
>
>> // assert (_heapset(9) == _HEAPOK);
>> printf("The empty heap is set to 9 and checked: \n"); fflush(NULL);
>>
>> to
>>
>> assert (_heapset(9) == _HEAPOK);
>> printf("The empty heap is set to 9 and checked: \n"); fflush(NULL);
>Why don't you continue!
As I (and you) already said, just look at figinset.C: It's a mess. A
bit of cleanup before continuing to debug might help; else you could be
stuck fighting against leaks and corrupted pointers all around you.
Especially the declaration, shadowing and (re-)use of variables,
pointers and iterators in some functions is "creative".
> (I can do it myself later, though :) Here is how:
> - set breakpoint at figinset.org.C:780 in gdb
> - bt
> - check what's just above the stack, this must be InsetFig::Recompute
I saw just rubbish memory locations in gdb. But going up farther would
be the way...
> - Insert _heapchk() in InsetFig::Recompute
> - just before getfigdata is called
> - at the beginning of the method
> - If the heap is already corrupted when InsetFig::Recompute is called,
> then move upward one more step
>There is a chance that you can pinpoint the place of memory corruption.
I've already inserted _heapchk() there (and elsehwere), to no avail:
This doesn't mean, the corruption happens later, though.
>
>BTW you are using perror in a very funny way.
At least some fun while debugging this mess :-)
>But the result is suggestive.
I must admit, I was surprised. At first I only wanted to extract errno
from crashing _heapchk() or the function that caused this crash, but
then I saw it's not only funny, it's multi-functional, showing (what I
suspect are:) multi-bugs.
>
>> l. 803: heapcheck: Permission denied
>
>Can you figure out where errno was set?
Very good question. Next one please... ;)
Greets,
Arnd