void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.52k stars 2.12k forks source link

Prusa-slicer segfault on start, x86_64-musl, probably wxwidgets related #46687

Open Vaelatern opened 11 months ago

Vaelatern commented 11 months ago

Is this a new report?

Yes

System Info

Void 6.3.13_1 x86_64-musl GenuineIntel notuptodate rrnDDFFFFFFFFF

Package(s) Affected

PrusaSlicer-2.5.2_3, wxWidgets-common-3.2.2.1_1

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

Expected behaviour

Should be able to start

Actual behaviour

valgrind prusa-slicer
==21535== Memcheck, a memory error detector
==21535== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==21535== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info
==21535== Command: prusa-slicer
==21535==
[2023-10-15 02:27:58.110702] [0x00000000048e5780] [trace]   Initializing StaticPrintConfigs
==21535== Invalid read of size 8
==21535==    at 0x4E819B5: std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::alloca
in /usr/lib/libstdc++.so.6.0.30)
==21535==    by 0x8ABEBE5: wxTranslations::SetLanguage(wxLanguage) (in /usr/lib/libwx_baseu-3.2.so.0.
==21535==    by 0x9F7459: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x9F9281: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x9FB8C5: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x8A6E762: wxEntry(int&, wchar_t**) (in /usr/lib/libwx_baseu-3.2.so.0.2.1)
==21535==    by 0x9E289D: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x3EB985: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x3D08F3: main (in /usr/bin/prusa-slicer)
==21535==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==21535==
==21535==
==21535== Process terminating with default action of signal 11 (SIGSEGV)
==21535==  Access not within mapped region at address 0x0
==21535==    at 0x4E819B5: std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::alloca
in /usr/lib/libstdc++.so.6.0.30)
==21535==    by 0x8ABEBE5: wxTranslations::SetLanguage(wxLanguage) (in /usr/lib/libwx_baseu-3.2.so.0.
==21535==    by 0x9F7459: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x9F9281: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x9FB8C5: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x8A6E762: wxEntry(int&, wchar_t**) (in /usr/lib/libwx_baseu-3.2.so.0.2.1)
==21535==    by 0x9E289D: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x3EB985: ??? (in /usr/bin/prusa-slicer)
==21535==    by 0x3D08F3: main (in /usr/bin/prusa-slicer)
==21535==  If you believe this happened as a result of a stack
==21535==  overflow in your program's main thread (unlikely but
==21535==  possible), you can try to increase the size of the
==21535==  main thread stack using the --main-stacksize= flag.
==21535==  The main thread stack size used in this run was 8388608.
==21535==
==21535== HEAP SUMMARY:
==21535==     in use at exit: 3,159,707 bytes in 31,017 blocks
==21535==   total heap usage: 194,134 allocs, 163,117 frees, 14,153,766 bytes allocated
==21535==
==21535== LEAK SUMMARY:
==21535==    definitely lost: 0 bytes in 0 blocks
==21535==    indirectly lost: 0 bytes in 0 blocks
==21535==      possibly lost: 18,424 bytes in 2 blocks
==21535==    still reachable: 3,077,755 bytes in 30,360 blocks
==21535==                       of which reachable via heuristic:
==21535==                         newarray           : 3,936 bytes in 6 blocks
==21535==         suppressed: 5,152 bytes in 123 blocks
==21535== Rerun with --leak-check=full to see details of leaked memory
==21535==
==21535== For lists of detected and suppressed errors, rerun with: -s
==21535== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
zsh: segmentation fault  valgrind prusa-slicer

Steps to reproduce

sudo xbps-install -Su PrusaSlicer
prusa-slicer
sgn commented 11 months ago

Broken on glibc too. Due to breaking change in wxwidget

Vaelatern commented 11 months ago

Interestingly the dbg repo for x86_64-musl results in a prusa-slicer binary that has an exec format error on launch.

/usr/lib/debug/usr/bin/prusa-slicer: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter *empty*, BuildID[sha1]=75d716275ac4ba701be3c8062a2a09128e906a5d, with debug_info, not stripped

sgn commented 11 months ago

We may need this patch https://github.com/prusa3d/PrusaSlicer/commit/e21921f2ebd2b94c57459bd280f1b1bd8eec1b9c

Vaelatern commented 11 months ago

I'll test

Vaelatern commented 11 months ago

It'll need more than just that...

agausmann commented 11 months ago

Interestingly the dbg repo for x86_64-musl results in a prusa-slicer binary that has an exec format error on launch.

I think that's true for all dbg packages; they ship ELFs containing the debuginfo and not the machine code. Also partly evidenced by interpreter *empty*

Some tools like gdb will be able to locate the separate debuginfo file in /usr/debug. If the tool doesn't support that, you may be able to use eu-unstrip to recombine the two files

alpaca-ninetynine commented 11 months ago

Adding a backtrace from my experience of the segfault in case it helps figuring out what's going on, though I guess the referenced function is in the patch above.

0 0x00007ffff7d90ba5 in std::__cxx11::basic_string<wchar_t, std::char_traits, std::allocator >::_M_assign(std::__cxx11::basic_string<wchar_t, std::char_traits, std::allocator > const&) ()

from /usr/lib/libstdc++.so.6

1 0x00007ffff4198dc6 in wxTranslations::SetLanguage(wxLanguage) () from /usr/lib/libwx_baseu-3.2.so.0

2 0x0000555555e4165a in ?? ()

3 0x0000555555e434e2 in ?? ()

4 0x0000555555e45b26 in ?? ()

5 0x00007ffff4148b23 in wxEntry(int&, wchar_t**) () from /usr/lib/libwx_baseu-3.2.so.0

6 0x0000555555e2ccee in ?? ()

7 0x0000555555837ee6 in ?? ()

8 0x000055555581ce74 in main ()

Vaelatern commented 11 months ago

46799

kevcrumb commented 7 months ago

Any difference with the more recent 2.7 branch?