Recent

Author Topic: Runtime error 216 when lunching project1 on FreeBSD  (Read 7269 times)

flax57

  • New Member
  • *
  • Posts: 12
Runtime error 216 when lunching project1 on FreeBSD
« on: January 24, 2021, 12:34:08 am »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Runtime error 216 when lunching project1 on FreeBSD
« Reply #1 on: January 24, 2021, 04:42:23 am »
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

  • New Member
  • *
  • Posts: 12
Re: Runtime error 216 when lunching project1 on FreeBSD
« Reply #2 on: January 24, 2021, 12:41:50 pm »
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).

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 ??!!!
« Last Edit: January 24, 2021, 12:51:17 pm by flax57 »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: Runtime error 216 when lunching project1 on FreeBSD
« Reply #3 on: January 24, 2021, 01:49:48 pm »
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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Runtime error 216 when lunching project1 on FreeBSD
« Reply #4 on: January 24, 2021, 10:21:27 pm »
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.

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

  • Hero Member
  • *****
  • Posts: 6647
Re: Runtime error 216 when lunching project1 on FreeBSD
« Reply #5 on: January 24, 2021, 10:27:42 pm »
Which 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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

flax57

  • New Member
  • *
  • Posts: 12
Re: Runtime error 216 when lunching project1 on FreeBSD
« Reply #6 on: January 26, 2021, 03:47:49 am »
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.

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
 
 :D

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.  :D
it was a bug on the cross compiler for freebsd for x86_64 cpu target



dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Runtime error 216 when lunching project1 on FreeBSD
« Reply #7 on: January 26, 2021, 06:41:50 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#FreeBSD

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

flax57

  • New Member
  • *
  • Posts: 12
Re: Runtime error 216 when lunching project1 on FreeBSD
« Reply #8 on: January 26, 2021, 07:03:27 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#FreeBSD

Davo

thx for the link

 

TinyPortal © 2005-2018