Subject: Re: bug#20614: Segmentation fault when building on Power8 Little Endian

From: Petr Hracek <[email-masked]>
Date: Tue, 6 Oct 2015 13:52:52 +0200

On 10/06/2015 10:41 AM, Petr Hracek wrote:
> On 10/05/2015 06:52 PM, Eli Zaretskii wrote:
>>> Cc: [email-masked]
>>> From: Petr Hracek <[email-masked]>
>>> Date: Mon, 5 Oct 2015 16:07:43 +0200
>>>
>>> cd ../lisp; make -w compile-first
>>> EMACS=/home/phracek/rpmbuild/BUILD/emacs-24.3/src/bootstrap-emacs
>>> make[3]: Entering directory 
>>> `/home/phracek/rpmbuild/BUILD/emacs-24.3/lisp'
>>> Compiling
>>> /home/phracek/rpmbuild/BUILD/emacs-24.3/lisp/emacs-lisp/macroexp.el
>>> /bin/sh: /home/phracek/rpmbuild/BUILD/emacs-24.3/src/bootstrap-emacs:
>>> cannot execute binary file
>>> make[3]: ***
>>> [/home/phracek/rpmbuild/BUILD/emacs-24.3/lisp/emacs-lisp/macroexp.elc]
>>> Error 126
>>> make[3]: Leaving directory 
>>> `/home/phracek/rpmbuild/BUILD/emacs-24.3/lisp'
>>> make[2]: *** [bootstrap-emacs] Error 2
>>> make[2]: Leaving directory 
>>> `/home/phracek/rpmbuild/BUILD/emacs-24.3/src'
>>> make[1]: *** [src] Error 2
>>> make[1]: Leaving directory `/home/phracek/rpmbuild/BUILD/emacs-24.3'
>>>
>>> Some information about bootstrap-emacs binary:
>>> $ file /home/phracek/rpmbuild/BUILD/emacs-24.3/src/bootstrap-emacs
>>> /home/phracek/rpmbuild/BUILD/emacs-24.3/src/bootstrap-emacs: ELF 64-bit
>>> LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV),
>>> corrupted program header size, stripped
>>> $
>>>
>>> If condition valid_pointer_p is set to >= 0 then it segfaults again.
>>> Where can be a problem now?
>> I don't know, sorry.  This requires help from someone who knows about
>> the structure of ELF executables.  I suggested to ask some of Binutils
>> maintainers to help.
>
> Reason of the failure is probably caused by if valid_pointer_p.
> [phracek@ibm-p8-generic-01-le02 emacs]$ readelf -a 
> /home/phracek/rpmbuild/BUILD/emacs-24.3/src/bootstrap-emacs
> ELF Header:
>   Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
>   Class:                             ELF64
>   Data:                              2's complement, little endian
>   Version:                           1 (current)
>   OS/ABI:                            UNIX - System V
>   ABI Version:                       0
>   Type:                              EXEC (Executable file)
>   Machine:                           PowerPC64
>   Version:                           0x1
>   Entry point address:               0x10016100
>   Start of program headers:          64 (bytes into file)
>   Start of section headers:          23502592 (bytes into file)
>   Flags:                             0x1669f00
>   Size of this header:               0 (bytes)
>   Size of program headers:           0 (bytes)
>   Number of program headers:         9
>   Size of section headers:           64 (bytes)
>   Number of section headers:         35
>   Section header string table index: 32
>
> Section Headers:
>   [Nr] Name              Type             Address           Offset
>        Size              EntSize          Flags  Link  Info  Align
>   [ 0] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 1] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 2] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 3] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 4] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 5] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 6] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 7] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 8] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [ 9] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [10] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [11] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [12] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [13] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [14] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [15] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [16] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [17] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [18] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [19] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [20] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [21] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [22] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [23] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [24] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [25] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [26] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [27] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [28] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [29] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [30] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [31] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [32] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [33] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
>   [34] <no-name>         NULL             0000000000000000 00000000
>        0000000000000000  0000000000000000           0     0     0
> Key to Flags:
>   W (write), A (alloc), X (execute), M (merge), S (strings)
>   I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
>   O (extra OS processing required) o (OS specific), p (processor 
> specific)
>
> There are no section groups in this file.
>
> There are no relocations in this file.
>
> The decoding of unwind sections for machine type PowerPC64 is not 
> currently supported.
>
> No version information found in this file.
>
>
I have a question
unexec part is called always?
Even when make bootstrap is not called?

What is bootstrap used for?

-- 
Petr Hracek
Software Engineer
Developer Experience
Red Hat, Inc
Mob: +420777056169
email: [email-masked]