Recent

Author Topic: SIGSEGV after "reraise", but not immediately, is it normal?  (Read 4615 times)

cobata

  • New Member
  • *
  • Posts: 45
  • Programmer-analyst
    • COBATA Software - Research, Development, Testing, Consulting
SIGSEGV after "reraise", but not immediately, is it normal?
« on: December 03, 2016, 04:54:02 pm »
Cheers Colleagues,

Even this gave me a better ideas for sandboxing, I would like to know:
Here is the case not reproducible on Windows win32/w64 ws and Darwin gtk2 ws, but on carbon ws (Darwin):

After catching some exception (for example create a component with existing name) and performing all necessary actions to rollback to the program stable state and reraise the exception (for example the exception to be propagated and the exception message to be shown by the runtime), here appears the confirmation dialog with the exception message and buttons: OK - to continue the program execution and Cancel - to terminate the program. After choosing OK the program continue... and is interactable, but in some good moment you are choosing a button opening/ saving dialog box and in this moment the program unexpectedly is terminated. The error message is: Exception class 'External: SIGSEGV' at address...

Lazarus 1.4.4, FPC 2.6.4.

Best.
COBATA Software - Research, Development, Testing, Consulting
http://www.COBATA.com/

Thaddy

  • Hero Member
  • *****
  • Posts: 8939
Re: SIGSEGV after "reraise", but not immediately, is it normal?
« Reply #1 on: December 03, 2016, 05:17:53 pm »
First start using a maintained version of fpc and Lazarus.
We can't test antiques. Waste of time.
Most people that want to use threading should learn to patch their jeans first: use a needle.

cobata

  • New Member
  • *
  • Posts: 45
  • Programmer-analyst
    • COBATA Software - Research, Development, Testing, Consulting
Re: SIGSEGV after "reraise", but not immediately, is it normal?
« Reply #2 on: December 03, 2016, 07:02:32 pm »
When we started to count what is first and what is second lets see from my post here (http://forum.lazarus.freepascal.org/index.php/topic,34885.0.html):
"And a last observation: Lazarus 1.4.4 with FPC 3.0.0 on Windows and win32/64 widgetset may have mem leaks, because the Heaptrc message differs by the message from Lazarus 1.4.4 with FPC 2.6.4."

probably it is related to: (from here: http://wiki.freepascal.org/Lazarus_1.6_fixes_branch)
"r50963 fpdebug: fixed mem leaks, bug 29227 patch from Anton"

It is not clear is it taken in 1.6.2.

and probably third: I am just pointing about this observation (I found a workaround) It is your choice to retest it on 1.6.2 and take it in account :). Lets not discipline each others.
COBATA Software - Research, Development, Testing, Consulting
http://www.COBATA.com/

cobata

  • New Member
  • *
  • Posts: 45
  • Programmer-analyst
    • COBATA Software - Research, Development, Testing, Consulting
Re: SIGSEGV after "reraise", but not immediately, is it normal?
« Reply #3 on: December 05, 2016, 07:05:25 pm »
The simplified description seems is not enough to reproduce the problem, although in my case I am reproducing the problem on 100%.
I attached the problematic part of the code. On Windows the debugger skips the "Destroy;" and stops on "raise;" - but the observed problem is on Darwin, where the debugger stops on "Destroy;".

The workaround I am suggesting is replacement of "raise;" (probably, I could find others):
// add "e: " in "on Exception do"
ShowMessage(e.Message);
break;

I can not use Heaptrc on Darwin. Is it possible the exception object to be freed twice?
COBATA Software - Research, Development, Testing, Consulting
http://www.COBATA.com/