Runtime error 216 when lunching project1 on FreeBSD lazarus / 3-General ---------------------------------------------------------------------- flax57 · 2021-01-23 23:34 Hi all i have installed FreeBSD compiler with fpcupdeluxe (without any errors) but when compiling to x86_64 (amd64) and then lunching executable file on FreeBSD 12.2 amd64 machine i get error message : Runtime error 216 at $00000000004124AC   $00000000004124AC (when i test very simple program:  writeln('hello word'); i get the same Runtime error , i have reinstall the compiler x86_64 FREEBSD but shows the same error) (and when i compile for FreeBSD i386(32bit cpu) the executable file works fine on FreeBSD 12.2 amd64 machine) i think this is a bug on compiler for FreeBSD (x86_64 target cpu) i uses fpc 3.0.4 - lazarus 2.0.6 ---------------------------------------------------------------------- trev · 2021-01-24 03:42 Are you sure your current FreeBSD system is 64 bit? If so, I would uninstall what is currently installed and follow the Wiki article: Installing Lazarus on FreeBSD for an installation using the FreeBSD ports system. Note: This will install the current release versions of FPC (3.2.0) and Lazarus (2.0.10). ---------------------------------------------------------------------- flax57 · 2021-01-24 11:41 Quote from: trev on January 24, 2021, 04:42:23 amAre you sure your current FreeBSD system is 64 bit? If so, I would uninstall what is currently installed and follow the Wiki article: Installing Lazarus on FreeBSD for an installation using the FreeBSD ports system. Note: This will install the current release versions of FPC (3.2.0) and Lazarus (2.0.10). yes FreeBSD 12.2 amd64(x86_64) i can install just fpc compiler not to install lazarus ide, because x11 desktop not installed on this machine, and my app is a free pascal program or console utility not gtk. and from free pascal docs (Run-time errors): 216 General Protection fault The application tried to access invalid memory space. This can be caused by several problems: 1.Dereferencing a nil pointer. 2.Trying to access memory which is out of bounds (for example, calling move with an invalid length). but my app is just simple free pascal program writeln('hello world'); so no nil pointer used ??!!! ---------------------------------------------------------------------- MarkMLl · 2021-01-24 12:49 I suggest that you post your code. Why is the binary called project1... what IDE/editor were you using? In general I'd have thought that you should be able to run Lazarus, not having an X11 desktop does not mean you can't load the client libraries, and you should be able to run the system headless by tunnelling the X11 protocol over SSH. MarkMLl ---------------------------------------------------------------------- trev · 2021-01-24 21:21 Quote from: flax57 on January 24, 2021, 12:41:50 pmi can install just fpc compiler not to install lazarus ide, because x11 desktop not installed on this machine, and my app is a free pascal program or console utility not gtk. Your first post says your program name is "project1" (a Lazarus default) and that you're using "fpc 3.0.4 - lazarus 2.0.6". Now you say you're using FPC and not using Lazarus. Which is it? It's hard to help when the details you provide conflict. ---------------------------------------------------------------------- MarkMLl · 2021-01-24 21:27 Quote from: trev on January 24, 2021, 10:21:27 pmWhich is it? It's hard to help when the details you provide conflict. I tried to be a bit more delicate about that, after all it could be Eclipse or something. OP says it's a lunchtime error :-) MarkMLl ---------------------------------------------------------------------- flax57 · 2021-01-26 02:47 Quote from: trev on January 24, 2021, 10:21:27 pmQuote from: flax57 on January 24, 2021, 12:41:50 pmi can install just fpc compiler not to install lazarus ide, because x11 desktop not installed on this machine, and my app is a free pascal program or console utility not gtk. Your first post says your program name is "project1" (a Lazarus default) and that you're using "fpc 3.0.4 - lazarus 2.0.6". Now you say you're using FPC and not using Lazarus. Which is it? It's hard to help when the details you provide conflict. No, you didn't understand me i have lazarus 2.0.6 + FPC 3.0.4 installed on Mint Linux NOT FREEBSD on freebsd 64 bit (where i test my program hello world): lazarus and fpc not installed so i ask you if i can install just FPC without lazarus IDE and i recompile my program with command line : fpc -options project1 on freebsd 64 bit : X11 or desktop environnement (like gnome, kde) not installed yet, is server   i have installed now lazarus 2.0.10 + FPC 3.3.1 + Cross compiler for FREEBSD x86_64  (on Mint Linux) and recompile again my program with this new environnement (fpc 3.3.1) and my program work fine on FREEBSD x86_64 machine.  it was a bug on the cross compiler for freebsd for x86_64 cpu target ---------------------------------------------------------------------- dbannon · 2021-01-26 05:41 Quote from: flax57 on January 26, 2021, 03:47:49 am on freebsd 64 bit (where i test my program hello world): lazarus and fpc not installed so i ask you if i can install just FPC without lazarus IDE and i recompile my program with command line : fpc -options project1 Flax, you may not need this anymore but worth pointing you to anyway, https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#FreeBS D Davo ---------------------------------------------------------------------- flax57 · 2021-01-26 06:03 Quote from: dbannon on January 26, 2021, 06:41:50 amQuote from: flax57 on January 26, 2021, 03:47:49 am on freebsd 64 bit (where i test my program hello world): lazarus and fpc not installed so i ask you if i can install just FPC without lazarus IDE and i recompile my program with command line : fpc -options project1 Flax, you may not need this anymore but worth pointing you to anyway, https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#FreeBS D Davo thx for the link