From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joseph Mingrone Newsgroups: gmane.emacs.devel Subject: Re: recent master core dumps building on FreeBSD i386 Date: Thu, 18 Oct 2018 16:09:05 -0300 Message-ID: <86bm7r3wdq.fsf@phe.ftfl.ca> References: <86va6151mf.fsf@phe.ftfl.ca> <86o9bt746r.fsf@phe.ftfl.ca> <837eigsgel.fsf@gnu.org> <86sh13fell.fsf@phe.ftfl.ca> <83in1zqm39.fsf@gnu.org> <333a616c-95be-0273-a37b-484e9f274ecf@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1539890131 15669 195.159.176.226 (18 Oct 2018 19:15:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Oct 2018 19:15:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (berkeley-unix) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 18 21:15:26 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDDlV-0003x9-RT for ged-emacs-devel@m.gmane.org; Thu, 18 Oct 2018 21:15:26 +0200 Original-Received: from localhost ([::1]:44056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDDnc-000118-7L for ged-emacs-devel@m.gmane.org; Thu, 18 Oct 2018 15:17:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDDfV-00029u-UL for emacs-devel@gnu.org; Thu, 18 Oct 2018 15:09:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDDfS-0000a4-LT for emacs-devel@gnu.org; Thu, 18 Oct 2018 15:09:13 -0400 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:40547) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDDfS-0000Zm-92 for emacs-devel@gnu.org; Thu, 18 Oct 2018 15:09:10 -0400 Original-Received: by mail-pg1-x52c.google.com with SMTP id n31-v6so14624230pgm.7 for ; Thu, 18 Oct 2018 12:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ftfl.ca; s=google; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Wi5cmiP4+iDIBnE8qADO6Qx82FECuQTVBtLpNR1zkHI=; b=fircZgBqb7vZ9AqBe291PtU+jGS7vhBuC66i5Q3ualVyFRRfP71ssaQRj3M6l68OcU aXDw8b34hObwATrN4pufDKhIFMB/7S9Dd7TVwDcNXzBbzAk/YcfGsBZ9Zx4gWFg0Zznt 7PMmZMh0MIJ9/oHDKVxhLFFfi5qJpTJYCdpZ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Wi5cmiP4+iDIBnE8qADO6Qx82FECuQTVBtLpNR1zkHI=; b=RarlTBrXSIrglgRoAY5+ghXiCVTt1FDdfyRrYG0bjeOgftw+Zehs2BLYvtoGCcylvI SS30Sq2pygSeUsmlaEbhYmrtBAbR8m/YJCSwWKoTi1S1ttW7PMja+uj0Eid7qcd3IWbk dWp/Y2gzwDOccbCF/ev7ma74B9D7mt8F5qsgtDquC6GtBoxkeh7yjJgfM80omgoygto6 dHhV0hDwYIK0VAzWrJ8kZKkMmrMSxDnF01lf3xE6pzQPGQvD3pttcWhdAWa74Hcyg42R fr7B+ZiDPFDsw+uJD7jAS5GLORnk4gOLLhSTTTdMMic9rOh5QToqbqd5PHSoJNFfgiC3 oYCA== X-Gm-Message-State: ABuFfoi5SrSbrwkO+CUUbVTghDHW0/U77etAJwdbMvqumn53LldWLnOP MFLxpISW0+OZGH9UxdPF59kLBWaERuE= X-Google-Smtp-Source: ACcGV60Q+Kw/o694fHMuwne3BYPh5yTI853Eqom6U/LY9pdfiFt9i+8d2EcuUPgai4GOuxZJQ6Hdng== X-Received: by 2002:a62:dd01:: with SMTP id w1-v6mr31405685pff.129.1539889748806; Thu, 18 Oct 2018 12:09:08 -0700 (PDT) Original-Received: from phe.ftfl.ca.ftfl.ca (hlfxns017vw-142-68-132-248.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.132.248]) by smtp.gmail.com with ESMTPSA id y7-v6sm23461638pfl.57.2018.10.18.12.09.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 12:09:07 -0700 (PDT) In-Reply-To: <333a616c-95be-0273-a37b-484e9f274ecf@cs.ucla.edu> (Paul Eggert's message of "Thu, 18 Oct 2018 10:53:20 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230489 Archived-At: --=-=-= Content-Type: text/plain Paul Eggert writes: > 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. root@11i386-default:/wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-e511b9d/src # /usr/local/bin/gdb ./temacs GNU gdb (GDB) 8.2 [GDB v8.2 for FreeBSD] Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i386-portbld-freebsd11.2". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./temacs...done. SIGINT is used by the debugger. Are you sure you want to change it? (y or n) [answered Y; input not from terminal] Environment variable "DISPLAY" not defined. TERM = screen-256color Breakpoint 1 at 0x81599de: file emacs.c, line 370. Temporary breakpoint 2 at 0x8177f95: file sysdep.c, line 1080. (gdb) b syms_of_threads Breakpoint 3 at 0x8249851: file thread.c, line 1098. (gdb) r -Q Starting program: /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-e511b9d/src/temacs -Q Breakpoint 3, syms_of_threads () at thread.c:1098 1098 defsubr (&Smake_thread); (gdb) p &main_thread $1 = (struct thread_state *) 0x8554d0c (gdb) disas syms_of_threads Dump of assembler code for function syms_of_threads: 0x08249840 <+0>: push %ebp 0x08249841 <+1>: mov %esp,%ebp 0x08249843 <+3>: push %esi 0x08249844 <+4>: push $0x8506838 0x08249849 <+9>: call 0x8202e90 0x0824984e <+14>: add $0x4,%esp => 0x08249851 <+17>: push $0x8506898 0x08249856 <+22>: call 0x8202e90 0x0824985b <+27>: add $0x4,%esp 0x0824985e <+30>: push $0x8506858 0x08249863 <+35>: call 0x8202e90 0x08249868 <+40>: add $0x4,%esp 0x0824986b <+43>: push $0x85068b8 0x08249870 <+48>: call 0x8202e90 0x08249875 <+53>: add $0x4,%esp 0x08249878 <+56>: push $0x85068d8 0x0824987d <+61>: call 0x8202e90 0x08249882 <+66>: add $0x4,%esp 0x08249885 <+69>: push $0x85068f8 0x0824988a <+74>: call 0x8202e90 0x0824988f <+79>: add $0x4,%esp 0x08249892 <+82>: push $0x8506918 0x08249897 <+87>: call 0x8202e90 0x0824989c <+92>: add $0x4,%esp 0x0824989f <+95>: push $0x8506938 0x082498a4 <+100>: call 0x8202e90 0x082498a9 <+105>: add $0x4,%esp 0x082498ac <+108>: push $0x8506878 0x082498b1 <+113>: call 0x8202e90 0x082498b6 <+118>: add $0x4,%esp 0x082498b9 <+121>: push $0x8506958 0x082498be <+126>: call 0x8202e90 0x082498c3 <+131>: add $0x4,%esp 0x082498c6 <+134>: push $0x8506978 0x082498cb <+139>: call 0x8202e90 0x082498d0 <+144>: add $0x4,%esp 0x082498d3 <+147>: push $0x8506998 0x082498d8 <+152>: call 0x8202e90 0x082498dd <+157>: add $0x4,%esp --Type for more, q to quit, c to continue without paging-- 0x082498e0 <+160>: push $0x85069b8 0x082498e5 <+165>: call 0x8202e90 0x082498ea <+170>: add $0x4,%esp 0x082498ed <+173>: push $0x85069d8 0x082498f2 <+178>: call 0x8202e90 0x082498f7 <+183>: add $0x4,%esp 0x082498fa <+186>: push $0x85069f8 0x082498ff <+191>: call 0x8202e90 0x08249904 <+196>: add $0x4,%esp 0x08249907 <+199>: push $0x8506a18 0x0824990c <+204>: call 0x8202e90 0x08249911 <+209>: add $0x4,%esp 0x08249914 <+212>: push $0x8506a38 0x08249919 <+217>: call 0x8202e90 0x0824991e <+222>: add $0x4,%esp 0x08249921 <+225>: push $0x8506a58 0x08249926 <+230>: call 0x8202e90 0x0824992b <+235>: add $0x4,%esp 0x0824992e <+238>: push $0x8506a78 0x08249933 <+243>: call 0x8202e90 0x08249938 <+248>: add $0x4,%esp 0x0824993b <+251>: push $0x8554dc0 0x08249940 <+256>: call 0x81bad60 0x08249945 <+261>: add $0x4,%esp 0x08249948 <+264>: movl $0x0,0x8554dc0 0x08249952 <+274>: push $0xe 0x08249954 <+276>: push $0x82ab272 0x08249959 <+281>: call 0x8202460 0x0824995e <+286>: add $0x8,%esp 0x08249961 <+289>: mov %eax,%esi 0x08249963 <+291>: push $0xd 0x08249965 <+293>: push $0x82ab281 0x0824996a <+298>: call 0x8202460 0x0824996f <+303>: add $0x8,%esp 0x08249972 <+306>: push $0x0 0x08249974 <+308>: push %eax 0x08249975 <+309>: push %esi 0x08249976 <+310>: call 0x81c0930 0x0824997b <+315>: add $0xc,%esp 0x0824997e <+318>: push $0x7 --Type for more, q to quit, c to continue without paging-- 0x08249980 <+320>: push $0x82ab691 0x08249985 <+325>: call 0x8202460 0x0824998a <+330>: add $0x8,%esp 0x0824998d <+333>: push $0x0 0x0824998f <+335>: push %eax 0x08249990 <+336>: call 0x81e4ad0 0x08249995 <+341>: add $0x8,%esp 0x08249998 <+344>: push $0x8557a54 0x0824999d <+349>: push $0x82ab28f 0x082499a2 <+354>: push $0x8554dc8 0x082499a7 <+359>: call 0x82030f0 0x082499ac <+364>: add $0xc,%esp 0x082499af <+367>: cmpb $0x0,0x8557ef0 0x082499b6 <+374>: je 0x82499c4 0x082499b8 <+376>: movl $0x8554d11,0x8557a54 0x082499c2 <+386>: jmp 0x82499e9 0x082499c4 <+388>: mov $0x8554d14,%eax 0x082499c9 <+393>: test $0x7,%al 0x082499cb <+395>: jne 0x82499ec 0x082499cd <+397>: movl $0x8554d11,0x8557a54 0x082499d7 <+407>: mov $0x7f000000,%eax 0x082499dc <+412>: and 0x8554d0c,%eax 0x082499e2 <+418>: cmp $0x54000000,%eax 0x082499e7 <+423>: jne 0x8249a00 0x082499e9 <+425>: pop %esi 0x082499ea <+426>: pop %ebp 0x082499eb <+427>: ret 0x082499ec <+428>: push $0x492 0x082499f1 <+433>: push $0x828071a 0x082499f6 <+438>: push $0x8280b68 0x082499fb <+443>: call 0x81b6b50 0x08249a00 <+448>: push $0x46d 0x08249a05 <+453>: push $0x82ab73e 0x08249a0a <+458>: push $0x82ab29b 0x08249a0f <+463>: call 0x81b6b50 End of assembler dump. (gdb) p &Vmain_thread No symbol "Vmain_thread" in current context. (gdb) quit A debugging session is active. Inferior 1 [process 86154] will be killed. Quit anyway? (y or n) y root@11i386-default:/wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-e511b9d/src # CC --version FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0) Target: i386-unknown-freebsd11.2 Thread model: posix InstalledDir: /usr/bin > Also, please investigate what the macro GCALIGNED_STRUCT expands to. You can use 'gcc -E' to do that. I'll get back to you with this soon. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEVbCTpybDiFVxIrrVNqQMg7DW754FAlvI2lFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDU1 QjA5M0E3MjZDMzg4NTU3MTIyQkFENTM2QTQwQzgzQjBENkVGOUUACgkQNqQMg7DW 755MLg//ZZrkJDqg19EjVTnkDMfeji/PV5W1ri/KRYj7+BZ6GEsYxQsoT1/wJ/zB dlgR4KlBy95ABfar6kClUcelMIJeQgCKky34XLysGO/XCo4V8CrC4hLb9Tj+DeUR 7qYcX5gEBajwdPdVSu+nGAj9Py8NI8BQyipSKF/aR+u4+itu4MPri94owpzVPvCH 27MPWUS69mgdgvTws+rTPB5NWFhGS38IdYyfRE1gkgiNGHEurU1FZmFeZPWqRTH9 IE8WJ+oROP9W0a4LT7Euwl61AUWf/5ar2PA1khYPnMCc6Ql/d+J5C3CsWIhvuVcp OfQ7T43yryhvY3CmZD1OywuQ0hqvmkHIFIU0mAr+MQxfyguN63nXrokzPWE2L0pf BmGbmxuVYqsRQKW1/X6NohjImQ6RLtPRdFzVUu3Jc0PeZDWrsRr2QMlVGjR5mryr +rRRIeklVkP2L51/ypyq5sv+QMAZu+ARFCLzOYqaa62sLdrMRplEbrXzp6DlIZFB aINXYN3jZj1yEE81HcamARiJqzSagsR/T1TNE9cXCGIjEw2+ZBYguYV9abs9Ha+o CTEVBgwgkMAP13s3s8ZPvuVBada0MF7ZlZMGlgXeAZUtXNlhVq3a2PCNexMhm1cI bj7M3l5lFgqVgPWRb5+UnSpT/QeWnCYGo2XLut1LRlitaQ0cYkQ= =pvO0 -----END PGP SIGNATURE----- --=-=-=--