SIGSEGV (otherwise known as a segfault) is a *nix signal indicating that the an illegal address was accessed. Normally it can't be caught with a try...except. You have to muck about with signals to catch it with try ... except.

It some times can be difficult to determine the exact location of the error. I usually use WriteLn() to print debugging info but the signal can abort a program before flushing buffers so I have to verify it by selectively remming out code or issuing flush() after each writeln(). In the latter case it easiest to create and use a logging function.

Looking at the suspect code I have to say that assigning a nil to another variable is not a segfault condition. It would be a problem if you tried to use MyObject2_var when it is a nil or if MyObject1 is nil. You can not access object members, if the object is nil, without causing this condition.

Hope this helps.

-Jon

[EMAIL PROTECTED] wrote:

Hi,

 

 

I have tried to google for "External: SIGSEGV" exception, but nothing what came up helped.

 

Is there any detailed explanation about when this exception occurs?

 

In my program it  pops up when reading an unassigned (nil) object property:

 

  MyObject2_Var:= MyObject1.MyObject2;   (MyObject1.MyObject2 is nil)

 

The strange thing is that the assignment is in a try ... except block, and the debugger does not stop at the breakpoints in the exception  handling part.

 

I am totally clueless.

 

Thanks for reading

 

  - Leslie -

 


_______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

-- 
Jon Foster
JF Possibilities, Inc.
[EMAIL PROTECTED]
541-410-2760
Making computers work for you!


_______________________________________________
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to