gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Re: OpenBSD and GCL


From: Camm Maguire
Subject: Re: [Gcl-devel] Re: OpenBSD and GCL
Date: 12 Apr 2004 23:02:33 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, and thanks!  I'll check out your patch.  I had done
something similar in parallel with you by undefining
UNEXEC_USE_MAP_PRIVATE which got me in a similar place, past the
unexec but with a corrupted saved_pre_gcl.  The issue here I think is
that unexec is not dumping the address range containing the static
memory area.  It would be helpful at some point if you could verify
where the stack, heap, and static areas begin and which way they
count, up or down.

BTW, I committed your recursive malloc protection.  Please let me know
if it doesn't work for some reason.

Take care,

Magnus Henoch <address@hidden> writes:

> Camm Maguire <address@hidden> writes:
> 
> > 2) Re EFAULT in writing saved_pre_gcl --  this is almost certainly in
> >    unexec.  The code is taken straight from emacs, so if OpenBSD has a
> >    working emacs, we should have a working solution here too.
> 
> I took a look at Emacs HEAD.  They don't mmap the files in question
> anymore, but allocate temporary storage with mmap.  The comments say
> that this was changed because of problems with mmap over NFS, but it
> seems to fix my problem as well (definitely not sure why).  The
> attached patch contains the changes that seemed relevant to me.
> 
> 
> The resulting saved_pre_gcl doesn't work though:
> 
> address@hidden:~/noarchive/src/gcl-obsd/unixport$ gdb saved_pre_gcl
> GNU gdb 4.16.1
> Copyright 1996 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i386-unknown-openbsd3.4"...
> (gdb) run
> Starting program: /home/magnus/noarchive/src/gcl-obsd/unixport/saved_pre_gcl 
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x1c036b41 in before_interrupt (p=0xcfbf4a5c, allowed=3) at usig2.c:248
> 248      SS1(p->vs_topVAL,*vs_top);
> (gdb) bt
> #0  0x1c036b41 in before_interrupt (p=0xcfbf4a5c, allowed=3) at usig2.c:248
> #1  0x1c036899 in invoke_handler (signo=2, allowed=3) at usig2.c:203
> #2  0x1c037765 in raise_pending_signals (cond=3) at usig2.c:399
> #3  0x1c039fb9 in alloc_object (t=t_string) at alloc.c:336
> #4  0x1c02b990 in alloc_simple_string (l=1) at string.d:42
> #5  0x1c03ceef in malloc (size=1) at alloc.c:1419
> #6  0x178cb2b in ?? ()
> #7  0x7f2c9a1 in ?? ()
> #8  0x7f2c166 in ?? ()
> #9  0xcfbf6074 in ?? ()
> Error accessing memory address 0x1: Invalid argument.
> (gdb) p vs_top
> $1 = (object *) 0x0
> (gdb) 
> 
> The malloc in frame 5 is the very first call to malloc, made by
> something in the system as I mentioned.
> 
> Suspecting that GCL doesn't like malloc being called before main
> (stacks not being initialized?), I tried enabling baby_malloc, but it
> was never used, as something changes GBC_enable to 224: (baby_malloc
> is used when GBC_enable == 0)
> 
> (gdb) p GBC_enable
> $1 = 0
> (gdb) watch GBC_enable
> Watchpoint 1: GBC_enable
> (gdb) break malloc
> Breakpoint 2 at 0x1c03d00a: file alloc.c, line 1405.
> (gdb) run
> Starting program: /home/magnus/noarchive/src/gcl-obsd/unixport/saved_pre_gcl
> Watchpoint 1: GBC_enable
> 
> Old value = 0
> New value = 224
> 0xadb7132 in ?? ()
> (gdb) bt
> #0  0xadb7132 in ?? ()
> Error accessing memory address 0x0: Invalid argument.
> 
> As this doesn't happen with raw_pre_gcl, it's quite possible that
> there's something else wrong with unexec.  I'll dig further.
> 
> Regards,
> Magnus
> _______________________________________________
> 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]