all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>, Joseph Mingrone <jrm@ftfl.ca>
Cc: emacs-devel@gnu.org
Subject: Re: recent master core dumps building on FreeBSD i386
Date: Thu, 18 Oct 2018 10:53:20 -0700	[thread overview]
Message-ID: <333a616c-95be-0273-a37b-484e9f274ecf@cs.ucla.edu> (raw)
In-Reply-To: <83in1zqm39.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

On 10/18/18 9:02 AM, Eli Zaretskii wrote:
> Can you please repeat this experiment, and then, when it crashes, do
> this:
>
>    (gdb) source ./.gdbinit
>    (gdb) frame 2
>    (gdb) p/x a
>    (gdb) xtype
>
> and show us the results?

Also, please try these GDB commands when debugging ./temacs:

b syms_of_threads
r -Q
p &main_thread
disas syms_of_threads
p &Vmain_thread

I'm attaching the output of these commands on Fedora 28 x86-64 compiled 
with 'gcc -m32 -march=native -g3 -O2' (AMD Phenom II X4 910e). Evidently 
your compiler (clang?) is not inlining make_lisp_ptr, but it's still 
useful to know what it's up to. I see that GCC optimizes away not only 
the call to make_lisp_ptr, but also the runtime check 'TAGGEDP (a, type) 
&& XUNTAG (a, type, char) == ptr', I guess because GCC knows that 
main_thread is properly aligned so TAGGEDP must succeed here. clang 
isn't smart enough to do this sort of optimization (at least on Fedora) 
so if you're using clang that might partly explain the problem.

Also, please investigate what the macro GCALIGNED_STRUCT expands to. You 
can use 'gcc -E' to do that.


[-- Attachment #2: gdb.txt --]
[-- Type: text/plain, Size: 4494 bytes --]

(gdb) b syms_of_threads
Breakpoint 1 at 0x8245e40: file thread.c, line 1097.
(gdb) r -Q
Starting program: /home/eggert/src/gnu/emacs/master-tmp/src/temacs -Q
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, syms_of_threads () at thread.c:1097
(gdb) p &main_thread
$1 = (struct thread_state *) 0x85f2920 <main_thread>
(gdb) disas syms_of_threads
Dump of assembler code for function syms_of_threads:
=> 0x08245e40 <+0>:	push   %ebx
   0x08245e41 <+1>:	sub    $0x14,%esp
   0x08245e44 <+4>:	push   $0x8597340
   0x08245e49 <+9>:	call   0x8203e00 <defsubr>
   0x08245e4e <+14>:	movl   $0x8597320,(%esp)
   0x08245e55 <+21>:	call   0x8203e00 <defsubr>
   0x08245e5a <+26>:	movl   $0x8597300,(%esp)
   0x08245e61 <+33>:	call   0x8203e00 <defsubr>
   0x08245e66 <+38>:	movl   $0x85972e0,(%esp)
   0x08245e6d <+45>:	call   0x8203e00 <defsubr>
   0x08245e72 <+50>:	movl   $0x85972c0,(%esp)
   0x08245e79 <+57>:	call   0x8203e00 <defsubr>
   0x08245e7e <+62>:	movl   $0x85972a0,(%esp)
   0x08245e85 <+69>:	call   0x8203e00 <defsubr>
   0x08245e8a <+74>:	movl   $0x8597260,(%esp)
   0x08245e91 <+81>:	call   0x8203e00 <defsubr>
   0x08245e96 <+86>:	movl   $0x8597280,(%esp)
   0x08245e9d <+93>:	call   0x8203e00 <defsubr>
   0x08245ea2 <+98>:	movl   $0x8597240,(%esp)
   0x08245ea9 <+105>:	call   0x8203e00 <defsubr>
   0x08245eae <+110>:	movl   $0x8597460,(%esp)
   0x08245eb5 <+117>:	call   0x8203e00 <defsubr>
   0x08245eba <+122>:	movl   $0x8597440,(%esp)
   0x08245ec1 <+129>:	call   0x8203e00 <defsubr>
   0x08245ec6 <+134>:	movl   $0x8597420,(%esp)
   0x08245ecd <+141>:	call   0x8203e00 <defsubr>
   0x08245ed2 <+146>:	movl   $0x8597400,(%esp)
   0x08245ed9 <+153>:	call   0x8203e00 <defsubr>
   0x08245ede <+158>:	movl   $0x85973e0,(%esp)
   0x08245ee5 <+165>:	call   0x8203e00 <defsubr>
   0x08245eea <+170>:	movl   $0x85973c0,(%esp)
   0x08245ef1 <+177>:	call   0x8203e00 <defsubr>
   0x08245ef6 <+182>:	movl   $0x85973a0,(%esp)
   0x08245efd <+189>:	call   0x8203e00 <defsubr>
   0x08245f02 <+194>:	movl   $0x8597380,(%esp)
   0x08245f09 <+201>:	call   0x8203e00 <defsubr>
   0x08245f0e <+206>:	movl   $0x8597360,(%esp)
   0x08245f15 <+213>:	call   0x8203e00 <defsubr>
   0x08245f1a <+218>:	movl   $0x8597220,(%esp)
   0x08245f21 <+225>:	call   0x8203e00 <defsubr>
   0x08245f26 <+230>:	movl   $0x85f28e8,(%esp)
   0x08245f2d <+237>:	call   0x81b17a0 <staticpro>
   0x08245f32 <+242>:	pop    %edx
   0x08245f33 <+243>:	pop    %ecx
   0x08245f34 <+244>:	push   $0xd
   0x08245f36 <+246>:	push   $0x82acace
   0x08245f3b <+251>:	movl   $0x0,0x85f28e8
   0x08245f45 <+261>:	call   0x81ff540 <intern_c_string_1>
   0x08245f4a <+266>:	mov    %eax,%ebx
   0x08245f4c <+268>:	pop    %eax
   0x08245f4d <+269>:	pop    %edx
   0x08245f4e <+270>:	push   $0xe
   0x08245f50 <+272>:	push   $0x82acadc
   0x08245f55 <+277>:	call   0x81ff540 <intern_c_string_1>
   0x08245f5a <+282>:	add    $0xc,%esp
   0x08245f5d <+285>:	push   $0x0
   0x08245f5f <+287>:	push   %ebx
   0x08245f60 <+288>:	push   %eax
   0x08245f61 <+289>:	call   0x81b9d00 <Fdefalias>
   0x08245f66 <+294>:	pop    %ecx
   0x08245f67 <+295>:	pop    %ebx
   0x08245f68 <+296>:	push   $0x7
   0x08245f6a <+298>:	push   $0x82acb0d
   0x08245f6f <+303>:	call   0x81ff540 <intern_c_string_1>
   0x08245f74 <+308>:	pop    %edx
   0x08245f75 <+309>:	pop    %ecx
   0x08245f76 <+310>:	push   $0x0
   0x08245f78 <+312>:	push   %eax
   0x08245f79 <+313>:	call   0x81e15e0 <Fprovide>
   0x08245f7e <+318>:	add    $0xc,%esp
   0x08245f81 <+321>:	push   $0x85df124
   0x08245f86 <+326>:	push   $0x82acaeb
   0x08245f8b <+331>:	push   $0x85f28e0
   0x08245f90 <+336>:	call   0x82040e0 <defvar_lisp>
   0x08245f95 <+341>:	add    $0x10,%esp
   0x08245f98 <+344>:	cmpb   $0x0,0x85d64e0
   0x08245f9f <+351>:	movl   $0x85f2925,0x85df124
   0x08245fa9 <+361>:	jne    0x8245fbc <syms_of_threads+380>
   0x08245fab <+363>:	mov    0x85f2920,%eax
   0x08245fb0 <+368>:	and    $0x7f000000,%eax
   0x08245fb5 <+373>:	cmp    $0x54000000,%eax
   0x08245fba <+378>:	jne    0x8245fc1 <syms_of_threads+385>
   0x08245fbc <+380>:	add    $0x8,%esp
   0x08245fbf <+383>:	pop    %ebx
   0x08245fc0 <+384>:	ret
   0x08245fc1 <+385>:	push   %eax
   0x08245fc2 <+386>:	push   $0x46d
   0x08245fc7 <+391>:	push   $0x82acbfb
   0x08245fcc <+396>:	push   $0x82ac968
   0x08245fd1 <+401>:	call   0x81b1820 <die>
End of assembler dump.
(gdb) p &Vmain_thread
$2 = (Lisp_Object *) 0x85df124 <globals+740>
(gdb)

  reply	other threads:[~2018-10-18 17:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16 15:53 recent master core dumps building on FreeBSD i386 Joseph Mingrone
2018-10-17  1:27 ` Joseph Mingrone
2018-10-17 16:10   ` Eli Zaretskii
2018-10-18  1:09     ` Paul Eggert
2018-10-18 13:28       ` Eli Zaretskii
2018-10-18 15:40       ` Joseph Mingrone
2018-10-18 15:56         ` Eli Zaretskii
2018-10-18 16:18           ` Eli Zaretskii
2018-10-18 16:02         ` Eli Zaretskii
2018-10-18 17:53           ` Paul Eggert [this message]
2018-10-18 19:09             ` Joseph Mingrone
2018-10-18 19:16               ` Paul Eggert
2018-10-19  1:15             ` Joseph Mingrone
2018-10-19 16:28               ` Paul Eggert
2018-10-19 19:06                 ` Joseph Mingrone
2018-10-18 19:04           ` Joseph Mingrone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=333a616c-95be-0273-a37b-484e9f274ecf@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jrm@ftfl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.