Recent

Author Topic: [SOLVED] Error "List index (0) out of bounds" while opening form in IDE on Linux  (Read 17623 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Hi, guys! If i open my project in IDE on Windows (XP, 7, 10 - any) its opens normally. If i open same project in Lazarus on my Ubuntu Mate 16.04 x64 desktop, i see error: "List index (0) out of bounds".
@Unvictis, are you still reading this forum?
I can reproduce the issue :
  http://bugs.freepascal.org/view.php?id=31380
and I debugged it for a long time. See my note there.
To reproduce on different platforms you should build the IDE with all possible debug flags, including -gt or -gtt.
Even then it may not reproduce everywhere. Linux may be better for debugging such issues than WinXP.

I hope either my workaround or a proper fix by Jesus Reyes will be merged to Lazarus 1.8.

After some testings, I found the culprit. I can't explain why, but I have solution to fix the error.

Use your text editor to open fDevEditor.pas and add dgIndicator in the line 125. So it will become:
Quote
Options = [dgIndicator, dgColumnResize, dgColumnMove, dgTabs, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgTruncCellHints]
Did you figure it out without studying the code? Quite amazing!
The reason can be seen in function TCustomDBGrid.UpdateGridCounts.
With dgIndicator both column count and row count are incremented -> the columns are not cleared later.
This forum thread is marked as [SOLVED]. It is not solved yet but now we are closer.  :)
« Last Edit: September 22, 2017, 03:49:47 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
I fixed it myself. Please test.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018