Jump to content
dmitrybv

Runtime error 217 when launching Delphi FMX Linux 64-bit application (RAD Studio 12, Ubuntu 22.04)

Recommended Posts

I’m having trouble running my Delphi FMX application on Linux 64-bit (Ubuntu 22.04.4 LTS, FmxLinux 1.78).

  • The application runs fine on Win32, Win64, Android-64, macOS-64.

  • On Linux 64-bit, when I try to start it in debug mode, the IDE immediately stops execution without showing any error. PAServer doesn’t print anything either.

  • A simple test app (just one form with a button) runs without issues on Linux.

  • My real project has several dozen forms. When I run it in debug mode in Embarcadero RAD Studio 12 (Version 29.0.55362.2017), the debugger just stops with no messages.

  • If I try “Run without debugging”, PAServer prints:

    Runtime error 217 at 00000000012AFEFC 

According to ChatGPT, this usually means the crash happens inside the initialization section of one of the units included in the project’s uses.

👉 My question: What’s the best way to identify which unit or initialization block is causing the crash on Linux, and how can I debug this further?

Share this post


Link to post

If I place a breakpoint in the initialization section of the very first unit in my project, the debugger hangs when exiting the method

procedure System.StartUpCopy.CopyStartUpFiles;

 

image.thumb.png.37a1197564e3bde0402432a7bdefce70.png

Share this post


Link to post

I had the same runtime error when working on a new project tested with Delphi 12 and Delphi 13 and for me it ended up being a Linux dependency that was missing.

 

The following script helped me (thanks to ChatGPT), giving enough feedback on the startup to help track down which dependencies to focus on. For me it was one of the PostgreSQL dependencies. It was running the binary from the scratch directory where PAServer deployed it rather than directly through PAServer. 

 

#!/bin/bash

# Set library path for client libraries
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH

# Load environment variables from .env
set -a
source .env
set +a

echo "=== Running with strace to trace system calls ==="
echo "Looking for library loading failures..."
echo ""

# Run with strace to see what files/libraries it's trying to open (using Delphi project name of LinuxServer)
strace -e openat,open,access,stat -f ./LinuxServer 2>&1 | grep -E "(libpq|\.so|\.conf|ENOENT)" | head -100

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×