View Issue Details

IDProjectCategoryView StatusLast Update
0036151LazarusPackagespublic2019-10-08 19:26
ReporterJuha ManninenAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0036151: Access violation in Lazarus IDE when sparta_DockedFormEditor is installed and a unit with a frame is closed
DescriptionClosing a unit with a Form seems to work.
Without sparta_DockedFormEditor there is no access violation.
For testing you must build Lazarus with debug flags on. I built it with: -gw -gl -godwarfsets -gh -gt -Co -Cr -Ci -Sa
I have tested on Linux with GTK2 and KDE5 bindings. It does not look like widgetset dependent.

I suppose the bug is related to the automatic memory management of interfaced objects like TFrameDesignerForm.
They get somehow wrongly freed. Such errors are nasty to debug and find.

Removing these lines:
- if LookupRoot is TControl then
- TControl(LookupRoot).RemoveAllHandlersOfObject(Self);
from destructor TFrameDesignerForm.Destroy changes the error. Then with GTK2 bindings I get:
  The program 'lazarus' received an X Window System error.
  This probably reflects a bug in the program.
  The error was 'BadWindow (invalid Window parameter)'.
    (Details: serial 286340 error_code 3 request_code 12 minor_code 0)
    (Note to programmers: normally, X errors are reported asynchronously;
     that is, you will receive the error a while after causing it.
     To debug your program, run it with the --sync command line
     option to change this behavior. You can then get a meaningful
     backtrace from your debugger if you break on the gdk_x_error() function.)

Steps To ReproduceInstall sparta_DockedFormEditor into Lazarus (AnchorDocking is not needed).
Using any existing GUI application project, open unit sparta_BasicResizeFrame from package sparta_MDI.
Close the newly opened sparta_BasicResizeFrame --> CRASH.
Additional InformationDebug lines and a debugger backtrace:

TDesigner.PrepareFreeDesigner: TheFormEditor=TFormEditor, Designer=TDesigner
TNonFormProxyDesignerForm.Destroy: Self=_Designer_BasicResizeFrame:TFrameProxyDesignerForm, LookupRoot=nil

Thread 1 "lazarus" received signal SIGSEGV, Segmentation fault.
0x0000000000432285 in fpc_do_is ()
(gdb) bt
#0 0x0000000000432285 in fpc_do_is ()
0000001 0x0000000000000003 in ()
0000002 0x000000000059c53d in DBGSNAME (P=0xf0f0f0f0f0f0f0f0) at LazLoggerImpl.inc:410
0000003 0x000000000059fbbb in ARGSTOSTRING (this=0x7ffff59bd400, ARGS=..., highARGS=3) at lazloggerbase.pas:778
0000004 0x00000000005a08ac in DEBUGLN (this=0x7ffff59bd400, ARGS=..., highARGS=3) at lazloggerbase.pas:919
0000005 0x000000000049e63d in DEBUGLN (ARGS=..., highARGS=3) at lclproc.pas:1336
0000006 0x000000000129c305 in DESTROY (this=0x7fffd32a5ac0, vmt=0x1) at ../designer/framedesigner.pas:68
0000007 0x000000000043390f in SYSTEM$_$TINTERFACEDOBJECT_$__$$__RELEASE$$LONGINT ()
0000008 0x0000000000000001 in ()
0000009 0x00007fffd32a5b10 in ()
0000010 0x00007fffffffcc28 in ()
0000011 0x0000000000432316 in fpc_intf_decr_ref ()
0000012 0x00007ffff4da6370 in ()
0000013 0x0000000000b704f0 in DELETECOMPONENT (this=0x7fffec9bc3c0, ACOMPONENT=0x7fffd8169cb0, FREECOMPONENT=true) at customformeditor.pp:646
0000014 0x0000000000b5b7dd in PREPAREFREEDESIGNER (this=0x7fffd8171150, AFREECOMPONENT=true) at ../designer/designer.pp:829
0000015 0x0000000000ec4b45 in CLOSEUNITCOMPONENT (ANUNITINFO=0x7fffec44b7f0, FLAGS=...) at sourcefilemanager.pas:7191
0000016 0x0000000000eaca62 in CLOSEEDITORFILE (AEDITOR=0x7fffec6065c0, FLAGS=...) at sourcefilemanager.pas:2697
0000017 0x00000000004c9729 in DOCLOSEEDITORFILE (this=0x7ffff4c802f0, AEDITOR=0x7fffec6065c0, FLAGS=...) at main.pp:5880
0000018 0x00000000004bbc74 in MNUCLOSECLICKED (this=0x7ffff4c802f0, SENDER=0x7fffd35106b0) at main.pp:3400
0000019 0x00000000004bbeee in SRCNOTEBOOKFILECLOSE (this=0x7ffff4c802f0, SENDER=0x7fffd35106b0, ACLOSEOPTIONS=...) at main.pp:3439
0000020 0x0000000000ca4055 in CLOSECLICKED (this=0x7fffec43f430, SENDER=0x7fffd35106b0, CLOSEOPTIONS=...) at sourceeditor.pp:8418
0000021 0x0000000000ca3e7f in CLOSETABCLICKED (this=0x7fffec43f430, SENDER=0x7fffd35106b0) at sourceeditor.pp:8379
0000022 0x0000000000677028 in DOCLOSETABCLICKED (this=0x7fffec4413b0, APAGE=0x7fffd35106b0) at include/customnotebook.inc:455
0000023 0x0000000000711061 in GTKNOTEBOOKCLOSEBTNCLICKED (WIDGET=0x2df5330, DATA=0x7fffd35106b0) at gtk2/gtk2callback.inc:134
0000024 0x00007ffff74cfcaa in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
0000025 0x00007ffff74bd706 in () at /usr/lib/libgobject-2.0.so.0
0000026 0x00007ffff74c189a in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
0000027 0x00007ffff74c2700 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
0000028 0x00007ffff7582895 in () at /usr/lib/libgtk-x11-2.0.so.0
0000029 0x00007ffff74cfcaa in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
0000030 0x00007ffff74bd854 in () at /usr/lib/libgobject-2.0.so.0
0000031 0x00007ffff74c189a in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
0000032 0x00007ffff74c2700 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
0000033 0x00007ffff75817ba in () at /usr/lib/libgtk-x11-2.0.so.0
0000034 0x00007ffff762a7cc in () at /usr/lib/libgtk-x11-2.0.so.0
0000035 0x00007ffff74cfcaa in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
0000036 0x00007ffff74bcf78 in () at /usr/lib/libgobject-2.0.so.0
0000037 0x00007ffff74c0e2c in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
0000038 0x00007ffff74c2700 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
0000039 0x00007ffff7745235 in () at /usr/lib/libgtk-x11-2.0.so.0
0000040 0x00007ffff7628a0e in gtk_propagate_event () at /usr/lib/libgtk-x11-2.0.so.0
0000041 0x00007ffff7628e43 in gtk_main_do_event () at /usr/lib/libgtk-x11-2.0.so.0
0000042 0x00007ffff7cf8d5e in () at /usr/lib/libgdk-x11-2.0.so.0
0000043 0x00007ffff73e4cf4 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
0000044 0x00007ffff73e6b11 in () at /usr/lib/libglib-2.0.so.0
0000045 0x00007ffff73e6b51 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
0000046 0x000000000050fcd1 in APPWAITMESSAGE (this=0x7ffff7f8f3f0) at gtk2/gtk2widgetset.inc:2433
0000047 0x000000000048fdb4 in IDLE (this=0x7ffff7f8ec90, WAIT=true) at include/application.inc:414
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

related to 0033772 new crash with sparta form editor 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-10-08 18:55 Juha Manninen New Issue
2019-10-08 19:10 Juha Manninen Description Updated View Revisions
2019-10-08 19:10 Juha Manninen Additional Information Updated View Revisions
2019-10-08 19:10 Juha Manninen LazTarget => -
2019-10-08 19:26 Juha Manninen Relationship added related to 0033772