gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Further cygwin debugging - a step forward


From: Camm Maguire
Subject: Re: [Gcl-devel] Further cygwin debugging - a step forward
Date: 19 Dec 2001 22:56:47 -0500

Greetings!  Please excuse if this is partially duplicated.

"Billinghurst, David (CRTS)" <address@hidden> writes:

> Here is the results of some more debugging on cygwin.  Some progress??
> 
> There may be something of interest in o/try.c, which seems to be some
> toy code
> derived from NT emacs unexec.
> 
> I could compile it with (something like)
>       gcc -o try.exe -I. -I../h try.c
> 
> and run it with
>       ./try.exe junk
> 
> It generated a file junk.  Don't know what it does.
> 

Will try to look at this -- thanks!

> ################ Original problem ##############
> 
> cd unixport
> gdb raw_gcl.exe
>     open console
>     run unixport -libdir /usr/local/src/gcl
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00402cb9 in add_page_to_freelist (p=0x1a100000 "", tm=0x52c598) at
> alloc.c:161
> 
> (gdb) bt
> #0  0x00402cb9 in add_page_to_freelist (p=0x1a100000 "", tm=0x52c598) at
> alloc.c:161
> #1  0x00402f06 in alloc_object (t=t_string) at alloc.c:237
> #2  0x0043d690 in alloc_simple_string (l=16) at string.d:41
> #3  0x004051fa in malloc (size=16) at alloc.c:1085
> #4  0x6102d2c4 in _libkernel32_a_iname ()
> #5  0x6102d712 in _libkernel32_a_iname ()
> #6  0x6102a997 in _libkernel32_a_iname ()
> #7  0x610521dc in _libkernel32_a_iname ()
> #8  0x61003ba1 in _libkernel32_a_iname ()
> #9  0x610041b9 in _libkernel32_a_iname ()
> #10 0x610041f9 in _libkernel32_a_iname ()
> #11 0x00516da3 in cygwin_crt0 ()
> #12 0x0040103d in mainCRTStartup ()
> #13 0x77e992a6 in _libkernel32_a_iname ()
> 
> ####################### Next ########################
> 
> With revised values in gnuwin95.h
> 
> #undef DBEGIN
> /* we want finer than config.h */
> #define DBEGIN 0x1a000000
> 
> #define PAGEWIDTH 12
> 
> With breakpoint at original failure point of alloc.c:161
> p = 0x1a100000
> 
> then get startup message and then abort at main.c:356 
> with message 
> 
> GCL (GNU Common Lisp)  April 1994  32768 pages
> 
> Unrecoverable error: NULL_OR_ON_C_STACK macro invalid.
> 
> In gdb see 
> 
> (gdb) print &j
> $1 = (int *) 0x22ddc0
> 
> (gdb) print Cnil
> Error: No symbol "Cnil" in current context.
> 
> (gdb) print ((unsigned long)core_end)
> $2 = 438075392
> 
> 
> Now from gnuwin95.h we have
> 
> #define NULL_OR_ON_C_STACK(y)\
>     (((unsigned int)(y)) == 0 ||  \
>      (((unsigned int)(y)) < DBEGIN && ((unsigned int)(y)) &0xf000000))
> 
> so that NULL_OR_ON_C_STACK(&j) == 0 
> since ((&j) & 0xf000000) = 0
> 
> Enough for tonight.

OK, this is real progress.  We need to know what configure found for
CSTACK_ADDRESS.  Its probably positive on you machine, and the NULL...
macro is not fitting with our adjusted DBEGIN.  You might want to try
the linux macro:

#define NULL_OR_ON_C_STACK(x) ((x)==0 || ((unsigned int)x) > (unsigned 
int)(pagetochar(MAXPAGE+1)))

Your existing macro appears to imply that the stack is beyond the
heap, given the original DBEGIN definition.  But I think gdb might be
dropping a zero or something on its address.  &j has got to be on the
stack.  Lets see, your core end in hex is:
0x1a1c8000, which would be exactly 800 1024 pages past a DBEGIN of
0x1a100000.  So I think 0x1a100000 should probably be DBEGIN (not
having even glanced and the core_end determination to see if that's
right :-)).  But this looks like the stack is before the heap, which
confuses me.  This comment from 386-linux.h might help:
/* on most machines this will test in one instruction
   if the pointer is on the C stack or the 0 pointer
   but if the CSTACK_ADDRESS is not negative then we can't use this cheap
   test..
*/
/* on some linux x86 machines the C stack starts in positive number
   range, however since we might compile on one and run on another
   we will have to do this:
*/   

I'm hoping a few more combinations will let us know what is going on. 

> 
> +++++++++++++++++++++++++++++++++++++++++
> (Mr) David Billinghurst
> Comalco Research Centre
> PO Box 316, Thomastown, Vic, Australia, 3074
> Phone:        +61 3 9469 0642
> FAX:          +61 3 9462 2700
> Email:        address@hidden
> 
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

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