Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

../src/gtk/listbox.cpp(661): assert ""HasFlag(0x0020)"" failed in GetSelection(): must be single selection listbox #5152

Closed
pmjdebruijn opened this issue Nov 13, 2020 · 19 comments

Comments

@pmjdebruijn
Copy link
Contributor

Version

2.3.0~alpha3+83~gcd2b502c3

Operating system type + version

Xubuntu 20.04 with wxGTK 3.1.4

3D printer brand / version + firmware version (if known)

Creality Ender-3 BLTouch

Behavior

In the Configuration Wizard in the Filaments tab, I'm getting this, when I'm switching between filaments types after having pressed "Select All":

ASSERT INFO:
../src/gtk/listbox.cpp(661): assert ""HasFlag(0x0020)"" failed in GetSelection(): must be single selection listbox

BACKTRACE:
[1] wxListBox::GetSelection() const
[2] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[3] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[4] wxEvtHandler::TryHereOnly(wxEvent&)
[5] wxEvtHandler::ProcessEventLocally(wxEvent&)
[6] wxEvtHandler::ProcessEvent(wxEvent&)
[7] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[8] wxListBoxBase::SendEvent(int, int, bool)
[9] g_signal_emit_valist
[10] g_signal_emit
[11] g_signal_emit_valist
[12] g_signal_emit
[13] g_cclosure_marshal_VOID__BOXEDv
[14] g_signal_emit_valist
[15] g_signal_emit
[16] gtk_event_controller_handle_event
[17] g_closure_invoke
[18] g_signal_emit_valist
[19] g_signal_emit
[20] gtk_main_do_event
[21] g_main_context_dispatch
[22] g_main_loop_run
[23] gtk_main
[24] wxGUIEventLoop::DoRun()
[25] wxEventLoopBase::Run()
[26] wxDialog::ShowModal()
[27] wxEvtHandler::TryHereOnly(wxEvent&)
[28] wxEvtHandler::ProcessEventLocally(wxEvent&)
[29] wxEvtHandler::ProcessEvent(wxEvent&)
[30] wxEvtHandler::ProcessPendingEvents()
[31] wxAppConsoleBase::ProcessPendingEvents()
[32] wxApp::DoIdle()
[33] g_main_context_dispatch
[34] g_main_loop_run
[35] gtk_main
[36] wxGUIEventLoop::DoRun()
[37] wxEventLoopBase::Run()
[38] wxAppConsoleBase::MainLoop()
[39] wxEntry(int&, wchar_t**)
[40] __libc_start_main

@pmjdebruijn
Copy link
Contributor Author

This is still an issue in current master.

@pmjdebruijn
Copy link
Contributor Author

pmjdebruijn commented Dec 13, 2020

@YuSanka this issue still exists in beta3

@YuSanka
Copy link
Collaborator

YuSanka commented Dec 14, 2020

Unfortunately, I can't reproduce this issue

@bubnikv
Copy link
Collaborator

bubnikv commented Dec 14, 2020 via email

@bubnikv
Copy link
Collaborator

bubnikv commented Dec 14, 2020 via email

@pmjdebruijn
Copy link
Contributor Author

I mean, 3.1.4 is considered unstable by linux folk, distros insist on 3.0. We do compile against patched 3.1.3.

Well that's not that quite right. the WX project, still considers 3.1.x a development release, thus distro's in general are reluctant to ship it. The fact that the WX project encourages people to use 3.1 while not declaring it a stable release, is mixed messaging in a very bad way.

Why 3.1.3, and not 3.1.4? Patched how? Have those patches been upstreamed?

Why wxGTK 3.1.4? Where did you get it?

Because I noticed you were building against 3.1.x, so I thought I'd try it.

It's basically the debian packaging for 3.0.x locally updated for 3.1.4.

If I recall correctly this was reproducable using wxGTK 3.0.4, but I'll retest that and report back.

@bubnikv
Copy link
Collaborator

bubnikv commented Dec 14, 2020

Frankly this is how I feel supporting PrusaSlicer on Linux:

https://twitter.com/bubnikv/status/1337829698450186243
https://twitter.com/bubnikv/status/1337830053690961928
https://twitter.com/zaptac/status/1337934599914217472

Supporting Linux builds self compiled using "some" dependencies of an unknown state, linked against "some" wxWidgets and "some" GTK on "some" linux with "some" GTK skinning is so fragile, it really feels like the proverbial mole whacking.

I am seriously considering to support just our binary builds. If you compile yourself, you are on your own.

We do compile using patched wxWidgets and static libraries, those are compiled using the CMake scripts from the deps directory.

@pmjdebruijn
Copy link
Contributor Author

pmjdebruijn commented Dec 14, 2020

@YuSanka I just realized, I may have omited crucial information to reproduce (sorry about that):

mv .config/PrusaSlicer-beta/ .config/PrusaSlicer-beta-old/
Prusa FFF, Deselect "Original Prusa MINI & MINI+"
Other Vendors, Select Creality
Creality FFF, Select Ender 3 BLTouch
Filaments, Select PLA from "Type:" Column
Filaments, Select PETG from "Type:" Column
Filaments, Select ABS from "Type:" Column

@bubnikv while I sympatize that supporting Linux broadly can be painful at times, having worked on a nontrivial project some time ago. You're probably having a worse than average time than average probably due to WX, which I realize was inherited from slic3r...

I would implore you to try to keep supporting local builds at least on the large desktops distros like Fedora/Ubuntu, as the ability to build locally is critical for anybody to do any kind of contribution.

@bubnikv
Copy link
Collaborator

bubnikv commented Dec 14, 2020

I would implore you to try to keep supporting local builds

We certainly will support self compilation on Linux through the static deps build scripts.

@pmjdebruijn
Copy link
Contributor Author

I can't reproduce this with your AppImage builds.

This issue is reproducable with wxGTK 3.0.4 shipped with Ubuntu 20.04
It's also reproducable with wxGTK 3.0.5.1 backported to Ubuntu 20.04

@pmjdebruijn
Copy link
Contributor Author

I just noticed another thing, that might be related, when I enable all filament profiles for (say a newly added Ender3), it seems default_filament_profile is getting ignored, and the first filament in alphabetical search order is actually made default.

When only the default filament profiles are selected (when newly adding an Ender3), the default is honored. (This isn't obvious with the current Creality.ini, as Creality PLA is also the first in the search order, but when we change default_filament_profile = Generic PLA @CREALITY Generic PLA actually correctly becomes the default filament profile.

@pmjdebruijn
Copy link
Contributor Author

When I build against 3.1.3-patched (built locally outside of the Prusa deps build scripts), I still have this issue.

It seems the Prusa deps build script explicitly turn off assertions:
https://github.com/prusa3d/PrusaSlicer/blob/master/deps/wxWidgets/wxWidgets.cmake#L29
https://docs.wxwidgets.org/3.0/group__group__funcmacro__debug.html#ga7ce424d27d39bb92c26c80b6a1903725

But presumably those assertions are there for a reason, and the wx folks have consciously enabled them by default.

So this issue isn't related to wx3.0 vs 3.1.3-patched, your internal library builds are preventing these regression from being noticed during development.

While one might argue whether assertions should be enabled for production builds (even though the wx folks think so), during develop you should consider enabling assertions.

@pmjdebruijn
Copy link
Contributor Author

@pmjdebruijn
Copy link
Contributor Author

I just tested that adding wxDisableAsserts(); to GUI_App::OnInit(), seems to at least suppress these assert messages, until a proper fix can be worked out.

YuSanka added a commit that referenced this issue Feb 18, 2021
…t be single selection listbox

This assert was invoked by list_printer->GetSelection() because of list_printer was created with wxLB_MULTIPLE flag.
@YuSanka
Copy link
Collaborator

YuSanka commented Feb 18, 2021

I was finally able to reproduce this assert. Thanks for your report.

YuSanka added a commit that referenced this issue Feb 25, 2021
…t be single selection listbox

This assert was invoked by list_printer->GetSelection() because of list_printer was created with wxLB_MULTIPLE flag.
@cabbey
Copy link

cabbey commented Feb 28, 2021

@YuSanka the fix committed to correct this issue has broken building with wx 3.0 (aka stable)

buildbreak.log

@YuSanka
Copy link
Collaborator

YuSanka commented Mar 1, 2021

@YuSanka the fix committed to correct this issue has broken building with wx 3.0 (aka stable)

buildbreak.log

Thanks for your report. Fixed with 3f1299c.

@cabbey
Copy link

cabbey commented Mar 6, 2021

Thanks for your report. Fixed with 3f1299c.

Confirmed, thank you!

eyusupov pushed a commit to eyusupov/PrusaSlicer that referenced this issue May 6, 2021
…(): must be single selection listbox

This assert was invoked by list_printer->GetSelection() because of list_printer was created with wxLB_MULTIPLE flag.
@bubnikv
Copy link
Collaborator

bubnikv commented Aug 6, 2021

Fixed in upcoming PrusaSlicer 2.4.0-alpha1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants