View Issue Details

IDProjectCategoryView StatusLast Update
0034377LazarusIDEpublic2020-04-13 18:22
ReporterCyrax Assigned To 
PrioritynormalSeverityminorReproducibilityrandom
Status feedbackResolutionopen 
PlatformLinux x86_64OSArch 
Product Version1.9 (SVN) 
Summary0034377: Size range overflow in MainIDE.SendMoveSizeMessages
DescriptionI get this exception randomly when clicking Lazarus tab in the task bar to minimize and maximize the IDE.

TApplication.HandleException: Exception
Size range overflow in MainIDE.SendMoveSizeMessages: Width=1920, Height=-26.
  Stack trace:
  $081C0BF2  TWINCONTROL__SENDMOVESIZEMESSAGES,  line 4334 of include/wincontrol.inc
  $081CAD88  TCONTROL__CHANGEBOUNDS,  line 723 of include/control.inc
  $081D19ED  TCONTROL__SETBOUNDS,  line 3966 of include/control.inc
  $081C7F3D  TWINCONTROL__SETBOUNDS,  line 8150 of include/wincontrol.inc
  $081D0398  TCONTROL__SETCLIENTSIZE,  line 3357 of include/control.inc
  $081D0328  TCONTROL__SETCLIENTHEIGHT,  line 3345 of include/control.inc
  $0876DC90  TMAINIDEBAR__DOSETMAINIDEHEIGHT,  line 443 of mainbar.pas
  $0876EAA0  TMAINIDEBAR__RESIZING,  line 732 of mainbar.pas
  $080C0522  TSCROLLINGWINCONTROL__WMSIZE,  line 161 of include/scrollingwincontrol.inc
  $080C334D  TCUSTOMFORM__WMSIZE,  line 734 of include/customform.inc
  $08076091  TOBJECT__DISPATCH,  line 684 of ../inc/objpas.inc
  $081CE1F1  TCONTROL__WNDPROC,  line 2243 of include/control.inc
  $081C2F11  TWINCONTROL__WNDPROC,  line 5425 of include/wincontrol.inc
  $080C4D02  TCUSTOMFORM__WNDPROC,  line 1477 of include/customform.inc
  $0876DF96  TMAINIDEBAR__WNDPROC,  line 551 of mainbar.pas
  $0835512F  DELIVERMESSAGE,  line 112 of lclmessageglue.pas
  $08271CE7  DELIVERMESSAGE,  line 3780 of gtk2/gtk2proc.inc
Additional InformationRunning 32-bit Lazarus under 64-bit Linux environment.
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetGTK 2
Attached Files

Relationships

related to 0028036 confirmed Form ClientHeight ignores main menu height 
has duplicate 0035889 resolvedJuha Manninen Range error in SendMoveSizeMessages appears sometimes when starting the IDE. 
related to 0036874 closedZeljan Rikalo Qt,Qt5: TQtMainWindow->TQtWindowArea->mapToGlobal() sometimes returns bad result 

Activities

Juha Manninen

2018-10-03 10:23

developer   ~0111223

I have added the exception there because I saw a range error but only a few times and I could not reproduce. I hoped somebody else can with a clear exception message.
If you really can reproduce, please create a proper debugger backtrace which shows the method parameter values.
The question is: In which method the value goes wrong and why?

Cyrax

2020-04-02 17:14

reporter   ~0121850

Last edited: 2020-04-02 18:03

View 2 revisions

During debugging Lazarus how Lazarus debugger works, I finally managed to get proper call trace of this annoying error :

# 0 fpc_raiseexception(0x3a30658, 0x61f688, 0x7fffffffbe20) at ../inc/except.inc:162
# 1 TWINCONTROL__SENDMOVESIZEMESSAGES(0x3f9b138, true, false) at include/wincontrol.inc:4335
# 2 TCONTROL__CHANGEBOUNDS(0x3f9b138, 0, 26, 1920, -28, false) at include/control.inc:722
# 3 TCONTROL__SETBOUNDS(0x3f9b138, 0, 26, 1920, -1) at include/control.inc:3963
# 4 TWINCONTROL__SETBOUNDS(0x3f9b138, 0, 26, 1920, -1) at include/wincontrol.inc:8156
# 5 TCONTROL__SETCLIENTSIZE(0x3f9b138, {X = 1920, Y = -28}) at include/control.inc:3354
# 6 TCONTROL__SETCLIENTHEIGHT(0x3f9b138, -28) at include/control.inc:3342
# 7 TMAINIDEBAR__DOSETMAINIDEHEIGHT(0x3f9b138, true, -28) at mainbar.pas:445
# 8 TMAINIDEBAR__RESIZING(0x3f9b138, WSMAXIMIZED) at mainbar.pas:741
# 9 TSCROLLINGWINCONTROL__WMSIZE(0x3f9b138, {MSG = 5, UNUSEDMSG = 1431655765, SIZETYPE = 130, WIDTH = 1920, HEIGHT = 85, UNUSED = 1431655765, RESULT = 0}) at include/scrollingwincontrol.inc:161
# 10 TCUSTOMFORM__WMSIZE(0x3f9b138, {MSG = 5, UNUSEDMSG = 1431655765, SIZETYPE = 130, WIDTH = 1920, HEIGHT = 85, UNUSED = 1431655765, RESULT = 0}) at include/customform.inc:664
# 11 TOBJECT__DISPATCH(0x3f9b138, ) at ../inc/objpas.inc:684
# 12 TCONTROL__WNDPROC(0x3f9b138, {MSG = 5, UNUSEDMSG = 1431655765, WPARAM = 130, LPARAM = 6148914689810433920, RESULT = 0}) at include/control.inc:2240
# 13 TWINCONTROL__WNDPROC(0x3f9b138, {MSG = 5, UNUSEDMSG = 1431655765, WPARAM = 130, LPARAM = 6148914689810433920, RESULT = 0}) at include/wincontrol.inc:5429
# 14 TCUSTOMFORM__WNDPROC(0x3f9b138, {MSG = 5, UNUSEDMSG = 1431655765, WPARAM = 130, LPARAM = 6148914689810433920, RESULT = 0}) at include/customform.inc:1455
# 15 TMAINIDEBAR__WNDPROC(0x3f9b138, {MSG = 5, UNUSEDMSG = 1431655765, WPARAM = 130, LPARAM = 6148914689810433920, RESULT = 0}) at mainbar.pas:553
# 16 DELIVERMESSAGE(0x3f9b138, ) at lclmessageglue.pas:112
# 17 DELIVERMESSAGE(0x3f9b138, ) at gtk2/gtk2proc.inc:3737
# 18 GTKWINDOWSTATEEVENTCB(0x2aedd30, 0x7fffffffc5e0, 0x3f9b138) at gtk2/gtk2callback.inc:1153
# 19 GTK2WSDELAYEDWINDOWSTATECHANGE(0x3f9b138) at gtk2/gtk2wsforms.pp:132
# 20 g_main_context_dispatch at :0
# 21 ?? at :0
# 22 g_main_context_iteration at :0
# 23 TGTK2WIDGETSET__APPPROCESSMESSAGES(0x2a7fd58) at gtk2/gtk2widgetset.inc:2355
# 24 TAPPLICATION__PROCESSMESSAGES(0x2a7d8d8) at include/application.inc:365
# 25 TCMDLINEDEBUGGER__WAITFORHANDLES(0x754b348, 0x7fffffffcb44, 0, 30) at cmdlinedebugger.pp:203
# 26 TCMDLINEDEBUGGER__READLINE(0x754b348, false, 30) at cmdlinedebugger.pp:549
# 27 TCMDLINEDEBUGGER__READLINE(0x754b348, 50) at cmdlinedebugger.pp:465
# 28 TGDBMIDEBUGGERCOMMANDEXECUTEBASE__PROCESSRUNNING(0x754afb8, 0x0, {STATE = DSNONE, VALUES = 0x0, FLAGS = []}, 0) at gdbmidebugger.pp:3188
# 29 RUNTOMAIN(0x76fd3a0 '0x7fc437f386f0', 0x7fffffffd1f0) at gdbmidebugger.pp:5411
# 30 TGDBMIDEBUGGERCOMMANDSTARTDEBUGGING__DOEXECUTE(0x754afb8) at gdbmidebugger.pp:5634
# 31 TGDBMIDEBUGGERCOMMAND__EXECUTE(0x754afb8) at gdbmidebugger.pp:12550
# 32 TGDBMIDEBUGGERBASE__RUNQUEUE(0x754b348) at gdbmidebugger.pp:8986
# 33 TGDBMIDEBUGGERBASE__QUEUECOMMAND(0x754b348, 0x754afb8, false) at gdbmidebugger.pp:9133
# 34 TGDBMIDEBUGGERBASE__STARTDEBUGGING(0x754b348, 0x78c8818) at gdbmidebugger.pp:9979
# 35 TGDBMIDEBUGGERBASE__STARTDEBUGGING(0x754b348, ECTCONTINUE) at gdbmidebugger.pp:9961
# 36 TGDBMIDEBUGGERBASE__GDBRUN(0x754b348) at gdbmidebugger.pp:9457
# 37 TGDBMIDEBUGGERBASE__REQUESTCOMMAND(0x754b348, DCRUN, 0x7fffffffdea0, -1, {CODE = 0x0, DATA = 0x0}) at gdbmidebugger.pp:9889
# 38 TDEBUGGERINTF__REQCMD(0x754b348, DCRUN, 0x7fffffffdea0, -1, {CODE = 0x0, DATA = 0x0}) at dbgintfdebuggerbase.pp:6220
# 39 TDEBUGGERINTF__REQCMD(0x754b348, DCRUN, 0x7fffffffdea0, -1) at dbgintfdebuggerbase.pp:6157
# 40 TDEBUGGERINTF__RUN(0x754b348) at dbgintfdebuggerbase.pp:6234
# 41 TDEBUGMANAGER__RUNDEBUGGER(0x3a2c9e8) at debugmanager.pas:2851
# 42 TDEBUGMANAGER__ONRUNTIMER(0x3a2c9e8, 0x3ea6d88) at debugmanager.pas:1064
# 43 TCUSTOMTIMER__DOONTIMER(0x3ea6d88) at customtimer.pas:175
# 44 TCUSTOMTIMER__TIMER(0x3ea6d88) at customtimer.pas:150
# 45 GTKTIMERCB(0x63b3ee8) at gtk2/gtk2callback.inc:2711
# 46 ?? at :0
# 47 g_main_context_dispatch at :0
# 48 ?? at :0
# 49 g_main_context_iteration at :0
# 50 TGTK2WIDGETSET__APPPROCESSMESSAGES(0x2a7fd58) at gtk2/gtk2widgetset.inc:2355
# 51 TAPPLICATION__HANDLEMESSAGE(0x2a7d8d8) at include/application.inc:1210
# 52 TAPPLICATION__RUNLOOP(0x2a7d8d8) at include/application.inc:1329
# 53 TWIDGETSET__APPRUN(0x2a7fd58, {Proc = {procedure (POINTER)} 0x7fffffffe2b0, Self = 0x2a7d8d8}) at include/interfacebase.inc:54
# 54 TAPPLICATION__RUN(0x2a7d8d8) at include/application.inc:1317
# 55 main at lazarus.pp:153


[BB: edited to fool Mantis]

Juha Manninen

2020-04-04 11:16

developer   ~0121890

Thanks for the debugger trace!
If I interpret it correctly, the problem is in procedure TMainIDEBar.DoSetMainIDEHeight at line:
   ClientHeight := ANewHeight;
In r62880 I added a comment there and assertions in function TMainIDEBar.CalcMainIDEHeight.
function TMainIDEBar.CalcNonClientHeight already has assertion so it must come from TMainIDEBar.CalcMainIDEHeight.
I don't see any obvious reason for the error.
Does it only happen with LCL-GTK2? I guess so.

Zeljan Rikalo

2020-04-05 16:01

developer   ~0121943

IMO, this issue is strongly related to 0028036.
See gtk2clientrect.diff at issue 0028036. Test example works ok BUT with this patch MainIDE window looks bad.
I don't know yet where are all workarounds inside gtk2 and what need to be changed to get it work properly.

@Cyrax, please apply patch gtk2clientrect.diff and rebuild IDE (I know that it will look bad - componentpalette and ide coolbar), but just to see if it still crashes.

Zeljan Rikalo

2020-04-05 16:30

developer   ~0121944

No, it's not related to 28036 since gtk2clientrect.diff patch isn't needed. There it works ok if we move ClientHeight := Panel.Top + Panel.Height into FormActivate. So it seem that gtk geometry isn't fully applied and calculated inside FormShow

Issue History

Date Modified Username Field Change
2018-10-03 01:38 Cyrax New Issue
2018-10-03 10:23 Juha Manninen Note Added: 0111223
2020-04-02 17:14 Cyrax Note Added: 0121850
2020-04-02 18:03 Bart Broersma Note Edited: 0121850 View Revisions
2020-04-04 11:16 Juha Manninen Note Added: 0121890
2020-04-05 11:01 Zeljan Rikalo Relationship added related to 0036874
2020-04-05 15:56 Zeljan Rikalo Relationship added related to 0028036
2020-04-05 16:01 Zeljan Rikalo Status new => feedback
2020-04-05 16:01 Zeljan Rikalo LazTarget => -
2020-04-05 16:01 Zeljan Rikalo Note Added: 0121943
2020-04-05 16:30 Zeljan Rikalo Note Added: 0121944
2020-04-13 18:20 Juha Manninen Relationship added has duplicate 0027830
2020-04-13 18:21 Juha Manninen Relationship deleted has duplicate 0027830
2020-04-13 18:22 Juha Manninen Relationship added has duplicate 0035889