ppcx64 crashes when compiling hedgewars
Original Reporter info from Mantis: jwrdegoede
-
Reporter name: Hans de Goede
Original Reporter info from Mantis: jwrdegoede
- Reporter name: Hans de Goede
Description:
Short intro: I'm a Fedora developer/packager, as such I maintain the Fedora packages for hedgewars:
http://www.hedgewars.org/
A free game written in pascal.
Recently I received a bugreport that hedgewars does not properly rebuild from source using the Fedora hedgewars sources:
https://bugzilla.redhat.com/show_bug.cgi?id=449649
I've investigated this, and it turns out that on x86_64 fpc (actually ppcx64) crashes when compiling hedgewars. Unfortunately this only happens sometimes, so it could be caused by something like using uninitialized memory, or be memory layout dependant (memory layout changes each run under Fedora, as we do memory address randomalization as a security measure).
I've installed the debuginfo of fpc, and run the crashing fpc command under gdb, with follow fork activated so it also debugged the spawn ppcx64 project this gave me the following backtrace in gdb:
Additional information:
#0 0x00000000004aa646 in GET_ALIAS (GET_ALIAS=65, N=4447, self=0x500d1f0)
at rgobj.pas:950
#1 0x000000000055fbfb in DO_SPILL_REPLACE (DO_SPILL_REPLACE=false,
LIST=0x7fd5116d46f0, INSTR=0x7fd5115d3cb0, ORGREG=65, SPILLTEMP=
{OFFSET = -312, SYMBOL = 0x0, RELSYMBOL = 0x0, SEGMENT = 0, BASE = 17104902, INDEX = 0, REFADDR = ADDR_NO, SCALEFACTOR = 0, ALIGNMENT = 0},
self=0x500d1f0) at x86/rgx86.pas:138
#2 0x00000000004acf6d in INSTR_SPILL_REGISTER (INSTR_SPILL_REGISTER=false,
LIST=0x7fd5116d46f0, INSTR=0x7fd5115d3cb0, R=@0x7fff196f5770,
SPILLTEMPLIST=@0x50235f0, self=0x500d1f0) at rgobj.pas:1928
#3 0x00000000004acacf in SPILL_REGISTERS (SPILL_REGISTERS=true,
LIST=0x7fd5116d46f0, HEADERTAI=0x7fd5115aac70, self=0x500d1f0)
at rgobj.pas:1768
#4 0x00000000004a9859 in DO_REGISTER_ALLOCATION (LIST=0x7fd5116d46f0,
HEADERTAI=0x7fd5115aac70, self=0x500d1f0) at rgobj.pas:561
#5 0x000000000049d82d in DO_REGISTER_ALLOCATION (LIST=0x7fd5116d46f0,
HEADERTAI=0x7fd5115aac70, self=0x170150) at cgobj.pas:764
#6 0x0000000000523dc2 in GENERATE_CODE (self=0x11318f0) at psub.pas:960
#7 0x0000000000524ee6 in DO_GENERATE_CODE (PI=0x11318f0,
parentfp=0x7fff196f7c40) at psub.pas:1318
#8 0x0000000000524e08 in READ_PROC_BODY (OLD_CURRENT_PROCINFO=0x7c14170,
PD=0x128be30) at psub.pas:1393
#9 0x00000000005252e5 in READ_PROC () at psub.pas:1534
#10 0x000000000052573c in READ_DECLARATIONS (ISLIBRARY=false) at psub.pas:1622
#11 0x0000000000521751 in BLOCK (BLOCK=0x0, ISLIBRARY=false) at psub.pas:167
#12 0x00000000005246fa in PARSE_BODY (self=0x7c14170) at psub.pas:1203
#13 0x000000000051fdc2 in PROC_UNIT () at pmodules.pas:1018
#14 0x00000000004ff687 in COMPILE (FILENAME=@0x7bc290) at parser.pas:386
#15 0x0000000000510f65 in LOADPPU (self=0x8a0430) at fppu.pas:1474
#16 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#17 0x000000000051f918 in PROC_UNIT () at pmodules.pas:915
#18 0x00000000004ff687 in COMPILE (FILENAME=@0x7bd030) at parser.pas:386
#19 0x0000000000510f65 in LOADPPU (self=0x8a0c30) at fppu.pas:1474
#20 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#21 0x000000000051ee16 in PARSE_IMPLEMENTATION_USES () at pmodules.pas:700
#22 0x000000000051fc26 in PROC_UNIT () at pmodules.pas:994
#23 0x00000000004ff687 in COMPILE (FILENAME=@0x7bccb0) at parser.pas:386
#24 0x0000000000510f65 in LOADPPU (self=0x8a0a30) at fppu.pas:1474
#25 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#26 0x000000000051f918 in PROC_UNIT () at pmodules.pas:915
#27 0x00000000004ff687 in COMPILE (FILENAME=@0x7bd030) at parser.pas:386
#28 0x0000000000510f65 in LOADPPU (self=0x8a0c30) at fppu.pas:1474
#29 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#30 0x000000000051f918 in PROC_UNIT () at pmodules.pas:915
#31 0x00000000004ff687 in COMPILE (FILENAME=@0x7bb810) at parser.pas:386
#32 0x0000000000510f65 in LOADPPU (self=0x755c30) at fppu.pas:1474
#33 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#34 0x000000000051ee16 in PARSE_IMPLEMENTATION_USES () at pmodules.pas:700
#35 0x000000000051fc26 in PROC_UNIT () at pmodules.pas:994
#36 0x00000000004ff687 in COMPILE (FILENAME=@0x7bc8d0) at parser.pas:386
#37 0x0000000000510f65 in LOADPPU (self=0x8a0830) at fppu.pas:1474
#38 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#39 0x000000000051ee16 in PARSE_IMPLEMENTATION_USES () at pmodules.pas:700
#40 0x000000000051fc26 in PROC_UNIT () at pmodules.pas:994
#41 0x00000000004ff687 in COMPILE (FILENAME=@0x7bb490) at parser.pas:386
#42 0x0000000000510f65 in LOADPPU (self=0x755a30) at fppu.pas:1474
#43 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#44 0x000000000051ee16 in PARSE_IMPLEMENTATION_USES () at pmodules.pas:700
#45 0x000000000051fc26 in PROC_UNIT () at pmodules.pas:994
#46 0x00000000004ff687 in COMPILE (FILENAME=@0x8ba270) at parser.pas:386
#47 0x0000000000510f65 in LOADPPU (self=0x8a2a30) at fppu.pas:1474
#48 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#49 0x000000000051f918 in PROC_UNIT () at pmodules.pas:915
#50 0x00000000004ff687 in COMPILE (FILENAME=@0x7bb490) at parser.pas:386
#51 0x0000000000510f65 in LOADPPU (self=0x755a30) at fppu.pas:1474
#52 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#53 0x000000000051ee16 in PARSE_IMPLEMENTATION_USES () at pmodules.pas:700
#54 0x000000000051fc26 in PROC_UNIT () at pmodules.pas:994
#55 0x00000000004ff687 in COMPILE (FILENAME=@0x8b97f0) at parser.pas:386
#56 0x0000000000510f65 in LOADPPU (self=0x8a2430) at fppu.pas:1474
#57 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#58 0x000000000051f918 in PROC_UNIT () at pmodules.pas:915
#59 0x00000000004ff687 in COMPILE (FILENAME=@0x7bad90) at parser.pas:386
#60 0x0000000000510f65 in LOADPPU (self=0x755630) at fppu.pas:1474
#61 0x000000000051eaa4 in LOADUNITS () at pmodules.pas:612
#62 0x00000000005209dd in PROC_PROGRAM (ISLIBRARY=false) at pmodules.pas:1294
#63 0x00000000004ff69d in COMPILE (FILENAME=@0x7fff196ff460) at parser.pas:389
#64 0x00000000004231c5 in COMPILE (COMPILE=32767, CMD=@0x7d5d20)
at compiler.pas:248
#65 0x0000000000400442 in main () at pp.pas:207
The error + dump shown by fpc itself is:
Fatal: Compilation aborted
An unhandled exception occurred at $00000000004AA646 :
EAccessViolation : Access violation
$00000000004AA646
$00000000004ACF6D
$00000000004ACACF
$00000000004A9859
$0000000000524EE6
$00000000005252E5
$0000000000521751
$00000000005246FA
$00000000004FF687
$0000000000510F65
$000000000051F918
$00000000004FF687
$0000000000510F65
$000000000051EE16
$00000000004FF687
$0000000000510F65
$000000000051F918
Mantis conversion info:
- Mantis ID: 11469
- Version: 2.2.0
- Fixed in version: 2.2.2