View Issue Details

IDProjectCategoryView StatusLast Update
0036151LazarusPackagespublic2021-02-18 10:29
ReporterJuha Manninen Assigned ToMichl  
Status closedResolutionfixed 
Product Version2.1 (SVN) 
Fixed in Version2.1 (SVN) 
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
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/
0000023 0x0000000000711061 in GTKNOTEBOOKCLOSEBTNCLICKED (WIDGET=0x2df5330, DATA=0x7fffd35106b0) at gtk2/
0000024 0x00007ffff74cfcaa in g_closure_invoke () at /usr/lib/
0000025 0x00007ffff74bd706 in () at /usr/lib/
0000026 0x00007ffff74c189a in g_signal_emit_valist () at /usr/lib/
0000027 0x00007ffff74c2700 in g_signal_emit () at /usr/lib/
0000028 0x00007ffff7582895 in () at /usr/lib/
0000029 0x00007ffff74cfcaa in g_closure_invoke () at /usr/lib/
0000030 0x00007ffff74bd854 in () at /usr/lib/
0000031 0x00007ffff74c189a in g_signal_emit_valist () at /usr/lib/
0000032 0x00007ffff74c2700 in g_signal_emit () at /usr/lib/
0000033 0x00007ffff75817ba in () at /usr/lib/
0000034 0x00007ffff762a7cc in () at /usr/lib/
0000035 0x00007ffff74cfcaa in g_closure_invoke () at /usr/lib/
0000036 0x00007ffff74bcf78 in () at /usr/lib/
0000037 0x00007ffff74c0e2c in g_signal_emit_valist () at /usr/lib/
0000038 0x00007ffff74c2700 in g_signal_emit () at /usr/lib/
0000039 0x00007ffff7745235 in () at /usr/lib/
0000040 0x00007ffff7628a0e in gtk_propagate_event () at /usr/lib/
0000041 0x00007ffff7628e43 in gtk_main_do_event () at /usr/lib/
0000042 0x00007ffff7cf8d5e in () at /usr/lib/
0000043 0x00007ffff73e4cf4 in g_main_context_dispatch () at /usr/lib/
0000044 0x00007ffff73e6b11 in () at /usr/lib/
0000045 0x00007ffff73e6b51 in g_main_context_iteration () at /usr/lib/
0000046 0x000000000050fcd1 in APPWAITMESSAGE (this=0x7ffff7f8f3f0) at gtk2/
0000047 0x000000000048fdb4 in IDLE (this=0x7ffff7f8ec90, WAIT=true) at include/
TagsNo tags attached.
Fixed in Revision64283, 64284
Attached Files


related to 0033772 resolvedMichl crash with sparta form editor 



2020-01-17 22:42

reporter   ~0120500

More than that. In a current trunk sparta_DockedFormEditor experience is pretty much broken in conjunction with Anchor Docking.
- The form gets completely distorted on any attempt to resize it.
- The form constantly steals the focus from panels, so it's very difficult to enter something in filters or properties.
- Takes up to few seconds to redraws on changes.

Nur Cholif Murtadho

2020-01-18 13:02

reporter   ~0120511

sparta_DockedFormEditor pretty much unusable right now


2021-01-18 17:39

reporter   ~0128398

The removal of Application.ProcessMessages from TSpartaMainIDE.GetCurrentResizer
seems to have solved this issue. At least on MS Windows.


2021-01-18 21:35

developer   ~0128400

I'm working on a enhanced DockedFormDesigner forked from SpartaDockedFormEditor. If you want, you can test a reduced current snapshot (alpha state) - just uploaded on my Sourceforge repository. For now tested on Win 7 and a bit on Linux Mint GTK2 and QT. You need latest Trunk of Lazarus and FPC 3.0.4 or 3.2.0.

svn checkout --depth empty
svn update --set-depth infinity trunk/dockedformeditor

Maybe it is more stable - for me it is ;)


2021-01-18 21:38

developer   ~0128401

@regs: Please open a new bug report for new problems and define your operating system.


2021-01-18 21:42

developer   ~0128402

This bug should be resolved in revision 64283. Please reopen, if not.

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
2020-01-17 22:42 regs Note Added: 0120500
2020-01-18 13:02 Nur Cholif Murtadho Note Added: 0120511
2021-01-18 17:39 nanobit Note Added: 0128398
2021-01-18 20:54 Michl Assigned To => Michl
2021-01-18 20:54 Michl Status new => assigned
2021-01-18 21:35 Michl Note Added: 0128400
2021-01-18 21:38 Michl Note Added: 0128401
2021-01-18 21:42 Michl Status assigned => resolved
2021-01-18 21:42 Michl Resolution open => fixed
2021-01-18 21:42 Michl Fixed in Version => 2.1 (SVN)
2021-01-18 21:42 Michl Fixed in Revision => 64283, 64284
2021-01-18 21:42 Michl Note Added: 0128402
2021-02-18 10:29 Juha Manninen Status resolved => closed