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

Copy and paste troubles under Artix Linux #46

Open
halian opened this issue Aug 13, 2022 · 13 comments
Open

Copy and paste troubles under Artix Linux #46

halian opened this issue Aug 13, 2022 · 13 comments

Comments

@halian
Copy link

halian commented Aug 13, 2022

Per topic, when trying to run latest under Artix Linux (Arch derivative), it throws a bunch of socket errors when opening the program, then a bunch of format specifier errors when trying to open a set, the latter of which prove fatal. Here's the console output of one of the former:

halian@fireblade ~/A/M/build (master) [1]> ./magicseteditor 
Gtk-Message: 22:54:21.783: Failed to load module "colorreload-gtk-module"
/usr/src/debug/wxWidgets-3.2.0/src/common/socketiohandler.cpp(50): assert ""socket->m_fd != -1"" failed in Install_Callback(): shouldn't be called on invalid socket [in thread 7f9e85f826c0]


Call stack:
[01] wxSocketFDBasedManager::Install_Callback(wxSocketImpl*, wxSocketNotify)
[02] wxSocketImplUnix::DoEnableEvents(int, bool)
[03] wxSocketBase::SetFlags(int)             
[04] wxSocketBase::Peek(void*, unsigned int) 
[05] wxProtocol::ReadLine(wxSocketBase*, wxString&)
[06] wxHTTP::ParseHeaders()                  
[07] wxHTTP::BuildRequest(wxString const&, wxString const&)
[08] wxHTTP::GetInputStream(wxString const&) 
[09] wxURL::GetInputStream()                 
[10] 0x55e350059031
[11] 0x55e350058fc3
[12] wxThread::CallEntry()                   
[13] wxThreadInternal::PthreadStart(wxThread*)
[14] 0x7f9e8be9978d
[15] __clone                                 

and the backtrace of one of the latter:

ASSERT INFO:
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type

BACKTRACE:
[1] wxStackWalker::ProcessFrames(unsigned long)
[2] wxStackWalker::Walk(unsigned long, unsigned long)
[3] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[4] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[5] wxEvtHandler::TryHereOnly(wxEvent&)
[6] wxEvtHandler::ProcessEventLocally(wxEvent&)
[7] wxEvtHandler::ProcessEvent(wxEvent&)
[8] wxWindowBase::TryAfter(wxEvent&)
[9] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[10] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[11] wxEvtHandler::TryHereOnly(wxEvent&)
[12] wxEvtHandler::ProcessEventLocally(wxEvent&)
[13] wxEvtHandler::ProcessEvent(wxEvent&)
[14] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[15] g_closure_invoke
[16] g_signal_emit_valist
[17] g_signal_emit
[18] gtk_main_do_event
[19] g_main_context_dispatch
[20] g_main_loop_run
[21] gtk_main
[22] wxGUIEventLoop::DoRun()
[23] wxEventLoopBase::Run()
[24] wxAppConsoleBase::MainLoop()
[25] wxEntry(int&, wchar_t**)
[26] __libc_start_main

Additionally, while not show-stopping, scrollable areas (e.g. the new set scene) will refuse to scroll past a point where the selected item is on the edge of the list.

@haganbmj
Copy link
Owner

haganbmj commented Aug 14, 2022

Do you happen to know if these are pre-existing issues from the old 2.1.2 or 2.0.0 releases? I know Linux builds have never been a well vetted thing. There are multiple PRs and issues on the main repo related to it.

The first issue is probably related to the Update checking that happens on startup as it's the only thing I'm aware of making http calls. It causes issues on macOS as well I know.

If you change CHECK_IF_CONNECTED to CHECK_NEVER on this line in settings.cpp that'll make the default behavior not to check. That's stored in the user settings though, so if you already loaded and stored settings you might already have a "check" flag stored.

, check_updates (CHECK_IF_CONNECTED)

If that's the case then it's probably easier to just disable update checking where it actually tries to do it. Either by returning immediately or commenting out the check_updates() or Work() methods.

void check_updates() {

I think it's probably safe at this point to just disable/remove the updater entirely. The updates url points at sourceforge which wasn't updated even during that burst of activity in 2021 and still refers to 2.0.0 when the checker runs..

@haganbmj
Copy link
Owner

Ah, I see one of those alluded to PRs if yours. heh
twanvl#124

@halian
Copy link
Author

halian commented Aug 14, 2022

Commenting out the update check does indeed fix the socket issues, but not the format specifier SIGTRAPping.

@halian
Copy link
Author

halian commented Aug 14, 2022

If I suppress dialog generation when the format specifier error pops up and hit Continue, the last line of the console output is as follows:

magicseteditor: /usr/include/boost/smart_ptr/intrusive_ptr.hpp:199: T* boost::intrusive_ptr<T>::operator->() const [with T = Set]: Assertion `px != 0' failed.

@haganbmj
Copy link
Owner

haganbmj commented Aug 14, 2022

I'm a bit confused on why I don't see this call in your backtrace.

magicseteditor.exe!MSE::HandleEvent(wxEvtHandler * handler, void(wxEvtHandler::*)(wxEvent &) func, wxEvent & event) Line 305

I'm seeing that in the middle of my call stacks between wxEventHashTable and wxArgNormalizer because it looks like MSE defines a wrapped handler that swallows internal exceptions to print them to console.
Regardless, nothing in the call stack seems to point back to what's generating the event call. Maybe it's some character encoding thing? There's a bunch of logic in that area for utf-8 vs unicode.

Does the old 2.1.2 build that you had that PR against run? That'd at least help to narrow it down to changes that I've made. I do have some changes around keycode event handling for unicode text entry, but I wouldn't expect that to crash on load... I'd assume it would wait until text input or something.
https://github.com/haganbmj/MagicSetEditor2/pull/28/files

EDIT: Disregard a bunch of that. t = Set eliminates a lot of that, I'll have a read through to see if there's some spot where you can reference a null Set pointer. Any chance you're able to debug and see if MSE even gets as far as loading the package and trying to draw the cards panel?
That'd be in the close() method of welcome_window.cpp

if (!set) return;

@halian
Copy link
Author

halian commented Aug 15, 2022

I'll admit that I know nothing about debugging Linux binaries, or indeed binaries on any platform. :(

@halian
Copy link
Author

halian commented Aug 15, 2022

Here's what I get from doing a gdb bt on the above crash:

halian@fireblade ~/A/M/build (master)> gdb magicseteditor 
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from magicseteditor...
(gdb) r
Starting program: /home/halian/Applications/MagicSetEditor2/build/magicseteditor 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff1f3c6c0 (LWP 581)]
[New Thread 0x7ffff173b6c0 (LWP 582)]
Gtk-Message: 22:10:12.176: Failed to load module "colorreload-gtk-module"
[New Thread 0x7ffff0e976c0 (LWP 583)]
[New Thread 0x7fffe3fff6c0 (LWP 584)]
[Thread 0x7fffe3fff6c0 (LWP 584) exited]
[New Thread 0x7fffe3fff6c0 (LWP 585)]
[New Thread 0x7fffe25086c0 (LWP 586)]
[Thread 0x7fffe3fff6c0 (LWP 585) exited]
[New Thread 0x7fffe3fff6c0 (LWP 587)]
[New Thread 0x7fffe13896c0 (LWP 588)]
[Thread 0x7fffe3fff6c0 (LWP 587) exited]
[New Thread 0x7fffe3fff6c0 (LWP 589)]
[New Thread 0x7fffe08d16c0 (LWP 590)]
[Thread 0x7fffe25086c0 (LWP 586) exited]
[Thread 0x7fffe3fff6c0 (LWP 589) exited]
[Thread 0x7fffe13896c0 (LWP 588) exited]
[Thread 0x7fffe08d16c0 (LWP 590) exited]
[New Thread 0x7fffe08d16c0 (LWP 618)]
[New Thread 0x7fffe13896c0 (LWP 619)]
[Thread 0x7fffe08d16c0 (LWP 618) exited]
[New Thread 0x7fffe08d16c0 (LWP 620)]
[New Thread 0x7fffe3fff6c0 (LWP 621)]
[Thread 0x7fffe08d16c0 (LWP 620) exited]
[New Thread 0x7fffe08d16c0 (LWP 622)]
[New Thread 0x7fffe25086c0 (LWP 623)]
[Thread 0x7fffe13896c0 (LWP 619) exited]
[Thread 0x7fffe08d16c0 (LWP 622) exited]
[Thread 0x7fffe3fff6c0 (LWP 621) exited]
[Thread 0x7fffe25086c0 (LWP 623) exited]
[New Thread 0x7fffe25086c0 (LWP 624)]
[New Thread 0x7fffe3fff6c0 (LWP 627)]
[Thread 0x7fffe25086c0 (LWP 624) exited]
[Thread 0x7fffe3fff6c0 (LWP 627) exited]
[New Thread 0x7fffe3fff6c0 (LWP 669)]
[New Thread 0x7fffe25086c0 (LWP 670)]
[Thread 0x7fffe3fff6c0 (LWP 669) exited]
[Thread 0x7fffe25086c0 (LWP 670) exited]
[New Thread 0x7fffe25086c0 (LWP 673)]
[New Thread 0x7fffe3fff6c0 (LWP 674)]
[Thread 0x7fffe25086c0 (LWP 673) exited]
[Thread 0x7fffe3fff6c0 (LWP 674) exited]
[New Thread 0x7fffe3fff6c0 (LWP 675)]
[New Thread 0x7fffe25086c0 (LWP 676)]
[Thread 0x7fffe3fff6c0 (LWP 675) exited]
[New Thread 0x7fffe3fff6c0 (LWP 677)]
[New Thread 0x7fffe08d16c0 (LWP 678)]
[Thread 0x7fffe3fff6c0 (LWP 677) exited]
[New Thread 0x7fffe3fff6c0 (LWP 679)]
[New Thread 0x7fffe13896c0 (LWP 680)]
[Thread 0x7fffe3fff6c0 (LWP 679) exited]
[Thread 0x7fffe25086c0 (LWP 676) exited]
[Thread 0x7fffe08d16c0 (LWP 678) exited]
[Thread 0x7fffe13896c0 (LWP 680) exited]
[Thread 0x7ffff0e976c0 (LWP 583) exited]
[Detaching after vfork from child process 788]
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
[New Thread 0x7ffff0e976c0 (LWP 789)]
[New Thread 0x7fffe13896c0 (LWP 790)]
[Thread 0x7ffff0e976c0 (LWP 789) exited]
[Thread 0x7fffe13896c0 (LWP 790) exited]
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
/usr/include/wx-3.2/wx/strvararg.h(484): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
magicseteditor: /usr/include/boost/smart_ptr/intrusive_ptr.hpp:199: T* boost::intrusive_ptr<T>::operator->() const [with T = Set]: Assertion `px != 0' failed.

Thread 1 "magicseteditor" received signal SIGABRT, Aborted.
0x00007ffff6db04dc in ?? () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff6db04dc in  () at /usr/lib/libc.so.6
#1  0x00007ffff6d60998 in raise () at /usr/lib/libc.so.6
#2  0x00007ffff6d4a53d in abort () at /usr/lib/libc.so.6
#3  0x00007ffff6d4a45c in  () at /usr/lib/libc.so.6
#4  0x00007ffff6d594c6 in  () at /usr/lib/libc.so.6
#5  0x0000555555640746 in boost::intrusive_ptr<Set>::operator->() const (this=0x555556be60b8) at /usr/include/boost/smart_ptr/intrusive_ptr.hpp:199
#6  0x000055555586e37c in SetWindow::onUpdateUI(wxUpdateUIEvent&) (this=0x555556be5c90, ev=...) at /home/halian/Applications/MagicSetEditor2/src/gui/set/window.cpp:501
#7  0x00005555558cea41 in MSE::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const
     (this=0x555555c92400, handler=0x555556be5c90, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x55555586e284 <SetWindow::onUpdateUI(wxUpdateUIEvent&)>, event=...) at /home/halian/Applications/MagicSetEditor2/src/main.cpp:305
#8  0x00007ffff75dc5b2 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#9  0x00007ffff75dc94c in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () at /usr/lib/libwx_baseu-3.2.so.0
#10 0x00007ffff75df36f in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#11 0x00007ffff75df3ef in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#12 0x00007ffff75df50a in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#13 0x00007ffff7b32930 in wxWindowBase::TryAfter(wxEvent&) () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#14 0x00007ffff7b1e532 in wxToolBarBase::UpdateWindowUI(long) () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#15 0x00007ffff7a8ef12 in wxFrameBase::UpdateWindowUI(long) () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#16 0x00007ffff7a8f00e in wxFrameBase::OnInternalIdle() () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#17 0x00007ffff7b33e27 in wxWindowBase::SendIdleEvents(wxIdleEvent&) () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#18 0x00007ffff7ce583a in wxFrame::SendIdleEvents(wxIdleEvent&) () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#19 0x00007ffff7a100de in wxAppBase::ProcessIdle() () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#20 0x00007ffff7c5d26f in wxApp::DoIdle() () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#21 0x00007ffff7c5d3a8 in  () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#22 0x00007ffff5f75c6b in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#23 0x00007ffff5fcc001 in  () at /usr/lib/libglib-2.0.so.0
#24 0x00007ffff5f751cf in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#25 0x00007ffff66a6b33 in gtk_dialog_run () at /usr/lib/libgtk-3.so.0
#26 0x00007ffff7cfac04 in wxMessageDialog::ShowModal() () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#27 0x00007ffff7c5a1b4 in wxMessageBox(wxString const&, wxString const&, long, wxWindow*, int, int) () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#28 0x0000555555966ff1 in queue_message(MessageType, wxString const&) (type=MESSAGE_FATAL_ERROR, msg=...) at /home/halian/Applications/MagicSetEditor2/src/util/error.cpp:174
#29 0x0000555555967128 in handle_error(Error const&) (e=...) at /home/halian/Applications/MagicSetEditor2/src/util/error.cpp:183
#30 0x00005555558a87d1 in load_resource_image(wxString const&) (name=...) at /home/halian/Applications/MagicSetEditor2/src/gui/util.cpp:333
#31 0x00005555558a8fbf in load_resource_tool_image(wxString const&) (name=...) at /home/halian/Applications/MagicSetEditor2/src/gui/util.cpp:362
#32 0x00005555558a77cb in set_menu_item_image(wxMenuItem*, wxString const&) (item=0x555555f10b40, resource=...) at /home/halian/Applications/MagicSetEditor2/src/gui/util.cpp:247
#33 0x00005555558a7ac6 in make_menu_item_tr(wxMenu*, int, char const*, wxString const&, wxItemKind, wxMenu*) (menu=0x555555f14150, id=8118, resource=0x555555a005a2 "clear_console", locale_key=..., kind=wxITEM_NORMAL, submenu=0x0)
    at /home/halian/Applications/MagicSetEditor2/src/gui/util.cpp:258
#34 0x00005555558a7c08 in add_menu_item_tr(wxMenu*, int, char const*, wxString const&, wxItemKind, wxMenu*) (menu=0x555555f14150, id=8118, resource=0x555555a005a2 "clear_console", locale_key=..., kind=wxITEM_NORMAL, submenu=0x0)
    at /home/halian/Applications/MagicSetEditor2/src/gui/util.cpp:267
#35 0x0000555555845e5d in ConsolePanel::ConsolePanel(wxWindow*, int) (this=0x555555fb6c90, parent=0x555556be5c90, id=-1) at /home/halian/Applications/MagicSetEditor2/src/gui/set/console_panel.cpp:521
#36 0x000055555586b41e in SetWindow::SetWindow(wxWindow*, boost::intrusive_ptr<Set> const&) (this=0x555556be5c90, parent=0x0, set=...) at /home/halian/Applications/MagicSetEditor2/src/gui/set/window.cpp:154
#37 0x00005555558caf88 in WelcomeWindow::close(boost::intrusive_ptr<Set> const&) (this=0x555555d49fb0, set=...) at /home/halian/Applications/MagicSetEditor2/src/gui/welcome_window.cpp:127
#38 0x00005555558cab80 in WelcomeWindow::onNewSet(wxCommandEvent&) (this=0x555555d49fb0) at /home/halian/Applications/MagicSetEditor2/src/gui/welcome_window.cpp:104
#39 0x00005555558cea41 in MSE::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const
     (this=0x555555c92400, handler=0x555555d49fb0, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x5555558cab3a <WelcomeWindow::onNewSet(wxCommandEvent&)>, event=...) at /home/halian/Applications/MagicSetEditor2/src/main.cpp:305
#40 0x00007ffff75dc5b2 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#41 0x00007ffff75dc94c in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () at /usr/lib/libwx_baseu-3.2.so.0
#42 0x00007ffff75df36f in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#43 0x00007ffff75df3ef in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#44 0x00007ffff75df50a in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#45 0x00007ffff7b32930 in wxWindowBase::TryAfter(wxEvent&) () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#46 0x00005555557b0f4f in HoverButtonBase::onClick() (this=0x555555e83410) at /home/halian/Applications/MagicSetEditor2/src/gui/about_window.cpp:134
#47 0x00005555557b0dd3 in HoverButtonBase::onLeftUp(wxMouseEvent&) (this=0x555555e83410) at /home/halian/Applications/MagicSetEditor2/src/gui/about_window.cpp:106
#48 0x00005555558cea41 in MSE::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const
     (this=0x555555c92400, handler=0x555555e83410, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x5555557b0d4e <HoverButtonBase::onLeftUp(wxMouseEvent&)>, event=...) at /home/halian/Applications/MagicSetEditor2/src/main.cpp:305
--Type <RET> for more, q to quit, c to continue without paging--c
#49 0x00007ffff75dc5b2 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#50 0x00007ffff75dc94c in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () at /usr/lib/libwx_baseu-3.2.so.0
#51 0x00007ffff75df36f in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#52 0x00007ffff75df3ef in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#53 0x00007ffff75df50a in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#54 0x00007ffff75dfebb in wxEvtHandler::SafelyProcessEvent(wxEvent&) () at /usr/lib/libwx_baseu-3.2.so.0
#55 0x00007ffff7c98fc8 in  () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#56 0x00007ffff65eafd8 in  () at /usr/lib/libgtk-3.so.0
#57 0x00007ffff6073fd0 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#58 0x00007ffff60a0798 in  () at /usr/lib/libgobject-2.0.so.0
#59 0x00007ffff609162c in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#60 0x00007ffff6091e74 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#61 0x00007ffff68aa5d5 in  () at /usr/lib/libgtk-3.so.0
#62 0x00007ffff6747eab in  () at /usr/lib/libgtk-3.so.0
#63 0x00007ffff6748d8b in gtk_main_do_event () at /usr/lib/libgtk-3.so.0
#64 0x00007ffff64abcc3 in  () at /usr/lib/libgdk-3.so.0
#65 0x00007ffff64fa068 in  () at /usr/lib/libgdk-3.so.0
#66 0x00007ffff5f75c6b in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#67 0x00007ffff5fcc001 in  () at /usr/lib/libglib-2.0.so.0
#68 0x00007ffff5f751cf in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#69 0x00007ffff673ebef in gtk_main () at /usr/lib/libgtk-3.so.0
#70 0x00007ffff7c72f66 in wxGUIEventLoop::DoRun() () at /usr/lib/libwx_gtk3u_core-3.2.so.0
#71 0x00007ffff7529862 in wxEventLoopBase::Run() () at /usr/lib/libwx_baseu-3.2.so.0
#72 0x00007ffff7505f08 in wxAppConsoleBase::MainLoop() () at /usr/lib/libwx_baseu-3.2.so.0
#73 0x00005555558ce98a in MSE::runGUI() (this=0x555555c92400) at /home/halian/Applications/MagicSetEditor2/src/main.cpp:288
#74 0x00005555558ce1f0 in MSE::OnRun() (this=0x555555c92400) at /home/halian/Applications/MagicSetEditor2/src/main.cpp:279
#75 0x00007ffff7567fa0 in wxEntry(int&, wchar_t**) () at /usr/lib/libwx_baseu-3.2.so.0
#76 0x00005555558cbc30 in main(int, char**) (argc=1, argv=0x7fffffffe578) at /home/halian/Applications/MagicSetEditor2/src/main.cpp:61
(gdb) 

@haganbmj
Copy link
Owner

Okay, well there's a failure in there trying to load an icon for clear console, which would be new to this fork.
That's packaged into the build on Windows via a resource definition, but Linux might be loading it from a directory?

https://github.com/haganbmj/MagicSetEditor2/blob/master/resource/win32_res.rc
https://github.com/haganbmj/MagicSetEditor2/blob/master/resource/tool/clear_console.png

There's a few other new icons in there as well (underline, shape_align_*), so if there's some directory where those live then it's probably worth just copying everything.

The last line referenced is to building up the menus, and that's where it actually fails to find a Set - but I need to read a bit more to see if that could be the result of the resource issue.

case ID_FILE_SAVE: ev.Enable(!set->actions.atSavePoint() || set->needSaveAs()); break;

@haganbmj
Copy link
Owner

Hm, when I break that icon I do get a similar call stack and a fatal error about loading the resource.
That results in a dedicated error window and keeps me on the Welcome window, though, rather than a hard crash apparently.

mse_resource_issue1

mse_resource_issue2

@halian
Copy link
Author

halian commented Aug 15, 2022

Yeah, Linux has a ~/.magicseteditor/resource/ directory, into which I just realized I forgot to put the 2.3-specific stuff, lmao. Copying the new stuff in fixes the bug. Consider my visor well and truly egged. XwX

Now, that said, when I try to copy and paste a card, I get a new and exciting error:

ASSERT INFO:
/usr/src/debug/wxWidgets-3.2.0/src/gtk/clipbrd.cpp(753): assert ""m_formatSupported"" failed in GetData(): error retrieving data from clipboard

BACKTRACE:
[1] wxClipboard::GetData(wxDataObject&)
[2] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[3] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[4] wxEvtHandler::TryHereOnly(wxEvent&)
[5] wxEvtHandler::ProcessEventLocally(wxEvent&)
[6] wxEvtHandler::ProcessEvent(wxEvent&)
[7] wxWindowBase::TryAfter(wxEvent&)
[8] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[9] wxMenuBase::DoProcessEvent(wxMenuBase*, wxEvent&, wxWindow*)
[10] wxMenuBase::SendEvent(int, int)
[11] g_closure_invoke
[12] g_signal_emit_valist
[13] g_signal_emit
[14] g_closure_invoke
[15] g_signal_emit_valist
[16] g_signal_emit
[17] gtk_accel_group_activate
[18] gtk_accel_groups_activate
[19] gtk_window_activate_key
[20] g_closure_invoke
[21] g_signal_emit_valist
[22] g_signal_emit
[23] gtk_main_do_event
[24] g_main_context_dispatch
[25] g_main_loop_run
[26] gtk_main
[27] wxGUIEventLoop::DoRun()
[28] wxEventLoopBase::Run()
[29] wxAppConsoleBase::MainLoop()
[30] wxEntry(int&, wchar_t**)
[31] __libc_start_main

@halian halian changed the title Socket and format specifier troubles under Artix Linux Copy and paste troubles under Artix Linux Aug 15, 2022
@haganbmj
Copy link
Owner

Yay, at least we made some progress.
So that leaves the list box issue you mentioned with being unable to scroll past the selection and this clipboard thing. I'll give it a dig this evening.

@haganbmj
Copy link
Owner

So looks like your build is using GTK, while the Windows one uses MSW.
I can see the block here, but trying to get an understanding of it is tricky.

https://github.com/wxWidgets/wxWidgets/blob/v3.2.0/src/gtk/clipbrd.cpp#L737-L755

If copy/paste is working in other places then it's probably something to do with unmarshaling the clipboard into a custom object? Which is in this block

https://github.com/twanvl/MagicSetEditor2/blob/f9d9356d51f28210ccf0c0dda508502f222e1def/src/gui/control/card_list.cpp#L159-L165

On MSW there's all this checking for known formats and such, but the paste here falls through and uses that TYMED_HGLOBAL definition...

https://github.com/wxWidgets/wxWidgets/blob/8c9b09dfa95a5ea8d4d1df2da01183b2dc1cb3ce/src/msw/clipbrd.cpp#L797-L846


There's some interesting behavior that I didn't know MSE did here to put single cards onto the clipboard as images as well.

https://github.com/twanvl/MagicSetEditor2/blob/master/src/data/format/clipboard.cpp#L143-L153

Just out of sheer curiosity, if you copy 2 cards does it work since it would bypass that behavior?
And if you copy a single card can you paste it as an image?

@haganbmj
Copy link
Owner

haganbmj commented Aug 16, 2022

https://github.com/wxWidgets/wxWidgets/blob/db3e54b3dc5a4af812dea6e3945a2339ab01cbe2/src/common/dobjcmn.cpp#L408-L416

So for me on Windows MSE falls through to this call here when getting the GetDataSize of the object on the clipboard, which is used in that failing check. There's an explicit callout there that this particular method only works on Windows, but it looks like there are a bunch of other implementations above that might be getting used for other platforms.

In another area there's a mention that implementations should override the method and specify their own, though...

https://github.com/wxWidgets/wxWidgets/blob/db3e54b3dc5a4af812dea6e3945a2339ab01cbe2/include/wx/dataobj.h#L416-L420

So I'm going to take a stab at implementing that and see if maybe that's what's going on here?

My expectation would be that this fails for copy/pasting Keywords as well since that's also a custom implementation.

EDIT: When you have the opportunity could you try the following change? (b2a94b1) It's on branch linux-clipboard

haganbmj added a commit that referenced this issue Aug 16, 2022
…#46)

Both are wxTextDataObject, which looks to have a default implementation on Windows at least. Unclear how it's resolving on Linux, so hoping that this ensures the behavior.
haganbmj added a commit that referenced this issue Aug 16, 2022
…#46)

Both are wxTextDataObject, which looks to have a default implementation on Windows at least. Unclear how it's resolving on Linux, so hoping that this ensures the behavior.
Zekromaster pushed a commit to Zekromaster/MagicSetEditor2 that referenced this issue Mar 26, 2024
…haganbmj#46)

Both are wxTextDataObject, which looks to have a default implementation on Windows at least. Unclear how it's resolving on Linux, so hoping that this ensures the behavior.
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

2 participants