Recent

Author Topic: getting error in application after compiling but not in the exe  (Read 1573 times)

entrisity

  • New Member
  • *
  • Posts: 12
getting error in application after compiling but not in the exe
« on: January 11, 2019, 03:51:15 pm »
hey, I have a project. When I compile I don't get any error but when i click a button I get this error: https://imgur.com/a/WyKsNT9

But when when I run the Application it creates in the file it works fine after i click the button

I don't get this and it's really confusing.

Help would be very much appreciated

Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
Re: getting error in application after compiling but not in the exe
« Reply #1 on: January 11, 2019, 04:16:05 pm »
SIGSEGV errors are memory related errors. It usually happens if you:

- use pointer incorrectly, usually uninitialized pointer
- accessing/writing prohibited memory location
- using uninitialized object

When asking question related with coding error, it is usually better if you can show us the source code. So we can tell you where you did it wrong.

For example, you should get SIGSEGV error if you run this code below:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3.   Data: ^Char;
  4. begin
  5.   Data[12345] := 'a';
  6. end;

Reason:
The variable Data points to memory location "12345". But you haven't requested the space. So if you're trying to write the data 'a' on the location, your OS (Windows, Linux, etc) knows you did something wrong (because you haven't made the memory space request) and it sends you an external SIGSEGV error.
« Last Edit: January 11, 2019, 04:39:59 pm by Handoko »

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: getting error in application after compiling but not in the exe
« Reply #2 on: January 11, 2019, 11:56:15 pm »
You need to show us the portion of code that is booming.

The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018