> * In message <14905.2824.343268.933740@...>
> * On the subject of "Re: segfault"
> * Sent on Thu, 14 Dec 2000 19:01:44 +0100 (CET)
> * Honorable Bruno Haible <haible@...> writes:
>
> Sam writes:
> > How do I debug a segfault?
> > Somehow the memory is corrupted and I get random segfaults.
>
> Ouch. This is hard. I'd try to insert many (gc) calls in order to get
> an idea which function corrupts memory.
I tried.
GCs slow down the process quite a bit - it is still running (no
segfault yet - after many hundreds of GCs).
what about unbalanced pushSTACK()/popSTACK() pairs?
what if I push more than pop or vv?
will that be detected or will I get a segfault?
--
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel&gt;
Read what the Arab leaders say to their people on <http://www.memri.org/&gt;
Binaries die but source code lives forever.

> * In message <14910.29770.1322.293989@...>
> * On the subject of "Re: segfault"
> * Sent on Mon, 18 Dec 2000 21:32:10 +0100 (CET)
> * Honorable Bruno Haible <haible@...> writes:
>
> Note that this CHECK_MEM, inserted at the wrong place, will kill all
> your local variables of type 'object' (i.e. everything you have not
> pushSTACK'ed).
what about value1, value2 &c?
--
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel&gt;
Read what the Arab leaders say to their people on <http://www.memri.org/&gt;
Bill Gates is great, as long as `bill' is a verb.

> * In message <14910.29770.1322.293989@...>
> * On the subject of "Re: segfault"
> * Sent on Mon, 18 Dec 2000 21:32:10 +0100 (CET)
> * Honorable Bruno Haible <haible@...> writes:
>
> Sam writes:
>
> > #define CHECK_MEM(msg) do { printf msg; gar_col(); } while(0)
> >
> > the bad news is that the "suspicious code" is the innocently looking
> > call to allocate_dir_key()!
>
> Note that this CHECK_MEM, inserted at the wrong place, will kill all
> your local variables of type 'object' (i.e. everything you have not
> pushSTACK'ed).
I did not realize that! I will investigate dirkey.d further.
On the same subject, I get a segfault with the current CVS sources on
win32 with this form:
[1]> (decode-universal-time 12345678900)
*** - handle_fault error2 ! address = 0x0 not in [0x1A500000,0x1A5BB730) !
SIGSEGV cannot be cured. Fault address = 0x0.
(works fine on solaris).
--
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel&gt;
Read what the Arab leaders say to their people on <http://www.memri.org/&gt;
A professor is someone who talks in someone else's sleep.

Sam writes:
> Bruno, do you mind looking at lispbibl.d?
lispbibl.d looks fine. I haven't looked at dirkey.d.
> #define CHECK_MEM(msg) do { printf msg; gar_col(); } while(0)
>
> the bad news is that the "suspicious code" is the innocently looking
> call to allocate_dir_key()!
Note that this CHECK_MEM, inserted at the wrong place, will kill all
your local variables of type 'object' (i.e. everything you have not
pushSTACK'ed). Therefore I think it's a bad idea do put it into
lispbibl.d like this.
Bruno