View Issue Details

IDProjectCategoryView StatusLast Update
0015114LazarusIDEpublic2010-03-06 20:44
ReporterJuha ManninenAssigned ToJuha Manninen 
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version 
Summary0015114: IDE dies when trying to select FPC source directory
DescriptionCrash happens when Environment -> Options -> Files -> "FPC source directory" control is empty and I try to select a directory by clicking on the select button beside it.

Output says:
  Invalid floating point operation

See additional info for the whole output.
Additional InformationTDefinePool.CreateFPCSrcTemplate FPCSrcDir does not exist: FPCSrcDir=""
TApplication.HandleException Invalid floating point operation
  Stack trace:

(lazarus:11211): Gtk-CRITICAL **: gtk_style_detach: assertion `style->attach_count > 0' failed
TApplication.HandleException: there was another exception during showing the first exception
  Stack trace:
TApplication.HandleException: there was another exception during showing the first exception
  Stack trace:
lazarus.pp - unhandled exception
[FORMS.PP] ExceptionOccurred
[TMainIDE.Destroy] A
[FORMS.PP] ExceptionOccurred
TagsNo tags attached.
Fixed in Revision23804
WidgetsetGTK 2
Attached Files


related to 0015188 closedJuha Manninen Open / Save dialogs crashes ide 
has duplicate 0015267 closedVincent Snijders Crash on open dialog 
has duplicate 0015747 closedVincent Snijders Complete crash when browsing folders 
related to 0015840 closedMattias Gaertner Random crash in IDE with gtk2 (Ubuntu Lucid) :TApplication.HandleException Invalid floating point operation 
related to 0017142 closedJuha Manninen Access Violation when 


Mattias Gaertner

2009-11-17 04:33

manager   ~0032198

It works here under gtk2.
How did you compile/install lazarus 0.9.29?
From the snapshots?
Your lazarus does not contain debug info. Can you compile it from svn, and use gdb to create a backtrace?

Juha Manninen

2009-11-17 12:53

developer   ~0032203

(gdb) bt
#0 0x0806aa26 in fpc_raiseexception ()
0000001 0x085af6ee in TCUSTOMCODETOOL__RAISEEXCEPTIONINSTANCE (THEEXCEPTION=0xb64e1d30, CLEARNICEPOS=true, this=<error reading variable>)
    at customcodetool.pas:2086
0000002 0x085af735 in TCUSTOMCODETOOL__RAISEEXCEPTIONCLASS (AMESSAGE=0xb64faff8 'identifier not found: CfgFileExt',
    EXCEPTIONCLASS=<incomplete type>, CLEARNICEPOS=true, this=<error reading variable>) at customcodetool.pas:2094
0000003 0x085aad1a in TCUSTOMCODETOOL__RAISEEXCEPTION (AMESSAGE=0xb64faff8 'identifier not found: CfgFileExt', CLEARNICEPOS=true,
    this=<error reading variable>) at customcodetool.pas:379
0000004 0x085aad84 in TCUSTOMCODETOOL__RAISEEXCEPTIONFMT (AMESSAGE=0x899964c 'identifier not found: %s', ARGS=<incomplete type>,
    CLEARNICEPOS=true, highARGS=0, this=<error reading variable>) at customcodetool.pas:385
0000005 0x08439df2 in RAISENOTFOUND (parentfp=0xbfffe55c) at finddeclarationtool.pas:2497
0000006 0x08439ca5 in CHECKRESULT (NEWRESULT=false, CALLONIDENTIFIERFOUND=false, parentfp=0xbfffe5a0) at finddeclarationtool.pas:2573
0000007 0x0843917d in TFINDDECLARATIONTOOL__FINDIDENTIFIERINCONTEXT (PARAMS=0xb6b20a50, this=<error reading variable>)
    at finddeclarationtool.pas:3088
0000008 0x08442559 in RESOLVEIDENTIFIER (parentfp=0xbfffe678) at finddeclarationtool.pas:6281
    this=<error reading variable>, result=...) at finddeclarationtool.pas:6690
0000010 0x08438c27 in TFINDDECLARATIONTOOL__FINDDECLARATIONOFIDENTATPARAM (PARAMS=0xb6b20a50, this=<error reading variable>)
    at finddeclarationtool.pas:2305
    NEWTOPLINE=22, this=<error reading variable>) at finddeclarationtool.pas:1486
    this=<error reading variable>) at finddeclarationtool.pas:3735
    this=<error reading variable>) at codetoolmanager.pas:1928
    CACHEWASUSED=false, this=<error reading variable>) at cachecodetools.pas:204
    this=<error reading variable>) at codehelp.pas:1935
0000016 0x084a1ebf in TCODEHELPMANAGER__GETELEMENTCHAIN (CODE=0xb7150fd0, X=63, Y=81, COMPLETE=true, CHAIN=0x0, CACHEWASUSED=false,
    this=<error reading variable>) at codehelp.pas:2029
0000017 0x084a24af in TCODEHELPMANAGER__GETHTMLHINT (CODE=0xb7150fd0, X=63, Y=81, OPTIONS=..., BASEURL=0x8a46240 'lazdoc://',
    HTMLHINT=0xb699ee08 'const CfgFileExt = ''.ini'''0000010'/Extra/SW/xdev_toolkit/dfmtolfm.pas(39,3)', CACHEWASUSED=false,
    this=<error reading variable>) at codehelp.pas:2215
0000018 0x0849b5b7 in TIDEHELPMANAGER__GETHINTFORSOURCEPOSITION (EXPANDEDFILENAME=0xb69abed8 '/Extra/SW/xdev_toolkit/dfmtolfm.pas', CODEPOS=...,
    BASEURL=0x8a46240 'lazdoc://', HTMLHINT=0xb699ee08 'const CfgFileExt = ''.ini'''0000010'/Extra/SW/xdev_toolkit/dfmtolfm.pas(39,3)',
    this=<error reading variable>) at helpmanager.pas:1317
0000019 0x080c227a in TMAINIDE__ONSRCNOTEBOOKSHOWHINTFORSOURCE (SRCEDIT=0xb6af18b0, CLIENTPOS=..., CARETPOS=..., this=<error reading variable>)
    at main.pp:13850
0000020 0x085117f9 in TSOURCENOTEBOOK__SHOWSYNEDITHINT (MOUSEPOS=..., this=<error reading variable>) at sourceeditor.pp:7050
0000021 0x08511509 in TSOURCENOTEBOOK__HINTTIMER (SENDER=0xb6b20510, this=<error reading variable>) at sourceeditor.pp:6980
0000022 0x081d2585 in TCUSTOMTIMER__DOONTIMER (this=<error reading variable>) at customtimer.pas:181
0000023 0x081d24ef in TCUSTOMTIMER__TIMER (this=<error reading variable>) at customtimer.pas:156
0000024 0x0822e944 in GTKTIMERCB (DATA=0xb716b890) at
0000025 0xb78eab8f in ?? () from /usr/lib/
0000026 0xb78ea4c2 in g_main_context_dispatch () from /usr/lib/
0000027 0xb78edd98 in ?? () from /usr/lib/
0000028 0xb78edebe in g_main_context_iteration () from /usr/lib/
0000029 0xb7b966d3 in gtk_main_iteration_do () from /usr/lib/
0000030 0x08200d2a in TGTKWIDGETSET__APPWAITMESSAGE (this=<error reading variable>) at
0000031 0x080828ba in TAPPLICATION__IDLE (WAIT=true, this=<error reading variable>) at
0000032 0x0808456f in TAPPLICATION__HANDLEMESSAGE (this=<error reading variable>) at
0000033 0x080849af in TAPPLICATION__RUNLOOP (this=<error reading variable>) at
0000034 0x080e9643 in TWIDGETSET__APPRUN (ALOOP=0x8084970 <TAPPLICATION__RUNLOOP>, this=<error reading variable>) at
0000035 0x0808496a in TAPPLICATION__RUN (this=<error reading variable>) at
0000036 0x0805d448 in main () at lazarus.pp:111

Juha Manninen

2009-11-17 13:03

developer   ~0032204

I compiled it from SVN version with stable FPC 2.2.4.
Under debugger it stopped already earlier, before I touched anything.

I guess the reason can be that I didn't install all devel packages for GTK2 related stuff. I created symlinks to many libraries manually. It should be OK because I don't need to debug those libs. I don't know...

However, I could concentrate on QT widgets now. Lazarus seems to work well when I compile it for QT bindings.
If GTK2 works for others then it is a problem in my machine configuration.

Vincent Snijders

2009-11-17 18:45

manager   ~0032211

This backtrace occurs when showing a hint in the IDE, not when selecting a fpc source directory in the environment options, so it is unrelated to this bug report.

I would not be surprised (but I don't know the details of the code tools), if this codetools exception (not an Invalid floating point operation exception) is handled well by the application, so you can just continue in gdb without errors in the IDE.

Juha Manninen

2009-11-17 23:24

developer   ~0032225

The backtrace is related to the same problem I guess. Maybe those other exceptions were not noticed when gdb was not running.
I don't know exactly what is wrong with my package configuration but Lazarus using QT widgets works as charm. I ran it also under gdb but experienced no crashes or other problems absolutely.

I would suggest to close this issue and I will use a QT compiled version in future.

GTK2 version of Lazarus worked rather well on my previous OS installation (OpenSuse 11.1) but sometimes after clicking many things and learning about items on menu it crashed.
Also "zeljko" in Lazarus mailing list wrote that QT bindings are more stable than GTK2. (See "QT binding works!").
And... QT widgets look better. So if you want to make Lazarus look like a quality app then you should switch to QT widgets as default.

Vincent Snijders

2009-11-18 13:32

manager   ~0032247

Try to create a backtrace without setting the break point on fpc_raiseexception. If a invalid floating point exception occurs, gdb will break. If it is an exception handled normally by the IDE or codetools, gdb won't break and you continue to the correct place where the crash occurred.

Juha Manninen

2009-11-18 16:31

developer   ~0032262

Ok, now I reached the same point. Actually the error come from any such file or dir selector button, not just "FPC source directory".
The exception comes from libqtcurve. t sounds like a QT lib.(?) I could get its devel version and try again.


Program received signal SIGFPE, Arithmetic exception.
0xb70806e4 in gdk_rectangle_intersect () from /usr/lib/gtk-2.0/2.10.0/engines/
(gdb) bt
#0 0xb70806e4 in gdk_rectangle_intersect () from /usr/lib/gtk-2.0/2.10.0/engines/
0000001 0x00000000 in ?? ()

Juha Manninen

2009-11-18 16:38

developer   ~0032263 version here is: 0.68.0-2.2

Juha Manninen

2009-11-18 16:53

developer   ~0032264

Program received signal SIGFPE, Arithmetic exception.
0xb70806e4 in rgbToHsv () from /usr/lib/gtk-2.0/2.10.0/engines/
(gdb) bt
#0 0xb70806e4 in rgbToHsv () from /usr/lib/gtk-2.0/2.10.0/engines/
0000001 0xb70922aa in getCellCol () from /usr/lib/gtk-2.0/2.10.0/engines/
0000002 0xb709b492 in gtkDrawFlatBox () from /usr/lib/gtk-2.0/2.10.0/engines/
0000003 0xb7c1a8a1 in gtk_paint_flat_box () from /usr/lib/
0000004 0xb7ca51c2 in ?? () from /usr/lib/
0000005 0xb7ca6e41 in ?? () from /usr/lib/
0000006 0xb7b9c944 in ?? () from /usr/lib/
0000007 0xb797f71e in ?? () from /usr/lib/
0000008 0xb79811a2 in g_closure_invoke () from /usr/lib/
0000009 0xb79969fb in ?? () from /usr/lib/
0000010 0xb7997ee0 in g_signal_emit_valist () from /usr/lib/
0000011 0xb79984b7 in g_signal_emit () from /usr/lib/
0000012 0xb7cb8dee in ?? () from /usr/lib/
0000013 0xb7b96660 in gtk_main_do_event () from /usr/lib/
0000014 0xb79fb244 in ?? () from /usr/lib/
0000015 0xb79fb1f3 in ?? () from /usr/lib/
0000016 0xb79fb1f3 in ?? () from /usr/lib/
0000017 0xb7a1e7b4 in ?? () from /usr/lib/
0000018 0xb79f28ef in ?? () from /usr/lib/
0000019 0xb79f48af in gdk_window_process_all_updates () from /usr/lib/
0000020 0xb7b0864f in ?? () from /usr/lib/
0000021 0xb79d0f78 in ?? () from /usr/lib/
0000022 0xb78e8690 in ?? () from /usr/lib/
0000023 0xb78ea4c2 in g_main_context_dispatch () from /usr/lib/
0000024 0xb78edd98 in ?? () from /usr/lib/
0000025 0xb78edebe in g_main_context_iteration () from /usr/lib/
0000026 0xb7b966d3 in gtk_main_iteration_do () from /usr/lib/
0000027 0x08200aff in TGTKWIDGETSET__APPPROCESSMESSAGES (this=<error reading variable>) at
0000028 0x08084529 in TAPPLICATION__HANDLEMESSAGE (this=<error reading variable>) at
0000029 0x0825f7f4 in TCOMMONDIALOG__DOEXECUTE (this=<error reading variable>) at
0000030 0x0825fc41 in TFILEDIALOG__DOEXECUTE (this=<error reading variable>) at
0000031 0x082603b0 in TOPENDIALOG__DOEXECUTE (this=<error reading variable>) at
0000032 0x0825f4ee in TCOMMONDIALOG__EXECUTE (this=<error reading variable>) at
0000033 0x0825fab6 in TFILEDIALOG__EXECUTE (this=<error reading variable>) at
0000034 0x085539ba in TFILESOPTIONSFRAME__FILESBUTTONCLICK (SENDER=0xb618aef0, this=<error reading variable>) at files_options.pas:100
0000035 0x081b4524 in TCONTROL__CLICK (this=<error reading variable>) at
0000036 0x081f592f in TBUTTONCONTROL__CLICK (this=<error reading variable>) at
0000037 0x081f5f15 in TCUSTOMBUTTON__CLICK (this=<error reading variable>) at
0000038 0x081f6471 in TBUTTON__CLICK (this=<error reading variable>) at
0000039 0x081f57ca in TBUTTONCONTROL__WMDEFAULTCLICKED (MESSAGE=..., this=<error reading variable>) at
0000040 0x08069e49 in SYSTEM_TOBJECT_$__DISPATCH$formal ()
0000041 0x081f57b0 in TBUTTONCONTROL__ISCHECKEDSTORED (this=<error reading variable>) at
0000042 0x081aac22 in TWINCONTROL__WNDPROC (MESSAGE=..., this=<error reading variable>) at
0000043 0x082309a7 in DELIVERMESSAGE (TARGET=0xb618aef0, AMESSAGE=void) at lclmessageglue.pas:111
0000044 0x082c71d0 in GTK2WSBUTTON_CLICKED (AWIDGET=0x8ffa078, AINFO=0xb5db3ba0) at gtk2wsstdctrls.pp:1886
0000045 0xb798edcc in g_cclosure_marshal_VOID__VOID () from /usr/lib/
0000046 0xb79811a2 in g_closure_invoke () from /usr/lib/
0000047 0xb7996c66 in ?? () from /usr/lib/
0000048 0xb7998036 in g_signal_emit_valist () from /usr/lib/
0000049 0xb79984b7 in g_signal_emit () from /usr/lib/
0000050 0xb7adc7ba in gtk_button_clicked () from /usr/lib/
0000051 0xb7adddd8 in ?? () from /usr/lib/
0000052 0xb798edcc in g_cclosure_marshal_VOID__VOID () from /usr/lib/
#53 0xb797f71e in ?? () from /usr/lib/

Vincent Snijders

2009-11-18 16:58

manager   ~0032265

I don't think it is a Qt lib, but a theme library. As a workaround you can try to use a different theme.

I don't know if it is a bug in our gtk2 libs, or a bug on the qt curve theme library, that we expose.

Juha Manninen

2009-11-25 12:35

developer   ~0032467

The library is a theme which makes GTK look like QT. I removed it and changed GTK theme from KDE desktop settings. Now Lazarus GTK version works without crashes.

Mattias Gaertner

2009-11-28 11:54

manager   ~0032548

I installed qtcurve under ubuntu, but the IDE does not crash.
What qt theme do you use?

Juha Manninen

2009-11-30 21:34

developer   ~0032610

QT theme is the Opensuse 11.2 default which is Oxygen.
However it doesn't affect GTK2 applications under KDE.
There is a separate setting for that (GTK2 application style under KDE). It was qtcurve but I uninstalled the library and set the style to Clearloooks.

Paul Gevers

2010-02-25 22:24

reporter   ~0034766

It looks to me that Ubuntu development release (lucid) is currently also having this problem with lazarus 0.9.28. You might find some information at which covers multiple bugs in a package build with lazarus/fpc. I confirm that my problems after fixing an issue with that package (winff) there are solved by moving my theme in KDE away from QTcurve for BOTH the widget style and GTK+style. My bet would be that there is a problem with that library exposed by lazarus.

Flávio Etrusco

2010-02-26 17:45

developer   ~0034812

Does anybody have a reproducible test-case?
And can somebody with appropriate permissions mark "my" issue ( it as related (or duplicate) to this, please?

Juha Manninen

2010-03-06 20:23

developer   ~0034979

Many similar random errors were fixed by 23804.

Juha Manninen

2010-03-06 20:37

developer   ~0034982

Many similar random errors were fixed by 23804.

Juha Manninen

2010-03-06 20:44

developer   ~0034985


Issue History

Date Modified Username Field Change
2009-11-16 22:04 Juha Manninen New Issue
2009-11-16 22:04 Juha Manninen Widgetset => GTK 2
2009-11-17 04:33 Mattias Gaertner LazTarget => -
2009-11-17 04:33 Mattias Gaertner Note Added: 0032198
2009-11-17 04:33 Mattias Gaertner Status new => feedback
2009-11-17 12:53 Juha Manninen Note Added: 0032203
2009-11-17 13:03 Juha Manninen Note Added: 0032204
2009-11-17 18:45 Vincent Snijders Note Added: 0032211
2009-11-17 23:24 Juha Manninen Note Added: 0032225
2009-11-18 13:32 Vincent Snijders Note Added: 0032247
2009-11-18 16:31 Juha Manninen Note Added: 0032262
2009-11-18 16:38 Juha Manninen Note Added: 0032263
2009-11-18 16:53 Juha Manninen Note Added: 0032264
2009-11-18 16:58 Vincent Snijders Note Added: 0032265
2009-11-25 12:35 Juha Manninen Note Added: 0032467
2009-11-26 21:25 Vincent Snijders Relationship added related to 0015188
2009-11-28 11:54 Mattias Gaertner Note Added: 0032548
2009-11-30 21:34 Juha Manninen Note Added: 0032610
2010-02-25 22:24 Paul Gevers Note Added: 0034766
2010-02-26 17:45 Flávio Etrusco Note Added: 0034812
2010-02-26 18:48 Zeljan Rikalo Relationship added related to 0015840
2010-03-06 20:20 Juha Manninen Status feedback => assigned
2010-03-06 20:20 Juha Manninen Assigned To => Juha Manninen
2010-03-06 20:23 Juha Manninen Fixed in Revision => 23804
2010-03-06 20:23 Juha Manninen Status assigned => resolved
2010-03-06 20:23 Juha Manninen Resolution open => fixed
2010-03-06 20:23 Juha Manninen Note Added: 0034979
2010-03-06 20:37 Juha Manninen Note Added: 0034982
2010-03-06 20:44 Juha Manninen Status resolved => closed
2010-03-06 20:44 Juha Manninen Note Added: 0034985
2010-03-12 10:55 Vincent Snijders Relationship added has duplicate 0015267
2010-03-12 10:56 Vincent Snijders Relationship added has duplicate 0015747
2010-08-11 14:00 Vincent Snijders Relationship added related to 0017142