Forum > Beginners

[SOLVED] SIGSEGV Error

(1/1)

tudi_x:
Hi!
For an application using forms (Lazarus 1.6 32b on Windows 7 64b) I am receiving a SIGSEGV error immediately after a button click method.
I am using gdb as debugger.
Please advise how I could start debugging this error.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.FormCreate(Sender: TObject);  ....    t.SetValue('x');   //the call to setvalue does not raise a SIGSEGV    BitNavigateRightClick(nil); 
but immediately entering BitNavigateRightClick, SIGSEGV is raised:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.BitNavigateRightClick(Sender: TObject);var  err: string = '';  task_manual_ID: integer;  t: theclass; begin  t.SetValue('x');  //SIGSEGV is raised                              
Test class:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit test_class;{$mode objfpc}{$H+} {Test Memory Allocationt:theclass;t.SetValue('x');} interfaceuses  Classes, SysUtils; type  theclass = class    private      _X:string;  public    procedure SetValue(AValue: string);  end; implementation procedure theclass.SetValue(AValue: string);begin  _X:= AValue;end; end.  
Thank you

molly:
var
t: theclass;
begin
t := theclass.Create; <-- this line is missing somewhere

t.free; <-- do not forget to free the memory again
end;

tudi_x:
Thank you!
Got it.

Navigation

[0] Message Index

Go to full version