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: Wed, 7 Oct 2015 10:17:38 +0200 Message-ID: <5614D522.9080900@redhat.com> References: <555C3E3C.4090700@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> <83twq5zpne.fsf@gnu.org> <56123FF0.3040104@redhat.com> <83oagdzmbj.fsf@gnu.org> <56125DBE.5090305@redhat.com> <83io6lzgpw.fsf@gnu.org> <5612842F.7050102@redhat.com> <83d1wtz29x.fsf@gnu.org> <5613894B.9070902@redhat.com> <5613B614.4090805@redhat.com> <83egh8xczn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------060805090501020508050002" X-Trace: ger.gmane.org 1444206047 11703 80.91.229.3 (7 Oct 2015 08:20:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Oct 2015 08:20:47 +0000 (UTC) Cc: jcapik@redhat.com, 20614@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 07 10:20:36 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 1Zjjxh-0002Gr-Gm for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Oct 2015 10:20:33 +0200 Original-Received: from localhost ([::1]:56182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zjjxa-0000sG-9o for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Oct 2015 04:20:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjjwL-0000eI-U6 for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2015 04:20:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjjvG-00029J-FY for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2015 04:19:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjjvG-000291-AV for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2015 04:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZjjvF-00045Z-NI for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2015 04:18: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: Wed, 07 Oct 2015 08:18: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.144420586515694 (code B ref 20614); Wed, 07 Oct 2015 08:18:01 +0000 Original-Received: (at 20614) by debbugs.gnu.org; 7 Oct 2015 08:17:45 +0000 Original-Received: from localhost ([127.0.0.1]:57758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zjjuy-000453-S9 for submit@debbugs.gnu.org; Wed, 07 Oct 2015 04:17:45 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:43235) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zjjuv-00044r-Or for 20614@debbugs.gnu.org; Wed, 07 Oct 2015 04:17:43 -0400 Original-Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id F3379BACDB; Wed, 7 Oct 2015 08:17:40 +0000 (UTC) Original-Received: from [10.34.4.133] (unused-4-133.brq.redhat.com [10.34.4.133]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t978Hdis005601; Wed, 7 Oct 2015 04:17:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: <83egh8xczn.fsf@gnu.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 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:107401 Archived-At: This is a multi-part message in MIME format. --------------060805090501020508050002 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 10/06/2015 04:55 PM, Eli Zaretskii wrote: >> From: Petr Hracek >> Date: Tue, 6 Oct 2015 13:52:52 +0200 >> >> I have a question >> unexec part is called always? >> Even when make bootstrap is not called? > It is called each time the Emacs executable is built. > >> What is bootstrap used for? > Fir the first build, when there are no *.elc files. Our secondary arches expert did awesome research and mention it in bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1265271#c11 Basically If you don't have an access to bugzilla: Hello guys. I'm affraid it didn't work correctly even with the old binutils. The whole unexec logic is broken and needs a lot of love. The relocation undoing is done the following way on x86_64: .rela.plt -> .plt .rela.bss -> .bss .rela.got -> .got ... but on ppc64le I get the following with the old binutils: .rela.plt -> .data .rela.toc -> empty string (probably some zeros in memory) ... and with the new binutils it probably just attacks a different part of memory and segfaults. On ppc64be I also get wrong results ... with binutils-2.23.52.0.1-50.el7.ppc64 .rela.plt -> .data .rela.toc -> empty string .rela.data.rel.ro -> .data.rel.ro with binutils-2.23.52.0.1-54.el7.ppc64 .rela.plt -> .data .rela.toc -> segfault Fedora 22 is affected too ... with binutils-2.25-8.fc22.ppc64le .rela.plt -> .data .rela.toc -> empty string .rela.data.rel.ro -> .data.rel.ro Fedora 22 for s390x seems ok ... .rela.plt -> .plt .rela.got -> .got Fedora 22 for aarch64 seems ok too .. .rela.plt -> .plt .rela.got -> .got Can anybody from upstream correct it? @Jaromir: Thank you for your time and awesome analysis. -- Petr Hracek Software Engineer Developer Experience Red Hat, Inc Mob: +420777056169 email: phracek@redhat.com --------------060805090501020508050002 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit
On 10/06/2015 04:55 PM, Eli Zaretskii wrote:
From: Petr Hracek <phracek@redhat.com>
Date: Tue, 6 Oct 2015 13:52:52 +0200

I have a question
unexec part is called always?
Even when make bootstrap is not called?
It is called each time the Emacs executable is built.

What is bootstrap used for?
Fir the first build, when there are no *.elc files.
Our secondary arches expert did awesome research and mention it in bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=1265271#c11

Basically If you don't have an access to bugzilla:
Hello guys.

I'm affraid it didn't work correctly even with the old binutils. The whole unexec logic is broken and needs a lot of love.

The relocation undoing is done the following way on x86_64:
.rela.plt -> .plt
.rela.bss -> .bss
.rela.got -> .got

... but on ppc64le I get the following with the old binutils:
.rela.plt -> .data
.rela.toc -> empty string (probably some zeros in memory)

... and with the new binutils it probably just attacks a different part of memory and segfaults.
On ppc64be I also get wrong results ...
with binutils-2.23.52.0.1-50.el7.ppc64
.rela.plt -> .data
.rela.toc -> empty string
.rela.data.rel.ro -> .data.rel.ro

with binutils-2.23.52.0.1-54.el7.ppc64
.rela.plt -> .data
.rela.toc -> segfault

Fedora 22 is affected too ...
with binutils-2.25-8.fc22.ppc64le
.rela.plt -> .data
.rela.toc -> empty string
.rela.data.rel.ro -> .data.rel.ro

Fedora 22 for s390x seems ok ...
.rela.plt -> .plt
.rela.got -> .got


Fedora 22 for aarch64 seems ok too ..
.rela.plt -> .plt
.rela.got -> .got
Can anybody from upstream correct it? @Jaromir: Thank you for your time and awesome analysis.
-- 
Petr Hracek
Software Engineer
Developer Experience
Red Hat, Inc
Mob: +420777056169
email: phracek@redhat.com
--------------060805090501020508050002--