Recent

Author Topic: Exception Class 'External: SIGSEGV' after importing a procedure [SOLVED]  (Read 2628 times)

AlphaInc.

  • Jr. Member
  • **
  • Posts: 93
Re: Exception Class 'External: SIGSEGV' after importing a procedure
« Reply #15 on: April 14, 2021, 09:59:18 pm »
You didn't provide the compile-able source code. I can copy/paste your code to my Lazarus IDE, but it can't be compiled because you haven't provide all the required files.

If you don't know how to provide the compile-able source code, here is how to do it:

Create a new folder, copy and paste all the necessary files except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip to the forum.


Please provide the source code that has issue, I'm more interested to know what caused the error.

Sorry, I did understand you wrong. Here is the compilable source code of the project that did not work. The resize.pas is included.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Exception Class 'External: SIGSEGV' after importing a procedure
« Reply #16 on: April 14, 2021, 10:33:15 pm »
Try the attached project.
I've commented the two changes I made.
I also renamed one unit to be all lowercase so the project will compile on platforms other than Windows.

AlphaInc.

  • Jr. Member
  • **
  • Posts: 93
Re: Exception Class 'External: SIGSEGV' after importing a procedure
« Reply #17 on: April 14, 2021, 11:37:05 pm »
Try the attached project.
I've commented the two changes I made.
I also renamed one unit to be all lowercase so the project will compile on platforms other than Windows.

I will try it tomorrow since I'm about to go to bed. Thank you in advance.
Did you find the error or are these other changes of other nature ?

Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
Re: Exception Class 'External: SIGSEGV' after importing a procedure
« Reply #18 on: April 15, 2021, 04:10:35 am »
Thank you howardpc, now the code can be compiled and run on Linux. As mentioned, the tag was the problem.

AlphaInc.

  • Jr. Member
  • **
  • Posts: 93
Re: Exception Class 'External: SIGSEGV' after importing a procedure
« Reply #19 on: April 15, 2021, 08:44:09 am »
Got it. Thank you both for helping me. the code work's now :)

Zvoni

  • Hero Member
  • *****
  • Posts: 2317
Re: Exception Class 'External: SIGSEGV' after importing a procedure
« Reply #20 on: April 15, 2021, 09:23:54 am »
that "pb.Tag" you use as an array-index irritates me
according to
https://lazarus-ccr.sourceforge.io/docs/rtl/classes/tcomponent.tag.html
https://lazarus-ccr.sourceforge.io/docs/lcl/extctrls/tpaintbox-2.html
Tag (inherited from TComponent) is of Type PtrInt, and in your code i don't see anywhere you assigning a value to Tag, so it wouldn't surprise me, if Tag is Nil

Nevermind, that if Tag is really a (valid) pointer, i'm pretty sure it's not going to be in the range of 1..2 you need as an array-index

Can you check the Value of Tag just before you call your troublesome function?

Do I check the Value with a ShowMessage-command or how do I check it?
You can use ShowMessage, Writeln (If you're on Linux), put a label on your form, and assign it to its caption... many ways to skin that cat
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018