View Issue Details

IDProjectCategoryView StatusLast Update
0035751FPCCompilerpublic2019-10-13 13:14
ReporterCyraxAssigned ToJonas Maebe 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinux x86_64OSArchOS Version3.17.4-1
Product Version3.3.1Product Buildr42267 
Target VersionFixed in Version 
Summary0035751: make all fails when building Linux/i386 with psabieh
DescriptionI'm trying to test new feature "Dwarf-eh-based "zero-cost" exceptions" which were merged back to trunk at r42260. However building the compiler suite fails during building pas2jslib package.
Additional Information
Considering package utils-pas2js
  Search path for external dependency fcl-js
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/fcl-js/fpmake.pp" Not Found
  Directory "/mnt/shares/ohjelmointi2/fpc/source/git_source/units/i386-linux/fcl-js" Not Found
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-js/fpmake.pp" Found
  Directory "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-js/units/i386-linux/" Found
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-js/fcl-js-i386-linux.fpm" Found
  External dependency fcl-js found in "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-js/units/i386-linux/"
  Loading "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-js/fcl-js-i386-linux.fpm"
  Search path for external dependency pastojs
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/pastojs/fpmake.pp" Not Found
  Directory "/mnt/shares/ohjelmointi2/fpc/source/git_source/units/i386-linux/pastojs" Not Found
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pastojs/fpmake.pp" Found
  Directory "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pastojs/units/i386-linux/" Found
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pastojs/pastojs-i386-linux.fpm" Found
  External dependency pastojs found in "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pastojs/units/i386-linux/"
  Loading "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pastojs/pastojs-i386-linux.fpm"
  Search path for external dependency webidl
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/webidl/fpmake.pp" Not Found
  Directory "/mnt/shares/ohjelmointi2/fpc/source/git_source/units/i386-linux/webidl" Not Found
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/webidl/fpmake.pp" Found
  Directory "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/webidl/units/i386-linux/" Found
  File "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/webidl/webidl-i386-linux.fpm" Found
  External dependency webidl found in "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/webidl/units/i386-linux/"
  Loading "/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/webidl/webidl-i386-linux.fpm"
  Resolving filenames of target pas2js for i386-linux
    Resolved source file pas2js.pp to "pas2js.pp"
  Resolving filenames of target pas2jslib for i386-linux
    Resolved source file pas2jslib.pp to "pas2jslib.pp"
  Resolving filenames of target dirwatch for i386-linux
    Resolved source file dirwatch.pp to "dirwatch.pp"
  Resolving filenames of target httpcompiler for i386-linux
    Resolved source file httpcompiler.pp to "httpcompiler.pp"
  Resolving filenames of target compileserver for i386-linux
    Resolved source file compileserver.pp to "compileserver.pp"
  Resolving filenames of target webidl2pas for i386-linux
    Resolved source file webidl2pas.pp to "webidl2pas.pp"
  Output file pas2js/bin/i386-linux/pas2js not available
  Must compile pas2js. (Output file does not exist)
  Must compile utils-pas2js. ()
Start compiling package utils-pas2js for target i386-linux.
Directory "pas2js/units/i386-linux/" Not Found
Creating output dir "pas2js/units/i386-linux/"
Directory "pas2js/bin/i386-linux" Not Found
Creating output dir "pas2js/bin/i386-linux"
Considering target dirwatch
  Compiling dependencies of target dirwatch
  Output file pas2js/units/i386-linux/dirwatch.ppu not available
  Must compile dirwatch. (Output file does not exist)
  Compiling target dirwatch
Considering target httpcompiler
  Compiling dependencies of target httpcompiler
  Output file pas2js/units/i386-linux/httpcompiler.ppu not available
  Must compile httpcompiler. (Output file does not exist)
  Compiling target httpcompiler
Generate build-unit BuildUnit_utils_pas2js
Compiling target BuildUnit_utils_pas2js
  Executing command "/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler/ppc386 -Tlinux -FUpas2js/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/rtl/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-json/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-base/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-res/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/rtl-objpas/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-js/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-passrc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pastojs/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/paszlib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/hash/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-process/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-web/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-db/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-xml/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/iconvenc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/rtl-extra/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/ibase/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/mysql/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/odbc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/oracle/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/postgres/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/sqlite/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/dblib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pxlib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-net/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-async/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-fpcunit/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/libtar/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/openssl/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fastcgi/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/httpd22/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/httpd24/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/webidl/units/i386-linux/ -Ur -Xs -O2 -n -gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -Xs- -Si- -vbq -Sew- -dEXTDEBUG -vh- -vn- -vw- -dDEBUG_NODE_DUMP -Fl/usr/lib/gcc/i686-pc-linux-gnu/8.3.0 -dpsabieh -dTEST_WIN32_SEH -di386 -dRELEASE -viq pas2js/BuildUnit_utils_pas2js.pp"
       Compiling pas2js/BuildUnit_utils_pas2js.pp
       Compiling pas2js/dirwatch.pp
       Compiling pas2js/httpcompiler.pp
Deleted file "pas2js/units/i386-linux/BuildUnit_utils_pas2js.o"
File "pas2js/units/i386-linux/BuildUnit_utils_pas2js.bc" does not exist
Deleted file "pas2js/units/i386-linux/BuildUnit_utils_pas2js.ppu"
Deleted file "pas2js/BuildUnit_utils_pas2js.pp"
Considering target pas2js
  Compiling dependencies of target pas2js
  Output file pas2js/bin/i386-linux/pas2js not available
  Must compile pas2js. (Output file does not exist)
  Compiling target pas2js
    Executing command "/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler/ppc386 -Tlinux -FEpas2js/bin/i386-linux -FUpas2js/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/rtl/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-json/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-base/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-res/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/rtl-objpas/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-js/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-passrc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pastojs/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/paszlib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/hash/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-process/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-web/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-db/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-xml/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/iconvenc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/rtl-extra/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/ibase/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/mysql/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/odbc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/oracle/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/postgres/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/sqlite/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/dblib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pxlib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-net/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-async/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-fpcunit/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/libtar/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/openssl/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fastcgi/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/httpd22/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/httpd24/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/webidl/units/i386-linux/ -Ur -Xs -O2 -n -gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -Xs- -Si- -vbq -Sew- -dEXTDEBUG -vh- -vn- -vw- -dDEBUG_NODE_DUMP -Fl/usr/lib/gcc/i686-pc-linux-gnu/8.3.0 -dpsabieh -dTEST_WIN32_SEH -di386 -dRELEASE -viq pas2js/pas2js.pp"
       Compiling pas2js/pas2js.pp
       Linking pas2js/bin/i386-linux/pas2js
Considering target pas2jslib
  Compiling dependencies of target pas2jslib
  Output file pas2js/bin/i386-linux/libpas2jslib.so not available
  Must compile pas2jslib. (Output file does not exist)
  Compiling target pas2jslib
    Executing command "/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler/ppc386 -Tlinux -FEpas2js/bin/i386-linux -FUpas2js/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/rtl/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-json/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-base/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-res/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/rtl-objpas/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-js/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-passrc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pastojs/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/paszlib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/hash/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-process/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-web/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-db/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-xml/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/iconvenc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/rtl-extra/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/ibase/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/mysql/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/odbc/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/oracle/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/postgres/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/sqlite/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/dblib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/pxlib/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-net/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-async/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fcl-fpcunit/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/libtar/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/openssl/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/fastcgi/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/httpd22/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/httpd24/units/i386-linux/ -Fu/mnt/shares/ohjelmointi2/fpc/source/git_source/packages/webidl/units/i386-linux/ -Ur -Xs -O2 -n -gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -Xs- -Si- -vbq -Sew- -dEXTDEBUG -vh- -vn- -vw- -dDEBUG_NODE_DUMP -Fl/usr/lib/gcc/i686-pc-linux-gnu/8.3.0 -dpsabieh -dTEST_WIN32_SEH -di386 -dRELEASE -viq pas2js/pas2jslib.pp"
       Compiling pas2js/pas2jslib.pp
       Linking pas2js/bin/i386-linux/libpas2jslib.so
Runtime error 217 at $08066589
  $08066589  _FPC_PSABIEH_PERSONALITY_V0,  line 919 of ../inc/psabieh.inc
  $F7F627D3 line 64 of /build/gcc/src/gcc/libgcc/unwind.inc

make[2]: *** [Makefile:2499: all] Error 217
make[2]: Leaving directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/utils'
make[1]: *** [Makefile:2679: utils_all] Error 2
make[1]: Leaving directory '/mnt/shares/ohjelmointi2/fpc/source/git_source'
make: *** [Makefile:2884: build-stamp.i386-linux] Error 2
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files
  • x86_64-linux 26573614-make_log.tar.gz (45,504 bytes)
  • i386-linux 19226213-make_log.tar.gz (148,371 bytes)
  • ppc386 gdb backtrace.tar.gz (276,824 bytes)
  • make log gdb attach log.tar.gz (551,819 bytes)
  • fpmake.pp.patch (676 bytes)
    --- a/utils/pas2js/fpmake.pp
    +++ b/utils/pas2js/fpmake.pp
    @@ -9,7 +9,7 @@
     
     Var
       P : TPackage;
    -  PT,T : TTarget;
    +  PT,T,TL : TTarget;
     
     begin
       With Installer do
    @@ -35,7 +35,10 @@
         P.Dependencies.Add('fcl-web');
         P.Dependencies.Add('webidl');
         PT:=P.Targets.AddProgram('pas2js.pp');
    -    PT:=P.Targets.AddLibrary('pas2jslib.pp');
    +    TL:=P.Targets.AddLibrary('pas2jslib.pp');
    +    {$IF DEFINED(FPC_USE_PSABIEH) AND DEFINED(CPUI386)}
    +    TL.Options.Add('-Cg');
    +    {$ENDIF DEFINED(FPC_USE_PSABIEH) AND DEFINED(CPUI386)} 
         PT:=P.Targets.AddUnit('dirwatch.pp');
         PT:=P.Targets.AddUnit('httpcompiler.pp');
         PT.Dependencies.AddUnit('dirwatch');
    
    
    fpmake.pp.patch (676 bytes)
  • make-log.txt.zip (2,242 bytes)
  • psabieh_fix_attempt.diff (14,609 bytes)
    diff --git a/rtl/inc/except.inc b/rtl/inc/except.inc
    index c14c702726..8036083496 100644
    --- a/rtl/inc/except.inc
    +++ b/rtl/inc/except.inc
    @@ -26,6 +26,8 @@ Var
       ExceptObjectStack : PExceptObject;
       ExceptTryLevel    : ObjpasInt;
     
    +Procedure DoUnHandledException;forward;
    +
     {$ifdef FPC_USE_PSABIEH}
     {$i psabieh.inc}
     {$endif}
    diff --git a/rtl/inc/psabieh.inc b/rtl/inc/psabieh.inc
    index 545ddf8fd4..aa81bcf2f2 100644
    --- a/rtl/inc/psabieh.inc
    +++ b/rtl/inc/psabieh.inc
    @@ -188,7 +188,7 @@ function FPC_psabieh_size_of_encoded_value(encoding: byte): longint;
             exit(8);
           else
             begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
               writeln('Unsupported encoding: $', hexstr(encoding,sizeof(encoding)*2));
     {$endif}
               halt(217);
    @@ -220,7 +220,7 @@ function FPC_psabieh_base_of_encoded_value (encoding: byte; context: PFPC_Unwind
             exit(_Unwind_GetRegionStart(context));
           else
             begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
               writeln('Unsupported base of encoding: $', hexstr(encoding,sizeof(encoding)*2));
     {$endif}
               halt(217);
    @@ -332,7 +332,7 @@ function FPC_psabieh_read_encoded_value_with_base (encoding: byte; base: PtrUInt
                 end;
               else
                 begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                   writeln('Unsupported encoding of value with base: $', hexstr(encoding,sizeof(encoding)*2));
     {$endif}
                   halt(217);
    @@ -402,7 +402,7 @@ function FPC_psabieh_parse_lsda_header(context: PFPC_Unwind_Context; p: PByte; o
         inc(p);
         p:=fpc_read_uleb128(p,tmp);
         info.action_table:=p+tmp;
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('lsda header');
         writeln('  * start: $',hexstr(info.start,sizeof(info.start)*2));
         writeln('  * lp_start encoding: $',hexstr(lpstart_encoding,sizeof(lpstart_encoding)*2));
    @@ -566,7 +566,7 @@ function FPC_psabieh_find_action_record(const info: FPC_psabieh_lsda_header_info
             p:=FPC_psabieh_read_encoded_value (nil, info.call_site_encoding, p, cs_lp);
             p:=FPC_read_uleb128 (p, &cs_action);
     
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln('find action record: cs_start: $',hexstr(cs_start,sizeof(cs_start)*2),', len: ',cs_len,
               ' (ip=$',hexstr(info.Start+cs_start,sizeof(PtrUInt)*2),'...$',hexstr(info.Start+cs_start+cs_len,sizeof(PtrUInt)*2),')',
               ', lp: ', cs_lp,' action ofs: ',cs_action);
    @@ -580,7 +580,7 @@ function FPC_psabieh_find_action_record(const info: FPC_psabieh_lsda_header_info
                   landing_pad:=info.LPStart+cs_lp;
                 if cs_action<>0 then
                   action_record:=info.action_table+cs_action-1;
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('action record result: action_record: $',hexstr(cs_start,sizeof(cs_start)*2),', len: ',cs_len,', lp: ', cs_lp,
                   ',landing_pad: $',hexstr(landing_pad,sizeof(landing_pad)*2));
     {$endif}
    @@ -588,7 +588,7 @@ function FPC_psabieh_find_action_record(const info: FPC_psabieh_lsda_header_info
                 exit;
               end;
           end;
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('find action record failed');
     {$endif}
       end;
    @@ -787,7 +787,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
     
         WrappedException:=FPC_psabieh_GetExceptionWrapper(libunwind_exception);
     
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('Personality (version = ',version,', actions = $',hexstr(actions,4),') started for wrapper ',hexstr(WrappedException),' = fpc exc ',hexstr(WrappedException^.FObject),
           ', refcount is now ',WrappedException^.refcount);
         writeln('  ip=$',hexstr(_Unwind_GetIP(context),sizeof(pointer)*2));
    @@ -796,12 +796,12 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
         if (actions=(FPC_UA_CLEANUP_PHASE or FPC_UA_HANDLER_FRAME)) and
            not foreign_exception then
           begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln('restoring caught exception');
     {$endif}
             FPC_psabieh_restore_caught_exception(libunwind_exception,handler_switch_value,
                                      language_specific_data,landing_pad);
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln('restoring caught exception, landing_pad = $',hexstr(landing_pad,sizeof(landing_pad)*2));
     {$endif}
             if landing_pad<>0 then
    @@ -816,7 +816,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
             // If no LSDA, then there are no handlers or cleanups.
             if not assigned(language_specific_data) then
               begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('did not find lsda for ip $',hexstr(_Unwind_GetIP(context),sizeof(pointer)*2));
     {$endif}
     
    @@ -835,7 +835,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
             // Search the call-site table for the action associated with this IP.
             if FPC_psabieh_find_action_record(info,p,ip,landing_pad,action_record) then
               begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('found action record for ip ',hexstr(_Unwind_GetIP(context),sizeof(pointer)*2));
     {$endif}
                 if landing_pad=0 then
    @@ -864,7 +864,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
                 // was not expecting to throw.
                 found_type:=found_terminate;
               end;
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln('find_handler: ',found_type);
     {$endif}
     
    @@ -878,7 +878,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
     
                 if not foreign_exception then
                   begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                     writeln('saving native exception: $',hexstr(landing_pad,sizeof(landing_pad)*2));
     {$endif}
                     // For domestic exceptions, we cache data from phase 1 for phase 2.
    @@ -895,7 +895,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
           begin
             if found_type=found_terminate then
               begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('foreign exception or force unwind, and found type = found terminate; actions = $',hexstr(actions,sizeof(actions)*2),'; foreign exception ', foreign_exception);
     {$endif}
                 RunError(217);
    @@ -903,7 +903,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
             { can only perform cleanups when force-unwinding }
             else if handler_switch_value<0 then
               begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('foreign exception or force unwind, handler_switch_value < 0: ', handler_switch_value);
     {$endif}
                 RunError(217)
    @@ -913,7 +913,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
           begin
             if found_type=found_terminate then
               begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('native exception and no force unwind, and force_terminate');
     {$endif}
                 RunError(217);
    @@ -921,7 +921,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
             else if handler_switch_value<0 then
               begin
                 { C++ calls __cxa_call_unexpected in this case }
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('native exception and no force unwind, and handler_switch_value<0: ', handler_switch_value);
     {$endif}
                 RunError(217);
    @@ -932,7 +932,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
         {$if sizeof(pointer)<>sizeof(SizeInt)}
           {$error Add support for extending pointer values}
         {$endif}
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('returning exception $',hexstr(libunwind_exception),' with switch value ',handler_switch_value);
     {$endif}
         _Unwind_SetGR(context,fpc_eh_return_data_regno(0),PtrUInt(libunwind_exception));
    @@ -957,14 +957,14 @@ procedure FPC_psabieh_ExceptionCleanUp(reason: FPC_Unwind_Reason_Code; exc:PFPC_
         if (reason<>FPC_URC_FOREIGN_EXCEPTION_CAUGHT) and
            (reason<>FPC_URC_NO_REASON) then
           begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln('exception cleanup and reason not foreign exception or no reason, reason = $',hexstr(reason,sizeof(reason)*2));
     {$endif}
             halt(217);
           end;
     
         ExceptWrapper:=FPC_psabieh_GetExceptionWrapper(exc);
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln('exception cleanup: deleting wrapper ',hexstr(ExceptWrapper),' and fpc exception ',hexstr(ExceptWrapper^.FObject));
     {$endif}
         ExceptWrapper^.FObject.free;
    @@ -984,12 +984,12 @@ var
       ExceptWrapper: PExceptObject;
       RaiseResult: FPC_Unwind_Reason_Code;
     begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
       writeln ('In psabieh RaiseException for object ',hexstr(obj),' of class type ',obj.classname);
     {$endif}
       if ExceptTryLevel<>0 then
         begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
           writeln('exception while raising exception, aborting');
     {$endif}
           Halt(217);
    @@ -1001,15 +1001,22 @@ begin
       { if PushExceptObject causes another exception, the following won't be executed,
         causing halt upon entering this routine recursively. }
       ExceptTryLevel:=0;
    +  _ExceptAddrstack:=ExceptAddrStack;
       _ExceptObjectStack:=ExceptObjectStack;
       if (RaiseProc <> nil) and (_ExceptObjectStack <> nil) then
         with _ExceptObjectStack^ do
           RaiseProc(FObject,Addr,FrameCount,Frames);
    +(*  If _ExceptAddrStack=Nil then
    +    DoUnhandledException;*)
       RaiseResult:=_Unwind_RaiseException(@ExceptWrapper^.unwind_exception);
    +  {$ifdef excdebug_psabieh}
    +    writeln('_Unwind_RaiseException returned: ',RaiseResult);
    +  {$endif}
    +(*  case RaiseResult of
    +    5 : If _ExceptAddrStack=Nil then
    +          DoUnhandledException;
    +  end; *)
       // should never return
    -{$ifdef excdebug}
    -  writeln('_Unwind_RaiseException returned: ',RaiseResult);
    -{$endif}
       Halt(217);
     end;
     
    @@ -1023,7 +1030,7 @@ function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; compilerproc
         _ExceptObjectStack : PExceptObject;
         count: longint;
       begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('start begin_catch unwind exception ',hexstr(exc));
     {$endif}
         _ExceptObjectStack:=ExceptObjectStack;
    @@ -1033,7 +1040,7 @@ function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; compilerproc
             // Can't link foreign exceptions with our stack
             if assigned(_ExceptObjectStack) then
               begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('begin catch for nested foreign exception');
     {$endif}
                 halt(217);
    @@ -1068,7 +1075,7 @@ function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; compilerproc
             ExceptObjectStack:=ExceptWrapper;
           end;
     
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('stop begin_catch for wrapper ',hexstr(ExceptWrapper),' = fpc exc ',hexstr(ExceptWrapper^.FObject),', refcount is now ',count);
     {$endif}
         result:= ExceptWrapper^.FObject;
    @@ -1087,7 +1094,7 @@ procedure FPC_psabi_end_catch; cdecl; compilerproc;
         refcount: longint;
       begin
         _ExceptObjectStack:=ExceptObjectStack;
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('start end_catch unwind exception ',hexstr(@_ExceptObjectStack^.unwind_exception));
     {$endif}
         // A rethrow of a foreign exception will be removed from the
    @@ -1110,7 +1117,7 @@ procedure FPC_psabi_end_catch; cdecl; compilerproc;
           end;
     
         refcount:=_ExceptObjectStack^.refcount;
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('middle end_catch for wrapper ',hexstr(_ExceptObjectStack),' = fpc exception ',hexstr(_ExceptObjectStack^.FObject),' with refcount ',refcount);
     {$endif}
         if refcount<0 then
    @@ -1122,7 +1129,7 @@ procedure FPC_psabi_end_catch; cdecl; compilerproc;
         else
           begin
             dec(refcount);
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln('stop end_catch, not rethrown, new refcount: ',refcount);
     {$endif}
             if refcount=0 then
    @@ -1135,7 +1142,7 @@ procedure FPC_psabi_end_catch; cdecl; compilerproc;
             else if refcount<0 then
               begin
                 // A bug in the exception handling library or compiler.
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
                 writeln('refcount for exception is negative in end catch');
     {$endif}
                 RunError(217);
    @@ -1158,7 +1165,7 @@ procedure fpc_ReRaise; [public,alias:'FPC_RERAISE']; compilerproc;
         _ExceptObjectStack:=ExceptObjectStack;
         // globals->uncaughtExceptions += 1;
     
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('start reraise for wrapper ',hexstr(_ExceptObjectStack));
     {$endif}
         // Watch for luser rethrowing with no active exception.
    @@ -1183,7 +1190,7 @@ procedure fpc_ReRaise; [public,alias:'FPC_RERAISE']; compilerproc;
                 _ExceptObjectStack^.refcount := 0;
               end;
     
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('Stop reraise, new refcount = ',_ExceptObjectStack^.refcount);
     {$endif}
     //  #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
    @@ -1213,7 +1220,7 @@ procedure fpc_raise_nested;compilerproc;
         if not(assigned(_ExceptObjectStack)) or
            not(assigned(_ExceptObjectStack^.next)) then
           begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln ('raise_nested: At end of ExceptionObjectStack');
     {$endif}
             halt(1);
    @@ -1221,7 +1228,7 @@ procedure fpc_raise_nested;compilerproc;
     
         if _ExceptObjectStack^.unwind_exception.exception_class<>FPC_psabieh_exceptionClass_ID.u then
           begin
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
             writeln ('raise_nested: top of stack contains foreign exception');
     {$endif}
             halt(1);
    @@ -1229,7 +1236,7 @@ procedure fpc_raise_nested;compilerproc;
     
         hp:=_ExceptObjectStack^.next;
         _ExceptObjectStack^.next:=hp^.next;
    -{$ifdef excdebug}
    +{$ifdef excdebug_psabieh}
         writeln('raise_nested: raising nested wrapper ',hexstr(_ExceptObjectStack),' = fpc exception ',hexstr(_ExceptObjectStack^.FObject),' with refcount ',_ExceptObjectStack^.refcount{,' (will increase to ',_ExceptObjectStack^.refcount+1,')'});
         writeln('raise_nested: previous exception ',hexstr(hp),' = fpc exception ',hexstr(hp^.FObject),' with refcount ',hp^.refcount,' (will delete if refcount = 1, otherwise decrease to',hp^.refcount-1,')');
     {$endif}
    
    psabieh_fix_attempt.diff (14,609 bytes)
  • 1836927209-make_log.txt.zip (30,074 bytes)

Relationships

related to 0035822 new Lazarus Lazarus always creates zero size pascal sources when it tries to get necessary info from the FPC compiler, please correct this. 

Activities

Cyrax

2019-06-22 14:23

reporter   ~0116836

I'm trying to build compiler for i386 target.

Cyrax

2019-06-22 14:34

reporter   ~0116838

No. Summary is wrong now.
It is full i686 linux system (Arch) inside a LXC container.

Cyrax

2019-06-22 14:39

reporter   ~0116839

This is the make command which is used to build the whole thing:

make clean all install OPT=-gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -Xs- -Si- -vbq -Sew- -dEXTDEBUG -vh- -vn- -vw- -dDEBUG_NODE_DUMP -Fl/lib -Fl/usr/lib -Fl/usr/lib/gcc/i686-pc-linux-gnu/8.3.0 -dpsabieh  -dTEST_WIN32_SEH FPC=fpc REVSTR=42267 IDE=1 NOWPOCYCLE=1 INSTALL_PREFIX=/mnt/shares/ohjelmointi2/fpc/i386/trunk/3.3.1/binary/trunk 

Cyrax

2019-06-22 14:41

reporter   ~0116840

Last edited: 2019-06-22 14:42

View 2 revisions

GCC version.

$gcc --version
gcc (GCC) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Cyrax

2019-06-22 15:08

reporter   ~0116841

Last edited: 2019-06-22 15:19

View 3 revisions

Make log from an attempt of build FPC trunk for x86_64-linux.

Building for x86_64-linux target fails at early than building for i386 target.

$ gcc --version
gcc (GCC) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.




x86_64-linux 26573614-make_log.tar.gz (45,504 bytes)

Cyrax

2019-06-22 15:13

reporter   ~0116842

/usr/bin/mv -f x86_64/bin/x86_64-linux/pp ppcx64
make[5]: Leaving directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler'
make echotime
make[5]: Entering directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler'
Start now 15:57:01
make[5]: Leaving directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler'
make[4]: Leaving directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler'
/usr/bin/rm -f ppc2
/usr/bin/mv -f ppcx64 ppc2
make 'FPC=/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler/ppc2' 'OLDFPC=/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler/ppc1' next CYCLELEVEL=3
make[4]: Entering directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler'
Runtime error 217 at $000000000041B502
  $000000000041B502  _FPC_PSABIEH_PERSONALITY_V0,  line 919 of ../inc/psabieh.inc
  $00007FAA9EE0D6D3

make rtlclean
make[5]: Entering directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/compiler'
Runtime error 217 at $000000000041B502
  $000000000041B502  _FPC_PSABIEH_PERSONALITY_V0,  line 919 of ../inc/psabieh.inc
  $00007F4970C626D3

make -C /mnt/shares/ohjelmointi2/fpc/source/git_source/rtl clean
make[6]: Entering directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/rtl'
Runtime error 217 at $000000000041B502
  $000000000041B502  _FPC_PSABIEH_PERSONALITY_V0,  line 919 of ../inc/psabieh.inc
  $00007FA2CE7BA6D3

Cyrax

2019-06-22 15:19

reporter   ~0116843

Here is make log for i386 target.

i386-linux 19226213-make_log.tar.gz (148,371 bytes)

Cyrax

2019-06-22 16:58

reporter   ~0116853

In attached file you will find gdb backtrace at the point where FPC were compiling the pas2jslib package.

ppc386 gdb backtrace.tar.gz (276,824 bytes)

Cyrax

2019-06-25 12:09

reporter   ~0116918

Last edited: 2019-06-25 13:01

View 2 revisions

Attaching log files from another unsuccessful build attempt.

EDIT : FPC trunk r42282.



make log gdb attach log.tar.gz (551,819 bytes)

Cyrax

2019-07-09 14:29

reporter   ~0117122

/usr/bin/ld: /usr/lib/gcc/i686-pc-linux-gnu/8.3.0/crtbegin.o: direct GOT relocation R_386_GOT32X against `_ITM_deregisterTMCloneTable' without base register can not be used when making a shared object
[0.783] Executing "/usr/bin/ld" with command line "-b elf32-i386 -m elf_i386  --verbose -init FPC_SHARED_LIB_START -fini FPC_LIB_EXIT -soname libpas2jslib.so   -shared  -L. -o pas2js/bin/i386-linux/libpas2jslib.so -T pas2js/bin/i386-linux/link.res"
[1.314]/usr/bin/ld: final link failed: nonrepresentable section on output
Runtime error 217 at $08066559
  $08066559  _FPC_PSABIEH_PERSONALITY_V0,  line 919 of ../inc/psabieh.inc
  $F7F73F2C line 64 of /usr/src/debug/gcc/libgcc/unwind.inc

make[2]: *** [Makefile:2499: all] Error 217
make[2]: Leaving directory '/mnt/shares/ohjelmointi2/fpc/source/git_source/utils'
make[1]: *** [Makefile:2679: utils_all] Error 2
make[1]: Leaving directory '/mnt/shares/ohjelmointi2/fpc/source/git_source'
make: *** [Makefile:2884: build-stamp.i386-linux] Error 2


FPC trunk r42344.

Cyrax

2019-07-09 16:43

reporter   ~0117124

Last edited: 2019-07-09 16:58

View 2 revisions

Attached patch which fixes this bug.

EDIT: This patch allows building the FPC suite but it doesn't fix the compiler. Somehow compiler goes stuck when trying to compile totally empty file.



fpmake.pp.patch (676 bytes)
--- a/utils/pas2js/fpmake.pp
+++ b/utils/pas2js/fpmake.pp
@@ -9,7 +9,7 @@
 
 Var
   P : TPackage;
-  PT,T : TTarget;
+  PT,T,TL : TTarget;
 
 begin
   With Installer do
@@ -35,7 +35,10 @@
     P.Dependencies.Add('fcl-web');
     P.Dependencies.Add('webidl');
     PT:=P.Targets.AddProgram('pas2js.pp');
-    PT:=P.Targets.AddLibrary('pas2jslib.pp');
+    TL:=P.Targets.AddLibrary('pas2jslib.pp');
+    {$IF DEFINED(FPC_USE_PSABIEH) AND DEFINED(CPUI386)}
+    TL.Options.Add('-Cg');
+    {$ENDIF DEFINED(FPC_USE_PSABIEH) AND DEFINED(CPUI386)} 
     PT:=P.Targets.AddUnit('dirwatch.pp');
     PT:=P.Targets.AddUnit('httpcompiler.pp');
     PT.Dependencies.AddUnit('dirwatch');

fpmake.pp.patch (676 bytes)

Cyrax

2019-09-13 11:02

reporter   ~0118059

r42977 still fails to build.

Attached log file which shows where build fails.

GNU ld (GNU Binutils) 2.32
gcc (GCC) 9.1.0


make-log.txt.zip (2,242 bytes)

Cyrax

2019-09-13 11:43

reporter   ~0118060

Attached a patch which is an attempt to fix this.

psabieh_fix_attempt.diff (14,609 bytes)
diff --git a/rtl/inc/except.inc b/rtl/inc/except.inc
index c14c702726..8036083496 100644
--- a/rtl/inc/except.inc
+++ b/rtl/inc/except.inc
@@ -26,6 +26,8 @@ Var
   ExceptObjectStack : PExceptObject;
   ExceptTryLevel    : ObjpasInt;
 
+Procedure DoUnHandledException;forward;
+
 {$ifdef FPC_USE_PSABIEH}
 {$i psabieh.inc}
 {$endif}
diff --git a/rtl/inc/psabieh.inc b/rtl/inc/psabieh.inc
index 545ddf8fd4..aa81bcf2f2 100644
--- a/rtl/inc/psabieh.inc
+++ b/rtl/inc/psabieh.inc
@@ -188,7 +188,7 @@ function FPC_psabieh_size_of_encoded_value(encoding: byte): longint;
         exit(8);
       else
         begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
           writeln('Unsupported encoding: $', hexstr(encoding,sizeof(encoding)*2));
 {$endif}
           halt(217);
@@ -220,7 +220,7 @@ function FPC_psabieh_base_of_encoded_value (encoding: byte; context: PFPC_Unwind
         exit(_Unwind_GetRegionStart(context));
       else
         begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
           writeln('Unsupported base of encoding: $', hexstr(encoding,sizeof(encoding)*2));
 {$endif}
           halt(217);
@@ -332,7 +332,7 @@ function FPC_psabieh_read_encoded_value_with_base (encoding: byte; base: PtrUInt
             end;
           else
             begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
               writeln('Unsupported encoding of value with base: $', hexstr(encoding,sizeof(encoding)*2));
 {$endif}
               halt(217);
@@ -402,7 +402,7 @@ function FPC_psabieh_parse_lsda_header(context: PFPC_Unwind_Context; p: PByte; o
     inc(p);
     p:=fpc_read_uleb128(p,tmp);
     info.action_table:=p+tmp;
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('lsda header');
     writeln('  * start: $',hexstr(info.start,sizeof(info.start)*2));
     writeln('  * lp_start encoding: $',hexstr(lpstart_encoding,sizeof(lpstart_encoding)*2));
@@ -566,7 +566,7 @@ function FPC_psabieh_find_action_record(const info: FPC_psabieh_lsda_header_info
         p:=FPC_psabieh_read_encoded_value (nil, info.call_site_encoding, p, cs_lp);
         p:=FPC_read_uleb128 (p, &cs_action);
 
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln('find action record: cs_start: $',hexstr(cs_start,sizeof(cs_start)*2),', len: ',cs_len,
           ' (ip=$',hexstr(info.Start+cs_start,sizeof(PtrUInt)*2),'...$',hexstr(info.Start+cs_start+cs_len,sizeof(PtrUInt)*2),')',
           ', lp: ', cs_lp,' action ofs: ',cs_action);
@@ -580,7 +580,7 @@ function FPC_psabieh_find_action_record(const info: FPC_psabieh_lsda_header_info
               landing_pad:=info.LPStart+cs_lp;
             if cs_action<>0 then
               action_record:=info.action_table+cs_action-1;
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('action record result: action_record: $',hexstr(cs_start,sizeof(cs_start)*2),', len: ',cs_len,', lp: ', cs_lp,
               ',landing_pad: $',hexstr(landing_pad,sizeof(landing_pad)*2));
 {$endif}
@@ -588,7 +588,7 @@ function FPC_psabieh_find_action_record(const info: FPC_psabieh_lsda_header_info
             exit;
           end;
       end;
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('find action record failed');
 {$endif}
   end;
@@ -787,7 +787,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
 
     WrappedException:=FPC_psabieh_GetExceptionWrapper(libunwind_exception);
 
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('Personality (version = ',version,', actions = $',hexstr(actions,4),') started for wrapper ',hexstr(WrappedException),' = fpc exc ',hexstr(WrappedException^.FObject),
       ', refcount is now ',WrappedException^.refcount);
     writeln('  ip=$',hexstr(_Unwind_GetIP(context),sizeof(pointer)*2));
@@ -796,12 +796,12 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
     if (actions=(FPC_UA_CLEANUP_PHASE or FPC_UA_HANDLER_FRAME)) and
        not foreign_exception then
       begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln('restoring caught exception');
 {$endif}
         FPC_psabieh_restore_caught_exception(libunwind_exception,handler_switch_value,
                                  language_specific_data,landing_pad);
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln('restoring caught exception, landing_pad = $',hexstr(landing_pad,sizeof(landing_pad)*2));
 {$endif}
         if landing_pad<>0 then
@@ -816,7 +816,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
         // If no LSDA, then there are no handlers or cleanups.
         if not assigned(language_specific_data) then
           begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('did not find lsda for ip $',hexstr(_Unwind_GetIP(context),sizeof(pointer)*2));
 {$endif}
 
@@ -835,7 +835,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
         // Search the call-site table for the action associated with this IP.
         if FPC_psabieh_find_action_record(info,p,ip,landing_pad,action_record) then
           begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('found action record for ip ',hexstr(_Unwind_GetIP(context),sizeof(pointer)*2));
 {$endif}
             if landing_pad=0 then
@@ -864,7 +864,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
             // was not expecting to throw.
             found_type:=found_terminate;
           end;
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln('find_handler: ',found_type);
 {$endif}
 
@@ -878,7 +878,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
 
             if not foreign_exception then
               begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
                 writeln('saving native exception: $',hexstr(landing_pad,sizeof(landing_pad)*2));
 {$endif}
                 // For domestic exceptions, we cache data from phase 1 for phase 2.
@@ -895,7 +895,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
       begin
         if found_type=found_terminate then
           begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('foreign exception or force unwind, and found type = found terminate; actions = $',hexstr(actions,sizeof(actions)*2),'; foreign exception ', foreign_exception);
 {$endif}
             RunError(217);
@@ -903,7 +903,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
         { can only perform cleanups when force-unwinding }
         else if handler_switch_value<0 then
           begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('foreign exception or force unwind, handler_switch_value < 0: ', handler_switch_value);
 {$endif}
             RunError(217)
@@ -913,7 +913,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
       begin
         if found_type=found_terminate then
           begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('native exception and no force unwind, and force_terminate');
 {$endif}
             RunError(217);
@@ -921,7 +921,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
         else if handler_switch_value<0 then
           begin
             { C++ calls __cxa_call_unexpected in this case }
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('native exception and no force unwind, and handler_switch_value<0: ', handler_switch_value);
 {$endif}
             RunError(217);
@@ -932,7 +932,7 @@ function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Actio
     {$if sizeof(pointer)<>sizeof(SizeInt)}
       {$error Add support for extending pointer values}
     {$endif}
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('returning exception $',hexstr(libunwind_exception),' with switch value ',handler_switch_value);
 {$endif}
     _Unwind_SetGR(context,fpc_eh_return_data_regno(0),PtrUInt(libunwind_exception));
@@ -957,14 +957,14 @@ procedure FPC_psabieh_ExceptionCleanUp(reason: FPC_Unwind_Reason_Code; exc:PFPC_
     if (reason<>FPC_URC_FOREIGN_EXCEPTION_CAUGHT) and
        (reason<>FPC_URC_NO_REASON) then
       begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln('exception cleanup and reason not foreign exception or no reason, reason = $',hexstr(reason,sizeof(reason)*2));
 {$endif}
         halt(217);
       end;
 
     ExceptWrapper:=FPC_psabieh_GetExceptionWrapper(exc);
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln('exception cleanup: deleting wrapper ',hexstr(ExceptWrapper),' and fpc exception ',hexstr(ExceptWrapper^.FObject));
 {$endif}
     ExceptWrapper^.FObject.free;
@@ -984,12 +984,12 @@ var
   ExceptWrapper: PExceptObject;
   RaiseResult: FPC_Unwind_Reason_Code;
 begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
   writeln ('In psabieh RaiseException for object ',hexstr(obj),' of class type ',obj.classname);
 {$endif}
   if ExceptTryLevel<>0 then
     begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
       writeln('exception while raising exception, aborting');
 {$endif}
       Halt(217);
@@ -1001,15 +1001,22 @@ begin
   { if PushExceptObject causes another exception, the following won't be executed,
     causing halt upon entering this routine recursively. }
   ExceptTryLevel:=0;
+  _ExceptAddrstack:=ExceptAddrStack;
   _ExceptObjectStack:=ExceptObjectStack;
   if (RaiseProc <> nil) and (_ExceptObjectStack <> nil) then
     with _ExceptObjectStack^ do
       RaiseProc(FObject,Addr,FrameCount,Frames);
+(*  If _ExceptAddrStack=Nil then
+    DoUnhandledException;*)
   RaiseResult:=_Unwind_RaiseException(@ExceptWrapper^.unwind_exception);
+  {$ifdef excdebug_psabieh}
+    writeln('_Unwind_RaiseException returned: ',RaiseResult);
+  {$endif}
+(*  case RaiseResult of
+    5 : If _ExceptAddrStack=Nil then
+          DoUnhandledException;
+  end; *)
   // should never return
-{$ifdef excdebug}
-  writeln('_Unwind_RaiseException returned: ',RaiseResult);
-{$endif}
   Halt(217);
 end;
 
@@ -1023,7 +1030,7 @@ function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; compilerproc
     _ExceptObjectStack : PExceptObject;
     count: longint;
   begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('start begin_catch unwind exception ',hexstr(exc));
 {$endif}
     _ExceptObjectStack:=ExceptObjectStack;
@@ -1033,7 +1040,7 @@ function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; compilerproc
         // Can't link foreign exceptions with our stack
         if assigned(_ExceptObjectStack) then
           begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('begin catch for nested foreign exception');
 {$endif}
             halt(217);
@@ -1068,7 +1075,7 @@ function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; compilerproc
         ExceptObjectStack:=ExceptWrapper;
       end;
 
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('stop begin_catch for wrapper ',hexstr(ExceptWrapper),' = fpc exc ',hexstr(ExceptWrapper^.FObject),', refcount is now ',count);
 {$endif}
     result:= ExceptWrapper^.FObject;
@@ -1087,7 +1094,7 @@ procedure FPC_psabi_end_catch; cdecl; compilerproc;
     refcount: longint;
   begin
     _ExceptObjectStack:=ExceptObjectStack;
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('start end_catch unwind exception ',hexstr(@_ExceptObjectStack^.unwind_exception));
 {$endif}
     // A rethrow of a foreign exception will be removed from the
@@ -1110,7 +1117,7 @@ procedure FPC_psabi_end_catch; cdecl; compilerproc;
       end;
 
     refcount:=_ExceptObjectStack^.refcount;
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('middle end_catch for wrapper ',hexstr(_ExceptObjectStack),' = fpc exception ',hexstr(_ExceptObjectStack^.FObject),' with refcount ',refcount);
 {$endif}
     if refcount<0 then
@@ -1122,7 +1129,7 @@ procedure FPC_psabi_end_catch; cdecl; compilerproc;
     else
       begin
         dec(refcount);
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln('stop end_catch, not rethrown, new refcount: ',refcount);
 {$endif}
         if refcount=0 then
@@ -1135,7 +1142,7 @@ procedure FPC_psabi_end_catch; cdecl; compilerproc;
         else if refcount<0 then
           begin
             // A bug in the exception handling library or compiler.
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
             writeln('refcount for exception is negative in end catch');
 {$endif}
             RunError(217);
@@ -1158,7 +1165,7 @@ procedure fpc_ReRaise; [public,alias:'FPC_RERAISE']; compilerproc;
     _ExceptObjectStack:=ExceptObjectStack;
     // globals->uncaughtExceptions += 1;
 
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('start reraise for wrapper ',hexstr(_ExceptObjectStack));
 {$endif}
     // Watch for luser rethrowing with no active exception.
@@ -1183,7 +1190,7 @@ procedure fpc_ReRaise; [public,alias:'FPC_RERAISE']; compilerproc;
             _ExceptObjectStack^.refcount := 0;
           end;
 
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('Stop reraise, new refcount = ',_ExceptObjectStack^.refcount);
 {$endif}
 //  #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
@@ -1213,7 +1220,7 @@ procedure fpc_raise_nested;compilerproc;
     if not(assigned(_ExceptObjectStack)) or
        not(assigned(_ExceptObjectStack^.next)) then
       begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln ('raise_nested: At end of ExceptionObjectStack');
 {$endif}
         halt(1);
@@ -1221,7 +1228,7 @@ procedure fpc_raise_nested;compilerproc;
 
     if _ExceptObjectStack^.unwind_exception.exception_class<>FPC_psabieh_exceptionClass_ID.u then
       begin
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
         writeln ('raise_nested: top of stack contains foreign exception');
 {$endif}
         halt(1);
@@ -1229,7 +1236,7 @@ procedure fpc_raise_nested;compilerproc;
 
     hp:=_ExceptObjectStack^.next;
     _ExceptObjectStack^.next:=hp^.next;
-{$ifdef excdebug}
+{$ifdef excdebug_psabieh}
     writeln('raise_nested: raising nested wrapper ',hexstr(_ExceptObjectStack),' = fpc exception ',hexstr(_ExceptObjectStack^.FObject),' with refcount ',_ExceptObjectStack^.refcount{,' (will increase to ',_ExceptObjectStack^.refcount+1,')'});
     writeln('raise_nested: previous exception ',hexstr(hp),' = fpc exception ',hexstr(hp^.FObject),' with refcount ',hp^.refcount,' (will delete if refcount = 1, otherwise decrease to',hp^.refcount-1,')');
 {$endif}
psabieh_fix_attempt.diff (14,609 bytes)

Jonas Maebe

2019-09-14 19:32

manager   ~0118080

I've replaced most calls to halt(217) with calls to DoUnhandledException, since that was indeed wrong, but I'm not sure how that will solve your issue (I only use the psabieh code with LLVM on macOS/x86-64).

Cyrax

2019-10-12 05:24

reporter   ~0118502

Last edited: 2019-10-12 09:33

View 2 revisions

FPC trunk r43166 fails to build. Attaching a make log.

EDIT: Doh. Disabling the debug output from psabieh units helped. Trunk builds succesfully.



1836927209-make_log.txt.zip (30,074 bytes)

Jonas Maebe

2019-10-13 13:14

manager   ~0118560

Thanks for the repeated testing.

Issue History

Date Modified Username Field Change
2019-06-22 14:22 Cyrax New Issue
2019-06-22 14:23 Cyrax Note Added: 0116836
2019-06-22 14:29 Jonas Maebe Summary Building FPC trunk compiler suite stops at pas2jslib package and after while gives "Runtime error 217" exception. => make all fails when building from Linux/x86-64 to Linux/i386 with psabieh
2019-06-22 14:29 Jonas Maebe FPCTarget => -
2019-06-22 14:34 Cyrax Note Added: 0116838
2019-06-22 14:39 Cyrax Note Added: 0116839
2019-06-22 14:41 Cyrax Note Added: 0116840
2019-06-22 14:42 Cyrax Note Edited: 0116840 View Revisions
2019-06-22 15:06 Jonas Maebe Summary make all fails when building from Linux/x86-64 to Linux/i386 with psabieh => make all fails when building Linux/i386 with psabieh
2019-06-22 15:08 Cyrax File Added: x86_64-linux 26573614-make_log.tar.gz
2019-06-22 15:08 Cyrax Note Added: 0116841
2019-06-22 15:09 Cyrax Note Edited: 0116841 View Revisions
2019-06-22 15:13 Cyrax Note Added: 0116842
2019-06-22 15:19 Cyrax Note Edited: 0116841 View Revisions
2019-06-22 15:19 Cyrax File Added: i386-linux 19226213-make_log.tar.gz
2019-06-22 15:19 Cyrax Note Added: 0116843
2019-06-22 16:58 Cyrax File Added: ppc386 gdb backtrace.tar.gz
2019-06-22 16:58 Cyrax Note Added: 0116853
2019-06-25 12:09 Cyrax File Added: make log gdb attach log.tar.gz
2019-06-25 12:09 Cyrax Note Added: 0116918
2019-06-25 13:01 Cyrax Note Edited: 0116918 View Revisions
2019-07-09 14:29 Cyrax Note Added: 0117122
2019-07-09 16:43 Cyrax File Added: fpmake.pp.patch
2019-07-09 16:43 Cyrax Note Added: 0117124
2019-07-09 16:58 Cyrax Note Edited: 0117124 View Revisions
2019-07-11 21:28 Juha Manninen Relationship added related to 0035822
2019-09-13 11:02 Cyrax File Added: make-log.txt.zip
2019-09-13 11:02 Cyrax Note Added: 0118059
2019-09-13 11:43 Cyrax File Added: psabieh_fix_attempt.diff
2019-09-13 11:43 Cyrax Note Added: 0118060
2019-09-14 19:32 Jonas Maebe Note Added: 0118080
2019-10-12 05:24 Cyrax File Added: 1836927209-make_log.txt.zip
2019-10-12 05:24 Cyrax Note Added: 0118502
2019-10-12 09:33 Cyrax Note Edited: 0118502 View Revisions
2019-10-13 13:14 Jonas Maebe Assigned To => Jonas Maebe
2019-10-13 13:14 Jonas Maebe Status new => resolved
2019-10-13 13:14 Jonas Maebe Resolution open => fixed
2019-10-13 13:14 Jonas Maebe Note Added: 0118560