On 24/11/2018 15:19, C Western wrote:
On 24/11/2018 12:30, Sven Barth via fpc-pascal wrote:
Am Sa., 24. Nov. 2018, 10:09 hat C Western <l...@c-m-w.me.uk <mailto:l...@c-m-w.me.uk>> geschrieben:

    On 23/11/2018 09:50, Sven Barth via fpc-pascal wrote:
    > Am Fr., 23. Nov. 2018, 10:26 hat C Western <l...@c-m-w.me.uk
    <mailto:l...@c-m-w.me.uk>
    > <mailto:l...@c-m-w.me.uk <mailto:l...@c-m-w.me.uk>>> geschrieben:
    >
    >     I haven't been able to build trunk i386 fpc for a couple of
    weeks. Is
    >     this supposed to be working, or have I misconfigured
    something? (I
    >     don't
    >     think I have changed anything.) The output is below. I don't
    think
    >     it is
    >     significant, but I am building on a 64 bit system, but with
    a 32 bit
    >     starting compiler. (The 64 bit build with the 64 bit starting
    >     compiler
    >     works fine.)
    >
    >
    > We have i386 trunk building on at least one x86_64-linux
    machine, so
    > it can't be a principal problem. :/
    > Could you check whether it's FPC itself that segfaults or something
    > else and if the former try to retrieve a stacktrace, please?
    >
    > Regards,
    > Sven
    >
    > _______________________________________________
    > fpc-pascal maillist  - fpc-pascal@lists.freepascal.org
    <mailto:fpc-pascal@lists.freepascal.org>
    > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

    Looks like the ppc1 compiler crashes during setup:

    gdb) run
    Starting program: /home/me/fpc/trunk/fpcsrc/compiler/ppc1

    Program received signal SIGSEGV, Segmentation fault.
    0x08068760 in INITTLS () at system.pp:543
    543            case phdr^.p_type of
    (gdb) bt
    #0  0x08068760 in INITTLS () at system.pp:543
    #1  0x082a63fb in _FPC_PROC_START () at ./i386/si_prc.inc:105
    (gdb) p phdr
    $1 = (PPHDR) 0x8048034
    (gdb) p phdr^
    Cannot access memory at address 0x8048034


Looks like something related to the new threadvar handling. Though by default that shouldn't be enabled... 🤔

Regards,
Sven

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Some more information:

It seems to work fine on Ubuntu (32 bit built on 64 bit OS, same machine). Comparing the binaries with objdump, it looks as though the Fedora one has an offset of 1000, which the Ununtu one does not, and the offset of 1000 needs to be applied to the program header address, but is not. On Fedora:

ppc1:     file format elf32-i386
ppc1
architecture: i386, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x082a63d0

Program Header:
    LOAD off    0x00001000 vaddr 0x08049000 paddr 0x08049000 align 2**12
         filesz 0x0025d450 memsz 0x0025d450 flags r-x
    LOAD off    0x0025f000 vaddr 0x082a7000 paddr 0x082a7000 align 2**12
         filesz 0x00020f04 memsz 0x00020f04 flags r--
    LOAD off    0x00280000 vaddr 0x082c8000 paddr 0x082c8000 align 2**12
         filesz 0x000f7280 memsz 0x00102d84 flags rw-
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4
         filesz 0x00000000 memsz 0x00000000 flags rw-

On Ubuntu:

./ppc1:     file format elf32-i386
./ppc1
architecture: i386, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x082a5470

Program Header:
    LOAD off    0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
         filesz 0x0027e3f4 memsz 0x0027e3f4 flags r-x
    LOAD off    0x0027f000 vaddr 0x082c7000 paddr 0x082c7000 align 2**12
         filesz 0x000f7280 memsz 0x00102d84 flags rw-
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4
         filesz 0x00000000 memsz 0x00000000 flags rw-

gdb indicates both versions try to access 0x8048034, but this is not mapped on the Fedora version.

Colin

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

And going through the versions indicates the problem is introduced by:

r40272 | florian | 2018-11-07 22:03:02 +0000 (Wed, 07 Nov 2018) | 1 line
Changed paths:
   M /trunk/compiler/cgbase.pas
   M /trunk/compiler/x86/agx86att.pas
   M /trunk/compiler/x86/cgx86.pas
   M /trunk/compiler/x86/nx86ld.pas
   M /trunk/rtl/linux/i386/si_prc.inc
   M /trunk/rtl/linux/system.pp

+ i386-linux support for tls-based threadvars

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to