fpc: Recent management operator changes read to i386-linux compiler crash on freeing operators
Original Reporter info from Mantis: AntonK
-
Reporter name: Anton Kavalenka
Original Reporter info from Mantis: AntonK
- Reporter name: Anton Kavalenka
Description:
Crash occurs only on rebuild (-B) of one specific project at compiler cleanup
Error: Compilation raised exception internally
Fatal: Compilation aborted
An unhandled exception occurred at $00000000:
EAccessViolation: Access violation<br/>
$00000000
$081CDAF7
$08069534
Stacktrace as follows:
#0 ?? at :0
#1 SYSTEM$_$TOBJECT_$__$$_FREE at :0
#2 TABSTRACTRECORDSYMTABLE__DESTROY(<incomplete type>, 0xb6614360) at symtable.pas:1192
#3 SYSTEM$_$TOBJECT_$__$$_FREE at :0
#4 TRECORDDEF__DESTROY(<incomplete type>, 0xb704d920) at symdef.pas:4607
#5 SYSTEM$_$TOBJECT_$__$$_FREE at :0
#6 TFPOBJECTLIST__CLEAR(0xb675c4a0) at cclasses.pas:1045
#7 TSYMTABLE__CLEAR(0xb6833e60) at symbase.pas:306
#8 TSYMTABLE__DESTROY(<incomplete type>, 0xb6833e60) at symbase.pas:244
#9 SYSTEM$_$TOBJECT_$__$$_FREE at :0
#10 TMODULE__DESTROY(<incomplete type>, 0xb7f08460) at fmodule.pas:727
#11 TPPUMODULE__DESTROY(<incomplete type>, 0xb7f08460) at fppu.pas:165
#12 SYSTEM$_$TOBJECT_$__$$_FREE at :0
#13 PROC_PROGRAM(true) at pmodules.pas:2430
#14 COMPILE('crl4000m.dpr') at parser.pas:393
#15 COMPILE(0x0) at compiler.pas:278
#16 main at pp.pas:263
Tracing shows that AV occurs on freeing of INITIALIZE management operator of one specific packed record.
TStaticTemp=array[0..4] of word; // Tinj, 0,0,0, Tdet
TStaticGas=array[0..7] of word; // G1,G2,G3,0,0,0,H2,Air
Tm0Buf=packed record
wPad:word; // 02 00?
wGas:TStaticGas;
bPad5:array[0..4] of byte; // 5-byte pad?
// 19-word block
press:TPressBlock;
wUnk4:word; // 00 64 ?
wPad8:array[0..7] of word; // zeroes
// end 19-word block
blk:TBlocking;
bFlags:TFlags64; // 64 64
bFlag:byte; // 19
wPad1:word; // 01 00
rProg:TRampProg;
wTemps:TStaticTemp;
wPad5:array[0..4] of word;
wUnk1:word; // 08 1C
wPad9:array[0..8] of word;
bPad2:byte;
end;
a unit with records linked to simple project and even record allocation does not produce error.
Steps to reproduce:
I will try to minimize project.
Additional information:
x86_64-linux is not affected
Also - is not the management operator freeing should look like this?
symtable:1186
for mop in tmanagementoperator do
begin
if assigned(mop_list[mop]) then
begin
for i:=0 to mop_list[mop].count-1 do
dispose(pmanagementoperator_offset_entry(mop_list[mop][i]));
->>>> mop_list[mop].free;
end;
end;
inherited destroy;
Mantis conversion info:
- Mantis ID: 34210
- Version: 3.1.1
- Fixed in version: 3.3.1
- Fixed in revision: 39693 (#072699d3)
- Monitored by: » Vincent (Vincent Snijders)