Subject: bug#26638: 25.2; Fatal error 6: Abortmake[1]: *** [Makefile:737: bootstrap-emacs] Abort (core dumped)

From: 白井彰 <[email-masked]>
Date: Thu, 28 Sep 2017 00:16:47 +0900

I cannot build emacs-25.2 on Solaris 10 Update 7 and Update 10 with Sun C 5.15,
but on Solaris 10 Update 11 I can build emacs-25.2 with Sun C 5.15 successfully.

Below is the debugger's output for temacs on Solaris 10 Update 7:
t@1 (l@1) program terminated by signal SEGV (no mapping at the fault address)
0xfe5a17ea: rt_dldump+0x07a6:   cmpl     $0x00000009,0x00000004(%eax)
Current function is unexec
   18     if (! dldump (0, new_name, RTLD_MEMORY))
(dbx) down
(dbx) down
(dbx) down
0xfe5a17ea: rt_dldump+0x07a6:   cmpl     $0x00000009,0x00000004(%eax)
(dbx) where
current thread: t@1
=>[1] rt_dldump(0xfeffdd88, 0x8c0c21c, 0x1000, 0x0), at 0xfe5a17ea
  [2] dldump_core(0xfeffb28c, 0x0, 0x8c0c21c, 0x1000), at 0xfefd9fe9
  [3] _dldump(0x0, 0x8c0c21c, 0x1000, 0x8bd1b58), at 0xfefda036
  [4] unexec(new_name = 0x8c0c21c "/tmp/emacs-25.2/src/emacs", old_name = 0x8c0c250 "/tmp/emacs-25.2/src/temacs"), line 18 in "unexsol.c"
  [5] Fdump_emacs(filename = 146611036, symfile = 146610668), line 2115 in "emacs.c"
  [6] eval_sub(form = 141049003), line 2175 in "eval.c"
  [7] Fprogn(body = 141048979), line 431 in "eval.c"
  [8] eval_sub(form = 140739195), line 2125 in "eval.c"
  [9] Fif(args = 140739219), line 388 in "eval.c"
  [10] eval_sub(form = 140749643), line 2125 in "eval.c"
  [11] readevalloop(readcharfun = 11424, stream = 0x8621340, sourcename = 140810868, printflag = 0, unibyte = 0, readfun = 0, start = 0, end = 0), line 1927 in "lread.c"
  [12] Fload(file = 140810740, noerror = 0, nomessage = 0, nosuffix = 0, must_suffix = 0), line 1336 in "lread.c"
  [13] eval_sub(form = 140745611), line 2188 in "eval.c"
  [14] Feval(form = 140745611, lexical = 0), line 1994 in "eval.c"
  [15] top_level_2(), line 1121 in "keyboard.c"
  [16] internal_condition_case(bfun = 0x82219c0 = &`temacs`keyboard.c`top_level_2(), handlers = 8712, hfun = 0x8221320 = &`temacs`keyboard.c`cmd_error(Lisp_Object data)), line 1315 in "eval.c"
  [17] top_level_1(ignore = 0), line 1129 in "keyboard.c"
  [18] internal_catch(tag = 21840, func = 0x8221a20 = &`temacs`keyboard.c`top_level_1(Lisp_Object ignore), arg = 0), line 1080 in "eval.c"
  [19] command_loop(), line 1090 in "keyboard.c"
  [20] recursive_edit_1(), line 697 in "keyboard.c"
  [21] Frecursive_edit(), line 768 in "keyboard.c"
  [22] main(argc = 5, argv = 0x8047ce0), line 1629 in "emacs.c"
(dbx) regs
current thread: t@1
current frame:  [1]
eax      0x00000001
ebx      0xfe5b3000
ecx      0x00001741
edx      0x00000000
esi      0x08047ff2
edi      0xfed61730
ebp      0x080469c4
esp      0x08046794
trapno   0x0000000e 0x00000000
err      0x00000004 0x00000000
eflags   0x00010202 0x00000000
eip      0xfe5a17ea:rt_dldump+0x7a6    cmpl     $0x00000009,0x00000004(%eax)
gs       0x000001c3 0x00000000
fs       0x00000043 0x00000000
es       0x00000000 0x00000000
ds       0x00000043 0x00000000
ss       0x00000043 0x00000000
cs       0x0000003b 0x00000000
(dbx) dis 0xfe5a17dc
0xfe5a17dc: rt_dldump+0x0798:   cmpl     $0x00000005,(%eax)
0xfe5a17df: rt_dldump+0x079b:   je       rt_dldump+0x812        [ 0xfe5a1856, .+0x77 ]
0xfe5a17e1: rt_dldump+0x079d:   movl     %eax,%edi
0xfe5a17e3: rt_dldump+0x079f:   movl     0x00000008(%edi),%eax
0xfe5a17e6: rt_dldump+0x07a2:   testl    %eax,%eax
0xfe5a17e8: rt_dldump+0x07a4:   je       rt_dldump+0x809        [ 0xfe5a184d, .+0x65 ]
0xfe5a17ea: rt_dldump+0x07a6:   cmpl     $0x00000009,0x00000004(%eax)
0xfe5a17ee: rt_dldump+0x07aa:   jne      rt_dldump+0x809        [ 0xfe5a184d, .+0x5f ]
0xfe5a17f0: rt_dldump+0x07ac:   cmpl     $0x00000000,0x0000000c(%eax)
0xfe5a17f4: rt_dldump+0x07b0:   je       rt_dldump+0x809        [ 0xfe5a184d, .+0x59 ]

Below is librtld.so.1 for each Solaris 10:
Solaris 10 Update  7    -rwxr-xr-x   1 root     bin        33884 Sep 14  2009 /lib/librtld.so.1
Solaris 10 Update  8    -rwxr-xr-x   1 root     bin        33884 Sep 14  2009 /lib/librtld.so.1
Solaris 10 Update  9    -rwxr-xr-x   1 root     bin        33884 Sep 14  2009 /lib/librtld.so.1
Solaris 10 Update 10    -rwxr-xr-x   1 root     bin        41720 Jul  5  2011 /lib/librtld.so.1
Solaris 10 Update 11    -rwxr-xr-x   1 root     bin        42036 Jan 14  2013 /lib/librtld.so.1

> 2017/09/15 4:14、Paul Eggert <[email-masked]>のメール:
> 
> 白井彰 wrote:
> 
>> './configure --with-gif=no CFLAGS="-m64 -g3"' with Sun C 5.15,
>> 'CCLD temacs' failed on my site:
>> make[2]: Leaving directory '/tmp/emacs-25.2/admin/unidata'
>>   CCLD     temacs
>> ld: fatal: file /usr/sfw/lib/libfreetype.so: wrong ELF class: ELFCLASS32
>> ld: fatal: file /usr/sfw/lib/libXrender.so: wrong ELF class: ELFCLASS32
>> ld: fatal: file /usr/sfw/lib/libfreetype.so: wrong ELF class: ELFCLASS32
>> ld: fatal: File processing errors. No output written to temacs
> 
> You'd need to link to 64-bit libraries. If you can't find them, then please disable the the troublesome 32-bitlibraries. E.g.,
> 
> ./configure --with-gif=no --with-xft=no CFLAGS="-m64 -g3"
> 
> should build without the abovementioned libraries.
> 
>> Now I can recreate the segmentation fault of temacs every time with
>> Sun C 5.15 on my site, and the backtrace of temacs seems very alike
>> for each build of emacs-25.2:
> 
> That's "encouraging", in some sense. At least you can reproduce the bug.
> 
>> % cat /tmp/aaa.txt
>> core '/tmp/emacs-25.2/src/core' of 24956:     ./temacs --batch --load loadup bootstrap
>>  fe5a17ea rt_dldump (feffdd88, 8c0c21c, 1000, 0) + 7a6
>>  fefd9fe9 dldump_core (feffb28c, 0, 8c0c21c, 1000) + 175
>>  fefda036 dldump   (0, 8c0c21c, 1000, 8bd1b58) + 42
>>  0834b719 unexec   (8c0c21c, 8c0c250, 8046ac8, 8215a4d) + 19
> 
> This sounds promising. Can you use a debugger to find out what is going wrong inside rt_dldump?