Subject: bug#12242: Emacs 24.2 RC1 build fails on OpenBSD

From: [email-masked] (Jérémie Courrèges-Anglas)
Date: Tue, 21 Aug 2012 21:23:38 +0200

Eli Zaretskii <[email-masked]> writes:

>> Date: Tue, 21 Aug 2012 06:03:37 +0300
>> From: Eli Zaretskii <[email-masked]>
>> Cc: [email-masked]
>> 
>> I think I see the problem and will fix it later today.
>
> Actually, no, I don't think I see the problem.  What does the
> following GDB command print in frame #0?
>
>   (gdb) p *heap
>
> Also, could you please run Emacs under GDB, and when it crashes, type
> the following commands, which define a new command "heaps", and then
> run it?  Like this:
>
>   (gdb) define heaps
>   Type commands for definition of "heaps".
>   End with a line saying just "end".
>   >set $a = first_heap
>   >while $a
>    >p *$a
>    >set $a = $a->next
>    >end
>   >end
>   (gdb) heaps
>
> Please post here everything that GDB prints as result.

if [ x`(cd /home/emacs24/src/emacs-24.2/leim && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
  env EMACSLOADPATH=/home/emacs24/src/emacs-24.2/leim/../lisp LC_ALL=C gdb --args ../src/emacs --batch --no-site-file --no-site-lisp -l /home/emacs24/src/emacs-24.2/leim/
../lisp/international/quail \
    --eval "(update-leim-list-file \".\")" ; \
else \
  env EMACSLOADPATH=/home/emacs24/src/emacs-24.2/leim/../lisp LC_ALL=C gdb --args ../src/emacs --batch --no-site-file --no-site-lisp -l /home/emacs24/src/emacs-24.2/leim/
../lisp/international/quail \
    --eval "(update-leim-list-file \".\" \"/home/emacs24/src/emacs-24.2/leim\")" ; \
fi
GNU gdb 6.3
Copyright 2004 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-openbsd5.2"...
(gdb) run             
Starting program: /home/emacs24/src/emacs-24.2/src/emacs --batch --no-site-file --no-site-lisp -l /home/emacs24/src/emacs-24.2/leim/../lisp/international/quail --eval \(u
pdate-leim-list-file\ \".\"\)
Updating /home/emacs24/src/emacs-24.2/leim/leim-list.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/PY.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/quick-cns.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/tsang-cns.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/ZIRANMA.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/CTLau-b5.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/CTLau.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/quick-b5.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/tsang-b5.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/ZOZY.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/TONEPY.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/SW.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/QJ.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/QJ-b5.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/Punct.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/Punct-b5.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/PY-b5.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/ETZY.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/ECDICT.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/CCDOSPY.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/ARRAY30.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/4Corner.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/indian.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/ipa.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/latin-post.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/czech.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/japanese.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/thai.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/arabic.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/hanja3.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/latin-ltx.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/hanja-jis.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/hebrew.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/symbol-ksc.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/hangul.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/lao.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/georgian.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/croatian.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/persian.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/hanja.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/slovak.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/lrt.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/tibetan.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/pypunct-b5.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/sgml-input.el ...
Checking /home/emacs24/src/emacs-24.2/leim/quail/cyril-jis.el ...

Program received signal SIGSEGV, Segmentation fault.
free_bloc (bloc=0x85eb8a0) at ralloc.c:719
719       if (heap->first_bloc == bloc)
(gdb) p heap
$1 = 0x8f12000
(gdb) p *heap
Cannot access memory at address 0x8f12000
(gdb) define heaps
Type commands for definition of "heaps".
End with a line saying just "end".
>set $a = first_heap
>while $a
 >p *$a
 >set $a = $a->next
 >end
>end
(gdb) heaps
$2 = {next = 0x0, prev = 0x0, start = 0x8edf000, end = 0x8f02000, bloc_start = 0x8eec000, free = 0x8ef2a58, first_bloc = 0x85eb8a0, last_bloc = 0x85eb8a0}
(gdb)

Again, please don't hesitate if you need further input.
-- 
Jérémie Courrèges-Anglas
Empreinte GPG : 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494