Well.
I thoroughly tested it and here it does not crash. It only crashes if you are not running as root or sudo. Maybe a dependency is missing on your computer?
Or a raspi-config setting?
To obtain version 3.0.4 there are three options:
1. add stretch-backports to /etc/apt/sources.list. FPC 3.0.4 and Lazarus 1.8.4. are both in stretch-backports. You can subsequently install them with apt or apt-get
You need to install with the -t option. See
https://backports.debian.org/Instructions/2. use fpcdeluxe
3. build from source. Here's how I do that.
step 0. sudo apt-get update && sudo apt-get dist-upgrade -y If you haven't done that for a long time.
step 1. check out the sources for fixes-3.0.4 or 3.1.1 trunk for fpc from svn
step 2. rename or copy the executable (not the symlink ) ppcarm to
fpcstart and move it to your home directory.
If /usr/local/bin/ppcarm is a symlink, the binary is here: /usr/local/lib/fpc/3.0.2/ppcarm or here /usr/lib/fpc/3.0.2/ppcarm
step 3. sudo apt-get remove fpc
step 4. change to the directory where you checked out the sources, probably /home/pi/fpc
step 5. sudo make clean all install PP=/home/pi/fpcstart
step 6. sudo cp /usr/local/lib/fpc/3.0.4/ppcarm /usr/local/bin. use 3.1.1 instead of 3.0.4. if you use trunk.
step 7. type
fpc -v in a terminal window. It should give you the new version.
step 8. sudo apt-get remove lazarus
step 9. check out the lazarus sources from git either 1.8.4 or trunk
step 10. goto the lazarus source directory
step 11. make clean all install
step 12. type ./startlazarus