Recent

Author Topic: From Form_Tutorial#The_First_GUI_Application: raised exception 'External SIGSEGV  (Read 2255 times)

SA.Blackmon

  • New Member
  • *
  • Posts: 37
  • Just an old retired guy practicing what he enjoys.
I am recent to Lazarus but have been doing Pascal (40 years) and Delphi (25 years) and this is a little bit irritating.
I was having an issue (as above) so I decided to do the tutorial and got the same exception thrown.
With the lpr creating the two forms, I was successful with doing both Show and ShowModal.
But, when doing the form creation (..._main.pas), an error is thrown on either the Show or the ShowModal.

I have read a number of posts (25 or so) about different ways to throw the 'External SIGSEGV' exception but found
none that fit my situation.

Please help!!

« Last Edit: November 28, 2020, 03:24:08 pm by SA.Blackmon »
Thank you for your help,
Sherril

Handoko

  • Hero Member
  • *****
  • Posts: 5149
  • My goal: build my own game engine using Lazarus
Hello SA.Blackmon,
Welcome to the forum.

Please provide the whole project, so we can test it. If you are not willing to publicize the whole project you can write a demo that shows the issue.

You can manually compress all the files (except: binaries and backup folder) or use the built-in tool, and attach the zip file to the forum.
Lazarus main menu > Project > Publish Project

PascalDragon

  • Hero Member
  • *****
  • Posts: 5462
  • Compiler Developer
Judging from the thread title I assume that SA.Blackmon means this tutorial.

SA.Blackmon

  • New Member
  • *
  • Posts: 37
  • Just an old retired guy practicing what he enjoys.
I apologize. I clearly have little idea of how this site works.

All my source is in the attachment named TestCallingForms_stuff.pas.

PascalDragon was correct in the assumption regarding the tutorial.
Thank you for your help,
Sherril

SA.Blackmon

  • New Member
  • *
  • Posts: 37
  • Just an old retired guy practicing what he enjoys.
I have now reloaded Lazarus. I get the same results as before.
Thank you for your help,
Sherril

wp

  • Hero Member
  • *****
  • Posts: 11910
I apologize. I clearly have little idea of how this site works.
Go to the folder in which you stored your project. Add the .lpr, lpi, .pas and .lfm files to a common zip. Then, for posting, open the forum editor and click on "Attachments and other options" below the editor. Click on "Attach" and use the browse button to navigate to the created zip. Then click "Post". This will upload the compilable project for us to see what's wrong.

SA.Blackmon

  • New Member
  • *
  • Posts: 37
  • Just an old retired guy practicing what he enjoys.
I have added the zip file.

I found a serious beginner's mistake. I failed to create the third form.***

Now, I am getting a heap dump after I close the app either from within the debugger or running the executable.

*** My change to the code was in testcallingforms_01.pas

procedure TForm2.Button1Click(Sender: TObject);
begin
  Form3 := TForm3.Create(nil);
  try
    Form3.Showmodal;

  finally
    Form3.Free;
  end;
end;
Thank you for your help,
Sherril

Handoko

  • Hero Member
  • *****
  • Posts: 5149
  • My goal: build my own game engine using Lazarus
This should solve your problem:

Code: Pascal  [Select][+][-]
  1. procedure TForm2.Button1Click(Sender: TObject);
  2. begin
  3.   Form3 := TForm3.Create(Self);
  4.   Form3.Show;
  5. end;

Alternatively:

If you do not know how to manually handle form creation, you should use autocreate form feature:
Lazarus main menu > Project > Project Options > left panel > Project Options > Forms

For your information, if you create a new form by using File > New > Module > Form, the newly created form will use autocreate form feature.

wp

  • Hero Member
  • *****
  • Posts: 11910
I have added the zip file.
This is the second time that you say you attached a file, but still I don't see one...

Handoko

  • Hero Member
  • *****
  • Posts: 5149
  • My goal: build my own game engine using Lazarus
It is on the first post.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
I apologize. I clearly have little idea of how this site works.

For a few tips (like using CODE tags), look in the wiki, page: Forum  :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

SA.Blackmon

  • New Member
  • *
  • Posts: 37
  • Just an old retired guy practicing what he enjoys.
Thank you very much for the help.

I made some rookie mistakes and should never have started this thread. For all it's worth, I'd like to see the thread thrust into oblivion.

Again, thank you all for your help; it is much appreciated.

Sorry to have wasted your time.
Thank you for your help,
Sherril

PascalDragon

  • Hero Member
  • *****
  • Posts: 5462
  • Compiler Developer
I made some rookie mistakes and should never have started this thread. For all it's worth, I'd like to see the thread thrust into oblivion.

Don't apologize for asking. You're a beginner (we all were in the past) and sometimes talking (or in this case asking) about might already helps seeing one's own mistakes.

wp

  • Hero Member
  • *****
  • Posts: 11910
I have added the zip file.
This is the second time that you say you attached a file, but still I don't see one...

It is on the first post.

But this is not a compilable project. SA.Blackmon, you spent a lot of time combining all thise code snippets into a single file, and I have to spend a lot of time separating them and creating the missing lfm files. And there is not lpi file with the compiler settings used. Please don't do this again: Simply pack the pas, lfm, lpi and lpr files into a common zip which you can upload - then I have everything needed to begin to help you.

bytebites

  • Hero Member
  • *****
  • Posts: 639
There is file TestCallingForms.zip, see last attachment.

 

TinyPortal © 2005-2018