From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Petr Hracek Newsgroups: gmane.emacs.bugs Subject: bug#20614: Segmentation fault when building on Power8 Little Endian Date: Fri, 2 Oct 2015 10:36:27 +0200 Message-ID: <560E420B.9070200@redhat.com> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------080205070003060506050209" X-Trace: ger.gmane.org 1443778734 17638 80.91.229.3 (2 Oct 2015 09:38:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2015 09:38:54 +0000 (UTC) Cc: 20614@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 02 11:38:41 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 1ZhwnT-0005vH-1Q for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2015 11:38:35 +0200 Original-Received: from localhost ([::1]:58314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhwnN-0001UA-E8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2015 05:38:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zhvpx-0004MC-Fy for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2015 04:37:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zhvpu-0002qK-2l for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2015 04:37:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zhvpu-0002qG-06 for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2015 04:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zhvpt-0006TF-OH for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2015 04:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Petr Hracek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Oct 2015 08:37:01 +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.144377499324825 (code B ref 20614); Fri, 02 Oct 2015 08:37:01 +0000 Original-Received: (at 20614) by debbugs.gnu.org; 2 Oct 2015 08:36:33 +0000 Original-Received: from localhost ([127.0.0.1]:51255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhvpQ-0006SK-Jr for submit@debbugs.gnu.org; Fri, 02 Oct 2015 04:36:33 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:60574) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhvpO-0006SB-3w for 20614@debbugs.gnu.org; Fri, 02 Oct 2015 04:36:31 -0400 Original-Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 3AA832FAA6D; Fri, 2 Oct 2015 08:36:29 +0000 (UTC) Original-Received: from [10.34.4.133] (unused-4-133.brq.redhat.com [10.34.4.133]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t928aR6Q021170; Fri, 2 Oct 2015 04:36:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: <837fn6a881.fsf@gnu.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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:107205 Archived-At: This is a multi-part message in MIME format. --------------080205070003060506050209 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 10/01/2015 06:01 PM, Eli Zaretskii wrote: >> Cc: 20614@debbugs.gnu.org >> From: Petr Hracek >> Date: Thu, 1 Oct 2015 16:05:57 +0200 >> >> (gdb) bt full >> #0 0x00003fffb5a9a870 in strcmp () at /lib64/power8/libc.so.6 >> #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 >> section = >> {sh_name = 122, sh_type = 4, sh_flags = 2, sh_addr = >> 268483528, sh_offset = 48072, sh_size = 768, sh_link = 5, sh_info = 0, >> sh_addralign = 8, sh_entsize = 24} > 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. (gdb) info frame Stack level 1, frame at 0x3fffffffd9d0: pc = 0x102e3724 in unexec (unexelf.c:1258); saved pc 0x101a1170 called by frame at 0x3fffffffda70, caller of frame at 0x3fffffffd770 source language c. Arglist at 0x3fffffffd770, args: new_name=0x116387e8 "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/emacs", old_name=0x11638838 "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/temacs" Locals at 0x3fffffffd770, Previous frame's sp is 0x3fffffffd9d0 Saved registers: r30 at 0x3fffffffd9c0, r31 at 0x3fffffffd9c8, pc at 0x3fffffffd9e0, lr at 0x3fffffffd9e0 (gdb) info locals section = {sh_name = 122, sh_type = 4, sh_flags = 2, sh_addr = 268483528, sh_offset = 48072, sh_size = 768, sh_link = 5, sh_info = 0, sh_addralign = 8, sh_entsize = 24} new_file = 10 old_file = 9 new_file_size = 30790315 new_break = 0x116f0000 old_base = 0x3fffaa800000 "\177ELF\002\001\001" new_base = 0x3fffa8aa0000 "\177ELF\002\001\001" old_file_h = 0x3fffaa800000 new_file_h = 0x3fffa8aa0000 old_program_h = 0x3fffaa800040 new_program_h = 0x3fffa8aa0040 old_section_h = 0x3fffab1dc110 new_section_h = 0x3fffaa78c110 old_section_names = 0x3fffab1dbfcc "" old_bss_addr = 272498688 new_bss_addr = 292487168 old_bss_size = 563072 new_data2_size = 19988480 new_data2_offset = 4063232 new_data2_addr = 272498688 old_bss_offset = 4063232 new_data2_incr = 19988480 n = 9 nn = 0 old_bss_index = 22 old_sbss_index = -1 old_plt_index = 20 old_data_index = 21 new_data2_index = 20 stat_buf = {st_dev = 2050, st_ino = 5119871, st_nlink = 1, st_mode = 33261, st_uid = 20582, st_gid = 20582, __pad2 = 0, st_rdev = 0, st_size = 10801771, st_blksize = 4096, st_blocks = 20984, st_atim = {tv_sec = 1443772792, tv_nsec = 166219486}, st_mtim = {tv_sec = 1443772792, tv_nsec = 46219474}, st_ctim = {tv_sec = 1443772792, tv_nsec = 46219474}, __unused4 = 0, __unused5 = 0, __unused6 = 0} old_file_size = 10801771 (gdb) info args new_name = 0x116387e8 "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/emacs" old_name = 0x11638838 "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/temacs" -- Petr Hracek Software Engineer Developer Experience Red Hat, Inc Mob: +420777056169 email: phracek@redhat.com --------------080205070003060506050209 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit
On 10/01/2015 06:01 PM, Eli Zaretskii wrote:
Cc: 20614@debbugs.gnu.org
From: Petr Hracek <phracek@redhat.com>
Date: Thu, 1 Oct 2015 16:05:57 +0200

(gdb) bt full
#0  0x00003fffb5a9a870 in strcmp () at /lib64/power8/libc.so.6
#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
         section =
           {sh_name = 122, sh_type = 4, sh_flags = 2, sh_addr = 
268483528, sh_offset = 48072, sh_size = 768, sh_link = 5, sh_info = 0, 
sh_addralign = 8, sh_entsize = 24}
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.
(gdb) info frame
Stack level 1, frame at 0x3fffffffd9d0:
 pc = 0x102e3724 in unexec (unexelf.c:1258); saved pc 0x101a1170
 called by frame at 0x3fffffffda70, caller of frame at 0x3fffffffd770
 source language c.
 Arglist at 0x3fffffffd770, args: new_name=0x116387e8 "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/emacs", old_name=0x11638838 "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/temacs"
 Locals at 0x3fffffffd770, Previous frame's sp is 0x3fffffffd9d0
 Saved registers:
  r30 at 0x3fffffffd9c0, r31 at 0x3fffffffd9c8, pc at 0x3fffffffd9e0, lr at 0x3fffffffd9e0
(gdb) info locals
section = {sh_name = 122, sh_type = 4, sh_flags = 2, sh_addr = 268483528, sh_offset = 48072, sh_size = 768, sh_link = 5, sh_info = 0, sh_addralign = 8, sh_entsize = 24}
new_file = 10
old_file = 9
new_file_size = 30790315
new_break = 0x116f0000
old_base = 0x3fffaa800000 "\177ELF\002\001\001"
new_base = 0x3fffa8aa0000 "\177ELF\002\001\001"
old_file_h = 0x3fffaa800000
new_file_h = 0x3fffa8aa0000
old_program_h = 0x3fffaa800040
new_program_h = 0x3fffa8aa0040
old_section_h = 0x3fffab1dc110
new_section_h = 0x3fffaa78c110
old_section_names = 0x3fffab1dbfcc ""
old_bss_addr = 272498688
new_bss_addr = 292487168
old_bss_size = 563072
new_data2_size = 19988480
new_data2_offset = 4063232
new_data2_addr = 272498688
old_bss_offset = 4063232
new_data2_incr = 19988480
n = 9
nn = 0
old_bss_index = 22
old_sbss_index = -1
old_plt_index = 20
old_data_index = 21
new_data2_index = 20
stat_buf = {st_dev = 2050, st_ino = 5119871, st_nlink = 1, st_mode = 33261, st_uid = 20582, st_gid = 20582, __pad2 = 0, st_rdev = 0, st_size = 10801771, st_blksize = 4096,
  st_blocks = 20984, st_atim = {tv_sec = 1443772792, tv_nsec = 166219486}, st_mtim = {tv_sec = 1443772792, tv_nsec = 46219474}, st_ctim = {tv_sec = 1443772792, tv_nsec = 46219474},
  __unused4 = 0, __unused5 = 0, __unused6 = 0}
old_file_size = 10801771
(gdb) info args
new_name = 0x116387e8 "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/emacs"
old_name = 0x11638838 "/home/phracek/rpmbuild/BUILD/emacs-24.3/src/temacs"


-- 
Petr Hracek
Software Engineer
Developer Experience
Red Hat, Inc
Mob: +420777056169
email: phracek@redhat.com
--------------080205070003060506050209--