Author Topic: Assertion in JumpTracker  (Read 612 times)

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1788
Assertion in JumpTracker
« on: October 21, 2025, 01:51:41 pm »
I have just used C::B (current trunk) on Mint 18 and get an assertion when closing C::B. It only asserts with the release, not the debug version, so I have a limited backtrace.

Code
../src/generic/listctrl.cpp (3386)
assert "litem >= 0 && (size_t)litem < GetItemCount() failed in SetItemState(): invalid list ctrl item index in SetItem

Backtrace
Code
1 wxGenericListCtrl::SetItemState(long, long, long)
2 JumpTrackerView::SetJumpTrackerViewIndex(int)
3 JumpTracker::SetJumpTrackerViewIndex(int)
4 JumpTracker::JumpDataAdd(wxString const&, long, long)
5 JumpTracker::OnEditorActivated(CodeBlocksEvent&)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7809
    • My Best Post
Re: Assertion in JumpTracker
« Reply #1 on: October 21, 2025, 03:15:00 pm »
What wxWidgets version? I will see if the problems happens under Win10 MSys2 UCRT64.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1788
Re: Assertion in JumpTracker
« Reply #2 on: October 21, 2025, 03:24:25 pm »
wxWidgets 3.0.2 32 bits
GTK+ 2.24.30

Offline christo

  • Multiple posting newcomer
  • *
  • Posts: 59
Re: Assertion in JumpTracker
« Reply #3 on: October 21, 2025, 07:44:53 pm »
Hi Miguel Gimenez, I have seen such a crash earlier. https://github.com/josephch/codeblocks/commit/5be7d91c955a481a48abe545a86342e9b30f8ed7 should help with this as list item's index should be always less than item count.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2893
Re: Assertion in JumpTracker
« Reply #4 on: October 22, 2025, 07:34:37 am »
Hi Miguel Gimenez, I have seen such a crash earlier. https://github.com/josephch/codeblocks/commit/5be7d91c955a481a48abe545a86342e9b30f8ed7 should help with this as list item's index should be always less than item count.

I'll make the change and test awhile.

Thanks

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 568
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Assertion in JumpTracker
« Reply #5 on: October 22, 2025, 05:31:36 pm »
Leap-15.6-64bits, gcc-1520, wx-328, gtk3-unicode-3.2
Cb13752
Identical problem :
I did this :
Code
void SetJumpTrackerViewIndex(int itemIndex)
{
    if (itemIndex < 0)
return;
    int knt = m_pListCtrl->GetItemCount();
    if (knt < 0)
        return;
    if (itemIndex >= knt)
return; //setting index before adding the item

    m_pListCtrl->SetItemState(itemIndex, wxLIST_STATE_SELECTED                                                   , wxLIST_STATE_SELECTED);
}

I'm testing a day ...
« Last Edit: October 22, 2025, 05:33:16 pm by LETARTARE »
CB-13752, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-4.1.5
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2893
Re: Assertion in JumpTracker
« Reply #6 on: October 22, 2025, 08:09:51 pm »
Fixes applied svn 13753
Thanks