From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20614: Segmentation fault when building on Power8 Little Endian Date: Mon, 05 Oct 2015 11:27:17 +0300 Message-ID: <83twq5zpne.fsf@gnu.org> References: <555C3E3C.4090700@redhat.com> <1gpp5vi5xn.fsf@fencepost.gnu.org> <555DD5D3.3020207@redhat.com> <55A3A08A.9060905@redhat.com> <55A4BFB7.3010208@redhat.com> <55F95275.4040209@redhat.com> <56012AA6.7010702@redhat.com> <56025D9A.9080608@redhat.com> <838u7xlbsn.fsf@gnu.org> <56028633.3000303@redhat.com> <83zj0djskx.fsf@gnu.org> <56029707.9040100@redhat.com> <83wpvhjpdd.fsf@gnu.org> <5603D8BE.10300@redhat.com> <834mijkf36.fsf@gnu.org> <56043950.7040108@redhat.com> <83k2rdhaso.fsf@gnu.org> <560BBBF3.6000407@redhat.com> <83r3lf9gq4.fsf@gnu.org> <560D1EAA.3080608@redhat.com> <83bnciaidw.fsf@gnu.org> <560D3DC5.2050804@redhat.com> <837fn6a881.fsf@gnu.org> <560E420B.9070200@redhat.com> <83d1wx7j0e.fsf@gnu.org> <560E7F90.1070609@redhat.com> <83wpv55qog.fsf@gnu.org> <5612295F.4000607@redhat.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1444033723 6541 80.91.229.3 (5 Oct 2015 08:28:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Oct 2015 08:28:43 +0000 (UTC) Cc: 20614@debbugs.gnu.org To: Petr Hracek Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 05 10:28:32 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zj18H-0006hl-7X for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Oct 2015 10:28:29 +0200 Original-Received: from localhost ([::1]:44797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj18G-00046X-7M for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Oct 2015 04:28:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj17v-00045N-Lc for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2015 04:28:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zj17q-0004MS-OH for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2015 04:28:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj17q-0004MK-Lg for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2015 04:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zj17q-00077z-A6 for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2015 04:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Oct 2015 08:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20614 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20614-submit@debbugs.gnu.org id=B20614.144403364427349 (code B ref 20614); Mon, 05 Oct 2015 08:28:02 +0000 Original-Received: (at 20614) by debbugs.gnu.org; 5 Oct 2015 08:27:24 +0000 Original-Received: from localhost ([127.0.0.1]:54833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zj17D-000773-MS for submit@debbugs.gnu.org; Mon, 05 Oct 2015 04:27:24 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:54811) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zj17A-00076s-3s for 20614@debbugs.gnu.org; Mon, 05 Oct 2015 04:27:21 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NVQ00600N0YOH00@mtaout27.012.net.il> for 20614@debbugs.gnu.org; Mon, 05 Oct 2015 11:23:29 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NVQ004JYNB4PU30@mtaout27.012.net.il>; Mon, 05 Oct 2015 11:23:29 +0300 (IDT) In-reply-to: <5612295F.4000607@redhat.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107302 Archived-At: > Cc: 20614@debbugs.gnu.org > From: Petr Hracek > Date: Mon, 5 Oct 2015 09:40:15 +0200 > > >>>> What does this GDB command display in frame #1: > >>>> > >>>> (gdb) p old_section_names + NEW_SECTION_H (nn).sh_name > >>>> > >>>> ? > >>>> > >>>> It is a really strange. > >>>> in our unexelf.c is NEW_SECTION_H defined as > >>>> > >>>> #define NEW_SECTION_H(n) \ > >>>> (*(ElfW (Shdr) *) ((byte *) new_section_h + new_file_h->e_shentsize * (n))) > >>>> > >>>> Paul Eggert did a some patch 1 or 2 year ago and modify it to > >>>> #define NEW_SECTION_H(n) \ > >>>> (*(ElfW (Shdr) *) entry_address (new_section_h, n, new_file_h->e_shentsize)) > >>>> > >>>> (gdb) frame 1 > >>>> #1 0x00000000102e3724 in unexec (new_name=0x116387e8 > >>>> "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/emacs", old_name=0x11638838 > >>>> "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/temacs") > >>>> at unexelf.c:1258 > >>>> 1258 if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".data") > >>>> (gdb) p old_section_names > >>>> $1 = 0x3fffab1dbfcc "" > >>>> (gdb) p old_section_names + NEW_SECTION_H (nn).sh_name > >>>> No symbol "NEW_SECTION_H" in current context. > >>> Use the expansion of that macro instead to display the value. > >> How to use the expansion. > > Just type it by hand: > > > > (gdb) p old_section_names + (*(ElfW (Shdr) *) ((byte *) new_section_h + new_file_h->e_shentsize * (nn))) > > > >> Are you connected on freenode #emacs. > > No. > First of all thank you for your time. > Well, > (gdb) p (*(ElfW (Shdr) *) ((byte *) new_section_h + > new_file_h->e_shentsize * (nn))) > No symbol "ElfW" in current context. > (gdb) > Also ElfBitsW does not exists. > (gdb) p ElfBitsW > No symbol "ElfBitsW" in current context. > (gdb) You need to expand all these macros by hand. They are defined at the beginning of unexelf.c: #ifndef ElfW # define ElfBitsW(bits, type) Elf##bits##_##type # ifndef ELFSIZE # ifdef _LP64 # define ELFSIZE 64 # else # define ELFSIZE 32 # endif # endif /* This macro expands `bits' before invoking ElfBitsW. */ # define ElfExpandBitsW(bits, type) ElfBitsW (bits, type) # define ElfW(type) ElfExpandBitsW (ELFSIZE, type) #endif I would suggest at first to rebuild Emacs with "-gdwarf-4 -g3" compiler switches, maybe that will allow you to type expressions with macros, and let GDB expand them using the debug info. Maybe.