Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2017-03

Error: Data element too large / Compilation aborted .. unhandled exception .. AV

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Hans-Peter Suter

Goedenavond,

The following snippet gives the above mentioned error message on Mac (Yosem.) and aborts the compilation process on Ubuntu (14.04). I'm using version 3.0.2 [2017/02/12] for i386 and 3.0.2 [2017/02/25] for x86_64. There are several variants (mentioned in code) which influence the outcome. Code is from a low-level header file which I likely won't ever need but I thought it might be of interest nevertheless.

Hans-Peter

PS: in case this should go to Tracker/Mantis? could this do someone, maybe? (otherwise let me know, thanks).

```pascal (file saved as a.pas)
{$MODE DELPHI}  // (1) _NOT_ using delphi mode works
unit a;
{==============================================================================}
interface
type
  pSExp = pointer;
  aSExpArr = array[0..((MaxInt div SizeOf(pSExp)) - 1)] of pSExp;
  // aSExpArr = array[0..((MaxInt div 2*SizeOf(pSExp)) - 1)] of pSExp;
  // (2) using a _shorter_ array, eg. ^^ works on Ubuntu (Mac still Error)
  pFoo = ^aFoo;
  aFoo = record
    rec: aSExpArr;
  end;
function ahoppla(_x: pFoo): aSExpArr;
{==============================================================================}
implementation
type
  pData = ^aData;
  aData = record
    offset: array[1..24] of byte;  // (3) uncommenting offset works
    SExpArr: aSExpArr;
  end;
function ahoppla(_x: pFoo): aSExpArr;
  begin
    ahoppla:= pData(_x)^.SExpArr;
    // ahoppla:= _x.rec;           // (4) _not_ casting works on Ubuntu
(Mac error)
  end;

end {a}.
```

Reply by email

Florian Klämpfl
to Hans-Peter Suter
Hans-Peter Suter wrote
Goedenavond, The following snippet gives the above mentioned error message

The error message for a 32 bit target is correct, the data structure is too big.

on Mac (Yosem.) and aborts the compilation process on Ubuntu (14.04).

Indeed, the compiler crashed for 64 bit targets, fixed.

Reply by email