Sign in Join

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

Mailing lists / fpc-devel / 2026-03

Exception handling failure

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Adriaan van Os

I see that fpc source commit 4921be35
https://gitlab.com/freepascal.org/fpc/source/-/commit/4921be352392c32c401dd689de50980fdaa7b578 adds "some exception related tests that currently fail on aarch64-win64". I see no committed fixes in the history after that. My 3.3.1 compiler was built from the jan 10 sources (as a more recent revision failed to bootstrap). This 3.3.1 compiler fails a simple exception handling test on macOS, which previous compilers did handle.

[Mac-mini:~/fpc-test/simple-crashme] administrator% cat crashme2.pas

{$modeswitch exceptions}
program crashme2;
type
   pinteger = ^integer;
var
   p: pinteger;
begin
   try
     p := pinteger( 1234);
     p^ := 1
   except
     writeln
       ( 'the exception was catched')
   end

[Mac-mini:~/fpc-test/simple-crashme] administrator% /usr/local/lib/fpc/3.3.1/ppca64 crashme2.pas Free Pascal Compiler version 3.3.1 [2026/01/10] for aarch64 Copyright (c) 1993-2026 by Florian Klaempfl and others Target OS: Darwin for AArch64
Compiling crashme2.pas
Assembling (pipe) crashme2.s
Linking crashme2
-macosx_version_min has been renamed to -macos_version_min 16 lines compiled, 0.4 sec, 180224 bytes code, 98303 bytes data

[Mac-mini:~/fpc-test/simple-crashme] administrator% ./crashme2 Runtime error 216 at $0000000104EC36A8
$0000000104EC36A8
$0000000104EEB4CC
$0000000104EC35E0
$0000000104EC3638
$00000001820C7154
$4E35800000000000

[Mac-mini:~/fpc-test/simple-crashme] administrator% /usr/local/lib/fpc/3.2.4/ppca64 crashme2.pas Free Pascal Compiler version 3.2.4-rc1 [2025/10/15] for aarch64 Copyright (c) 1993-2024 by Florian Klaempfl and others Target OS: Darwin for AArch64
Compiling crashme2.pas
Assembling crashme2
Linking crashme2
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min 16 lines compiled, 0.1 sec

[Mac-mini:~/fpc-test/simple-crashme] administrator% ./crashme2 the exception was catched

[Mac-mini:~/fpc-test/simple-crashme] administrator% /usr/local/lib/fpc/3.0.4/ppcx64 crashme2.pas Free Pascal Compiler version 3.0.4 [2017/11/26] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others Target OS: Darwin for x86_64
Compiling crashme2.pas
Assembling (pipe) crashme2.s
Linking crashme2
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min ld: warning: support for macOS with 10.5 minimum deployment target is deprecated and will be removed in future release
ld: warning: building for macOS 10.5 is deprecated 16 lines compiled, 0.2 sec

[Mac-mini:~/fpc-test/simple-crashme] administrator% ./crashme2 the exception was catched

[Mac-mini:~] administrator% sw_vers
ProductName: macOS
ProductVersion: 14.7.4
BuildVersion: 23H420

Reply by email

Sven Barth
to Adriaan van Os

Adriaan van Os via fpc-devel schrieb am
Do., 12. März 2026, 10:26:

Show quoted text 8 lines
I see that fpc source commit 4921be35 https://gitlab.com/freepascal.org/fpc/source/-/commit/4921be352392c32c401dd689de50980fdaa7b578 adds "some exception related tests that currently fail on aarch64-win64". I see no committed fixes in the history after that.

Because I haven't yet found the time to merge the corresponding merge request.

My 3.3.1 compiler was built from the jan 10 sources (as a more recent

revision failed to bootstrap). This 3.3.1 compiler fails a simple exception handling test on macOS, which previous compilers did handle.

Then report it.

Regards,
Sven

Reply by email

Adriaan van Os
to Sven Barth
Sven Barth wrote 23 lines
Adriaan van Os via fpc-devel < > schrieb am Do., 12. März 2026, 10:26: I see that fpc source commit 4921be35 https://gitlab.com/freepascal.org/fpc/source/-/commit/4921be352392c32c401dd689de50980fdaa7b578 adds "some exception related tests that currently fail on aarch64-win64". I see no committed fixes in the history after that. Because I haven't yet found the time to merge the corresponding merge request. My 3.3.1 compiler was built from the jan 10 sources (as a more recent revision failed to bootstrap). This 3.3.1 compiler fails a simple exception handling test on macOS, which previous compilers did handle. Then report it.

I see an (overcomplicated) gitlab "work items list" but no way to report a bug there .... There is no add button (that I know of).

Bugzilla was perfect.

Regards,

Adriaan van Os

Reply by email

Marco van de Voort
to Adriaan van Os

Op 12-3-2026 om 12:16 schreef Adriaan van Os via fpc-devel:

I see an (overcomplicated) gitlab "work items list" but no way to report a bug there .... There is no add button (that I know of).

Top right in blue "New Item".   I have dark mode enabled though, so the color might be difference

It might also only appear when you are logged in.

Reply by email

Adriaan van Os
to Adriaan van Os: I see that fpc source commit 4921be35 https://gitlab.com/freepascal.org/fpc/source/-/commi…
Adriaan van Os wrote 88 lines
I see that fpc source commit 4921be35 https://gitlab.com/freepascal.org/fpc/source/-/commit/4921be352392c32c401dd689de50980fdaa7b578 adds "some exception related tests that currently fail on aarch64-win64". I see no committed fixes in the history after that. My 3.3.1 compiler was built from the jan 10 sources (as a more recent revision failed to bootstrap). This 3.3.1 compiler fails a simple exception handling test on macOS, which previous compilers did handle. [Mac-mini:~/fpc-test/simple-crashme] administrator% cat crashme2.pas {$modeswitch exceptions} program crashme2; type pinteger = ^integer; var p: pinteger; begin try p := pinteger( 1234); p^ := 1 except writeln ( 'the exception was catched') end [Mac-mini:~/fpc-test/simple-crashme] administrator% /usr/local/lib/fpc/3.3.1/ppca64 crashme2.pas Free Pascal Compiler version 3.3.1 [2026/01/10] for aarch64 Copyright (c) 1993-2026 by Florian Klaempfl and others Target OS: Darwin for AArch64 Compiling crashme2.pas Assembling (pipe) crashme2.s Linking crashme2 -macosx_version_min has been renamed to -macos_version_min 16 lines compiled, 0.4 sec, 180224 bytes code, 98303 bytes data [Mac-mini:~/fpc-test/simple-crashme] administrator% ./crashme2 Runtime error 216 at $0000000104EC36A8 $0000000104EC36A8 $0000000104EEB4CC $0000000104EC35E0 $0000000104EC3638 $00000001820C7154 $4E35800000000000 [Mac-mini:~/fpc-test/simple-crashme] administrator% /usr/local/lib/fpc/3.2.4/ppca64 crashme2.pas Free Pascal Compiler version 3.2.4-rc1 [2025/10/15] for aarch64 Copyright (c) 1993-2024 by Florian Klaempfl and others Target OS: Darwin for AArch64 Compiling crashme2.pas Assembling crashme2 Linking crashme2 ld: warning: -multiply_defined is obsolete -macosx_version_min has been renamed to -macos_version_min 16 lines compiled, 0.1 sec [Mac-mini:~/fpc-test/simple-crashme] administrator% ./crashme2 the exception was catched [Mac-mini:~/fpc-test/simple-crashme] administrator% /usr/local/lib/fpc/3.0.4/ppcx64 crashme2.pas Free Pascal Compiler version 3.0.4 [2017/11/26] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others Target OS: Darwin for x86_64 Compiling crashme2.pas Assembling (pipe) crashme2.s Linking crashme2 ld: warning: -multiply_defined is obsolete -macosx_version_min has been renamed to -macos_version_min ld: warning: support for macOS with 10.5 minimum deployment target is deprecated and will be removed in future release ld: warning: building for macOS 10.5 is deprecated 16 lines compiled, 0.2 sec [Mac-mini:~/fpc-test/simple-crashme] administrator% ./crashme2 the exception was catched [Mac-mini:~] administrator% sw_vers ProductName: macOS ProductVersion: 14.7.4 BuildVersion: 23H420

I found the cause to be in this crazy compiler commit https://gitlab.com/freepascal.org/fpc/source/-/work_items/38201which says that "If SysUtils is not included, run-time error should be raised regardless from the try..except block."

Regards,

Adriaan van Os

Reply by email