Lazarus

Programming => General => Topic started by: entrisity on January 11, 2019, 03:51:15 pm

Title: getting error in application after compiling but not in the exe
Post by: entrisity 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
Title: Re: getting error in application after compiling but not in the exe
Post by: Handoko 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.
Title: Re: getting error in application after compiling but not in the exe
Post by: jamie on January 11, 2019, 11:56:15 pm
You need to show us the portion of code that is booming.

TinyPortal © 2005-2018