[fpc-pascal] SIGSEGV with -O2 (was: Illegal type conversion...)

Juha Manninen juha.manninen at phnet.fi
Mon Nov 23 13:40:56 CET 2009

I am testing VirtualTreeView with its "Advanced" demo program. When I use FPC 
2.5.1 and compile it with -O1, it works always however much I click the 
different forms.
When compile it with -O2 and click and test furiously it finally throws 
SIGSEGV. The message box says:

Project Advanced raised exception class 'External: SIGSEGV'.

Often it paralyzed my KDE desktop partly so that mouse commands didn't work.
Then I selected terminal using keyboard and killed gdb and then things worked 
again. Sometimes it didn't freeze.

I tested the same VirtualTreeView code (with my added $packset directives) 
also with FPC 2.2.4 and it worked with or without optimization.

I understand the compiler is a devel version but if you need a good test case, 
here you have one.
I compiled whole Lazarus with FPC 2.5.1 and  -O2 and it works well. 
VirtualTreeView has non-portable assembly code and may be difficult for the 

Juha Manninen

More information about the fpc-pascal mailing list