#19182: wx.GenericDirCtrl runtime error

32 views
Skip to first unread message

wxTrac

unread,
May 25, 2021, 10:45:06 AM5/25/21
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
--------------------------------------+--------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: samples | Version: 3.0.5
Keywords: wxTreeCtrl::GetItemParam | Blocked By:
Blocking: | Patch: 0
--------------------------------------+--------------------
When I run the demo GenericDirCtrl app, I can reproduce a runtime error
with the following steps:

1.Start the GenericDirCtrl app.
2.In the right side pane open up drive C to display the folders.
3.Change all files to python files. The error will popup a window.


treectrl.cpp(1066): assert "Item.IsOK()" failed in
wxTreeCtrl::GetItemParam()

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182>

wxTrac

unread,
May 25, 2021, 1:07:39 PM5/25/21
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
------------------------+--------------------------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: samples | Version: 3.0.5
Resolution: | Keywords: wxTreeCtrl::GetItemParam
Blocked By: | Blocking:
Patch: 0 |
------------------------+--------------------------------------

Comment (by vadz):

Sorry, what is the "GenericDirCtrl app"? We don't have any sample like
this, although we do have a page for this control in the widgets sample,
is this what you mean?

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182#comment:1>

wxTrac

unread,
Jun 10, 2021, 6:41:15 PM6/10/21
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
------------------------+--------------------------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: samples | Version: 3.0.5
Resolution: invalid | Keywords: wxTreeCtrl::GetItemParam
Blocked By: | Blocking:
Patch: 0 |
------------------------+--------------------------------------
Changes (by vadz):

* status: new => closed
* resolution: => invalid


Comment:

Can't do anything without knowing how to reproduce it.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182#comment:2>

wxTrac

unread,
Jun 18, 2021, 6:15:50 AM6/18/21
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
------------------------+--------------------------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: samples | Version: 3.0.5
Resolution: | Keywords: wxTreeCtrl::GetItemParam
Blocked By: | Blocking:
Patch: 0 |
------------------------+--------------------------------------
Changes (by rfresh737):

* status: closed => reopened
* cc: ralphfreshour@… (added)
* resolution: invalid =>


Comment:

>Can't do anything without knowing how to reproduce it.

I gave you the steps to reproduce it in my original post.

Are you saying you cannot reproduce this error following my steps?

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182#comment:3>

wxTrac

unread,
Jun 18, 2021, 7:53:04 AM6/18/21
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
------------------------+--------------------------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: samples | Version: 3.0.5
Resolution: invalid | Keywords: wxTreeCtrl::GetItemParam
Blocked By: | Blocking:
Patch: 0 |
------------------------+--------------------------------------
Changes (by pb101):

* cc: pbfordev@… (added)
* status: reopened => closed
* resolution: => invalid


Comment:

While there is not a single mention of Python in this ticket, my guess is
that rfresh737 confused wxWidgets library with Phoenix and filed the
ticket on wxTrac instead of https://github.com/wxWidgets/Phoenix/issues

While the issue may be in wxWidgets, it is first necessary to make sure
that the problem is not just with Phoenix's GenericDirCtrl.py demo (e.g.,
not accounting for situation where there are no files matching the
wildcard filter).

I do not Python so I cannot test it myself.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182#comment:4>

wxTrac

unread,
Jun 18, 2021, 9:31:57 AM6/18/21
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
------------------------+--------------------------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: samples | Version: 3.0.5
Resolution: | Keywords: wxTreeCtrl::GetItemParam
Blocked By: | Blocking:
Patch: 0 |
------------------------+--------------------------------------
Changes (by rfresh737):

* status: closed => reopened
* cc: ralphfreshour@… (removed)
* resolution: invalid =>


Comment:

This is my original post at discuss.wxpython.org:

https://discuss.wxpython.org/t/wx-genericdirctrl-runtime-error/35379

In that thread, Robin told me this:

"As shown in the dialog the popup is happening because a runtime assertion
failed in the C++ code for wxTreeCtrl. Please file a ticket about this at
trac.wxwidgets.org 1, if there isn’t one there already."

So that is what I was trying to do here.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182#comment:5>

wxTrac

unread,
Jun 18, 2021, 11:13:00 AM6/18/21
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
--------------------------+--------------------------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: GUI-generic | Version: 3.0.5
Resolution: | Keywords: wxTreeCtrl::GetItemParam
Blocked By: | Blocking:
Patch: 0 |
--------------------------+--------------------------------------
Changes (by vadz):

* component: samples => GUI-generic


Comment:

Replying to [comment:3 rfresh737]:
> >Can't do anything without knowing how to reproduce it.
>
> I gave you the steps to reproduce it in my original post.
>
> Are you saying you cannot reproduce this error following my steps?

I couldn't reproduce your steps because I didn't know what "demo
GenericDirCtrl app" was. I believe now that it's (part of) wxPython demo,
so I guess I could try building wxPython and reproducing it there, but it
would be much more convenient to have a simple example reproducing it. If
it's really a problem in wxWidgets itself (and not an error in the code
using it, which could also result in this assert), it should be possible
to reproduce it in the widgets sample, but I couldn't reproduce it there.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182#comment:6>

wxTrac

unread,
Jan 9, 2022, 3:21:04 PM1/9/22
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
--------------------------+--------------------------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: GUI-generic | Version: 3.0.5
Resolution: | Keywords: wxTreeCtrl::GetItemParam
Blocked By: | Blocking:
Patch: 0 |
--------------------------+--------------------------------------
Changes (by suurjaak):

* cc: erki@… (added)


Comment:

Can confirm that the problem exists in GenericDirCtrl, with latest
wxWidgets 3.1.5.

I am using wxPython like the OP, so I can't easily give sample C++ code.
But the steps to reproduce are simple:

- create a `GenericDirCtrl`
- select a file
- choose a different filter, or invoke `ReCreateTree()` directly

Result: failed assertion error at src\msw\treectrl.cpp(1066) in
wxTreeCtrl::GetItemParam(): invalid tree item.

The problem does not appear in wxWidgets 3.1.4.

Workaround I'm using for now: clear any selection from the control before
allowing content recreation.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182#comment:7>

wxTrac

unread,
Jan 9, 2022, 4:37:22 PM1/9/22
to wx-...@googlegroups.com
#19182: wx.GenericDirCtrl runtime error
--------------------------+--------------------------------------
Reporter: rfresh737 | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone:
Component: GUI-generic | Version: dev-latest
Resolution: | Keywords: wxTreeCtrl::GetItemParam
Blocked By: | Blocking:
Patch: 0 |
--------------------------+--------------------------------------
Changes (by pb101):

* status: reopened => confirmed
* cc: pbfordev@… (removed)
* version: 3.0.5 => dev-latest


Comment:

This can be reproduced in the widgets sample, at least on MSW:

1. Launch widgets sample.
2. Go to Generic/DirCtrl page.
3. In Flags check wxDIRCTRL_SHOWFILTERS.
4. In Filters check at least two filters.
5. Navigate to a folder where there are some files displayed.
6. Change the filter in the combobox under the control.
7. Observe the assert.

I did not have time to look into this.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19182#comment:8>
Reply all
Reply to author
Forward
0 new messages