`wxGenericListCtrl::GetColumn` fails with assertion error on invalid index instead of returning false (Issue #26337)

7 views
Skip to first unread message

Mia McMahill

unread,
Apr 2, 2026, 11:39:29 AM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed
electricbrass created an issue (wxWidgets/wxWidgets#26337)

Description

Bug description:

Calling wxGenericListCtrl::GetColumn with an invalid column index triggers an assertion error.

Expected vs observed behaviour:

From what I can find about this function, it should return true or false to indicate whether the column index given was valid or not. Being able to use it to check if a column exists should be possible, yet it is not because it fails with the assertion before it gets the chance to return false.

Stack trace:

ASSERT INFO:
../src/common/list.cpp(305): assert ""Assert failure"" failed in Item(): invalid index in wxListBase::Item

BACKTRACE:
[1] wxListBase::Item(unsigned long) const
[2] wxGenericListCtrl::GetColumn(int, wxListItem&) const
[3] LstOdaPlayerList::~LstOdaPlayerList() /home/mia/source/odamex/odalaunch/src/lst_players.cpp:205
[4] LstOdaPlayerList::~LstOdaPlayerList() /home/mia/source/odamex/odalaunch/src/lst_players.cpp:216
[5] wxWindowBase::Destroy()
[6] wxWindowBase::DestroyChildren()
[7] wxWindow::~wxWindow()
[8] wxWindowBase::Destroy()
[9] wxWindowBase::DestroyChildren()
[10] wxWindow::~wxWindow()
[11] wxSplitterWindow::~wxSplitterWindow()
[12] wxWindowBase::Destroy()
[13] wxWindowBase::DestroyChildren()
[14] wxWindow::~wxWindow()
[15] wxWindowBase::Destroy()
[16] wxWindowBase::DestroyChildren()
[17] wxWindow::~wxWindow()
[18] wxSplitterWindow::~wxSplitterWindow()
[19] wxWindowBase::Destroy()
[20] wxWindowBase::DestroyChildren()
[21] wxWindow::~wxWindow()
[22] wxWindowBase::Destroy()
[23] wxWindowBase::DestroyChildren()
[24] wxWindow::~wxWindow()
[25] wxFrame::~wxFrame() /usr/include/wx-3.2/wx/gtk/frame.h:16
[26] dlgMain::~dlgMain() /home/mia/source/odamex/odalaunch/src/dlg_main.cpp:297
[27] dlgMain::~dlgMain() /home/mia/source/odamex/odalaunch/src/dlg_main.cpp:297
[28] wxAppConsoleBase::DeletePendingObjects()
[29] wxAppConsoleBase::ProcessIdle()
[30] wxAppBase::ProcessIdle()
[31] wxApp::DoIdle()
[32] g_main_loop_run
[33] gtk_main
[34] wxGUIEventLoop::DoRun()
[35] wxEventLoopBase::Run()
[36] wxAppConsoleBase::MainLoop()
[37] wxEntry(int&, wchar_t**)
[38] main /home/mia/source/odamex/odalaunch/src/main.cpp:41
[39] __libc_start_main
[40] _start

Platform and version information

  • wxWidgets version you use: 3.2.8
  • wxWidgets port you use: wxGTK
  • OS and its version: Fedora Workstation 43
    • GTK version: 4.20.3
    • Which GDK backend is used: Wayland
    • Desktop environment : GNOME


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26337@github.com>

VZ

unread,
Apr 2, 2026, 5:23:28 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed

Closed #26337 as not planned.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/26337/issue_event/24161975640@github.com>

VZ

unread,
Apr 2, 2026, 5:23:29 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26337)

Sorry, your understanding of this function is incorrect. This is an accessor for the column and calling it with an invalid index is a programming error, use GetColumnCount() to ensure that this doesn't happen.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26337/4180554577@github.com>

Mia McMahill

unread,
Apr 2, 2026, 6:15:50 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed
electricbrass left a comment (wxWidgets/wxWidgets#26337)

I was unable to find any official documentation on this function, so all I had to go on was code that has been working for over a decade until now and some recommendations I found on using i this way. So I know how to best fix this code, what is the return value supposed to indicate?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26337/4180772715@github.com>

VZ

unread,
Apr 2, 2026, 6:23:21 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26337)

I don't understand how could it ever work, the assert was there ever since cf1dfa6 (virtual wxListCtrl support, 2001-07-06) even if it was changed a couple of times.

The return value is basically always true, i.e. for a valid column index the function can only return false if the native control fails to provide information about its column which never happens AFAIK. I'll update the official documentation to make it clear.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26337/4180798617@github.com>

Reply all
Reply to author
Forward
0 new messages