gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Re: OpenBSD and GCL


From: Magnus Henoch
Subject: [Gcl-devel] Re: OpenBSD and GCL
Date: Mon, 12 Apr 2004 20:50:53 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

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.

Attachment: unexelf.diff
Description: Text document

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

reply via email to

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