[fpc-pascal] Building trunk

Florian Klämpfl florian at freepascal.org
Sat Nov 24 23:21:44 CET 2018


Am 24.11.2018 um 10:08 schrieb C Western:
> On 23/11/2018 09:50, Sven Barth via fpc-pascal wrote:
>> Am Fr., 23. Nov. 2018, 10:26 hat C Western <l at c-m-w.me.uk <mailto:l at 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 at 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

Can you please check what value phdr has at the crash location after applying the following patch?

diff --git a/rtl/linux/system.pp b/rtl/linux/system.pp
index 0d7ed2b152..74b4592ace 100644
--- a/rtl/linux/system.pp
+++ b/rtl/linux/system.pp
@@ -525,6 +525,8 @@ procedure InitTLS; [public,alias:'FPC_INITTLS'];
     while assigned(auxp^) do
       inc(auxp);
     inc(auxp);
+    phdr:=nil;
+    phnum:=0;
     { now we are at the auxillary vector }
     while assigned(auxp^) do
       begin



More information about the fpc-pascal mailing list