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

OrcaSlicer crashes on connecting to Klipper UI, and gets (almost) permanently corrupted - Linux, NixOS 24.11 #8243

Open
3 tasks done
TYTheBeast opened this issue Jan 29, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@TYTheBeast
Copy link

Is there an existing issue for this problem?

  • I have searched the existing issues

OrcaSlicer Version

2.2.0

Operating System (OS)

Linux

OS Version

NixOS 24.11

Additional system information

Kernel: Linux 6.6.72
Uptime: 1 day, 11 hours, 20 mins
Packages: 3520 (nix-system), 2136 (nix-user), 5 (flatpak)
Shell: fish 3.7.1
Display (DELL 1907FPV): 1024x1280 @ 75 Hz in 19" [External]
Display (27E1QA): 2560x1440 @ 144 Hz (as 2048x1152) in 27" [External] *
DE: KDE Plasma
WM: KWin (Wayland)
WM Theme: Layan
Theme: Breeze (Layan) [Qt], Layan-Dark [GTK2/3/4]
Icons: Papirus-Dark [Qt], Papirus-Dark [GTK2/3/4]
Font: Noto Sans (10pt) [Qt], Noto Sans (10pt) [GTK2/3/4]
Cursor: GoogleDot-Black (24px)
Terminal: .konsole-wrappe
CPU: AMD Ryzen 5 7600X (12) @ 5.45 GHz
GPU: AMD Radeon RX 7900 XT [Discrete]
Memory: 11.51 GiB / 31.09 GiB (37%)
Swap: 1.41 GiB / 33.20 GiB (4%)
Disk (/): 268.85 GiB / 598.00 GiB (45%) - btrfs
Local IP (wlp10s0): 192.168.1.22/24
Locale: en_US.UTF-8

Printer

Neptune 4

How to reproduce

  1. Open OrcaSlicer
  2. Go to Prepare or Preview
  3. Click the little WiFi icon near the printer's edit button
    Image
  4. Enter the various details required: IP, Device UI, API Key
  5. Click Ok
  6. OrcaSlicer is now corrupted until ~/,config/OrcaSlicer and ~/.local/share/orca-slicer are deleted or cleared.

Actual results

A beautiful SEGFAULT appears if trying this through the terminal, oh the lovely landscape of C++!

Expected results

I would expect OrcaSlicer to allow me to send files to my printer.

Project file & Debug log uploads

OrcaSlicer Bug Report.zip
log.zip

Checklist of files to include

  • Log file
  • Project file

Anything else?

Here's a link to a demonstration / official video bug report for this issue.

@TYTheBeast TYTheBeast added the bug Something isn't working label Jan 29, 2025
@eras
Copy link

eras commented Feb 2, 2025

I am facing the same issue when adding an OctoPrint/Klipper connectivity to OrcaSlicer.

I did a bit debugging by compiling it with debug info enabled and I got this backtrace with gdb:

Thread 1 "orcaslicer_main" received signal SIGSEGV, Segmentation fault.
webkitWebViewBaseEnterAcceleratedCompositingMode () at ./Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:2938
Download failed: Invalid argument.  Continuing without source file ./build-soup2/./Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp.  
2938	./Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp: No such file or directory.
(gdb) where
#0  webkitWebViewBaseEnterAcceleratedCompositingMode(_WebKitWebViewBase*, WebKit::LayerTreeContext const&) ()
    at ./Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:2938
#1  0x00007ffff276fd38 in WebKit::WebPageProxy::enterAcceleratedCompositingMode(WebKit::LayerTreeContext const&) ()
    at ./Source/WebKit/UIProcess/WebPageProxy.cpp:10741
#2  0x00007ffff28a9f4e in WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode(WebKit::LayerTreeContext const&) ()
    at ./Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:237
#3  0x00007ffff24192a0 in _ZZN3IPC18callMemberFunctionIN6WebKit16DrawingAreaProxyES2_FvmRKNS1_16LayerTreeContextEESt5tupleIJmS3_EEEEvPT_MT0_T1_OT2_ENKUlDpOT_E_clIJmS3_EEEDaSI_ () at ./Source/WebKit/Platform/IPC/HandleMessage.h:135
#4  _ZSt13__invoke_implIvZN3IPC18callMemberFunctionIN6WebKit16DrawingAreaProxyES3_FvmRKNS2_16LayerTreeContextEESt5tupleIJmS4_EEEEvPT_MT0_T1_OT2_EUlDpOT_E_JmS4_EESA_St14__invoke_otherOSC_DpOT1_ () at /usr/include/c++/12/bits/invoke.h:61
#5  _ZSt8__invokeIZN3IPC18callMemberFunctionIN6WebKit16DrawingAreaProxyES3_FvmRKNS2_16LayerTreeContextEESt5tupleIJmS4_EEEEvPT_MT0_T1_OT2_EUlDpOT_E_JmS4_EENSt15__invoke_resultISA_JDpT0_EE4typeEOSA_DpOSM_ () at /usr/include/c++/12/bits/invoke.h:96
#6  _ZSt12__apply_implIZN3IPC18callMemberFunctionIN6WebKit16DrawingAreaProxyES3_FvmRKNS2_16LayerTreeContextEESt5tupleIJmS4_EEEEvPT_MT0_T1_OT2_EUlDpOT_E_S9_JLm0ELm1EEEDcOSA_OSC_St16integer_sequenceImJXspT1_EEE () at /usr/include/c++/12/tuple:1852
#7  _ZSt5applyIZN3IPC18callMemberFunctionIN6WebKit16DrawingAreaProxyES3_FvmRKNS2_16LayerTreeContextEESt5tupleIJmS4_EEEEvPT_MT0_T1_OT2_EUlDpOT_E_S9_EDcOSA_OSC_ () at /usr/include/c++/12/tuple:1863
#8  IPC::callMemberFunction<WebKit::DrawingAreaProxy, WebKit::DrawingAreaProxy, void (unsigned long, WebKit::LayerTreeContext const&), std::tuple<unsigned long, WebKit::LayerTreeContext> >(WebKit::DrawingAreaProxy*, void (WebKit::DrawingAreaProxy::*)(unsigned long, WebKit::LayerTreeContext const&), std::tuple<unsigned long, WebKit::LayerTreeContext>&&) () at ./Source/WebKit/Platform/IPC/HandleMessage.h:133
#9  IPC::handleMessage<Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode, WebKit::DrawingAreaProxy, WebKit::DrawingAreaProxy, void (unsigned long, WebKit::LayerTreeContext const&)>(IPC::Connection&, IPC::Decoder&, WebKit::DrawingAreaProxy*, void (WebKit::DrawingAreaProxy::*)(unsigned long, WebKit::LayerTreeContext const&)) () at ./Source/WebKit/Platform/IPC/HandleMessage.h:235
#10 WebKit::DrawingAreaProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) ()
    at DerivedSources/WebKit/DrawingAreaProxyMessageReceiver.cpp:48
#11 0x00007ffff26e75fa in IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) ()
    at ./Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:129
#12 0x00007ffff27ed50a in WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) ()
    at ./Source/WebKit/UIProcess/WebProcessProxy.cpp:1212
#13 0x00007ffff26e2195 in IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) ()
    at ./Source/WebKit/Platform/IPC/Connection.cpp:1451
#14 0x00007ffff26e2b3c in IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) ()
    at ./Source/WebKit/Platform/IPC/Connection.cpp:1408
#15 IPC::Connection::dispatchIncomingMessages() () at ./Source/WebKit/Platform/IPC/Connection.cpp:1563
#16 0x00007ffff1515995 in WTF::Function<void ()>::operator()() const () at ./Source/WTF/wtf/Function.h:82
#17 WTF::RunLoop::performWork() () at ./Source/WTF/wtf/RunLoop.cpp:147
#18 0x00007ffff15aa9e9 in operator() () at ./Source/WTF/wtf/glib/RunLoopGLib.cpp:80
#19 _FUN() () at ./Source/WTF/wtf/glib/RunLoopGLib.cpp:82
#20 0x00007ffff15ab6af in operator() () at ./Source/WTF/wtf/glib/RunLoopGLib.cpp:53
#21 _FUN() () at ./Source/WTF/wtf/glib/RunLoopGLib.cpp:56
#22 0x00007ffff6d8b67f in g_main_dispatch (context=0x55555ee87ec0) at ../../../glib/gmain.c:3454
#23 g_main_context_dispatch (context=context@entry=0x55555ee87ec0) at ../../../glib/gmain.c:4172
#24 0x00007ffff6d8ba38 in g_main_context_iterate
    (context=0x55555ee87ec0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4248
#25 0x00007ffff6d8bcef in g_main_loop_run (loop=loop@entry=0x55555f3da310) at ../../../glib/gmain.c:4448
#26 0x00007ffff7408495 in gtk_main () at ../../../gtk/gtkmain.c:1329
#27 0x000055555af40d01 in wxGUIEventLoop::DoRun() (this=0x555560e96d00)
    at /OrcaSlicer/deps/build/dep_wxWidgets-prefix/src/dep_wxWidgets/src/gtk/evtloop.cpp:61
#28 0x000055555b055b11 in wxEventLoopBase::Run() (this=0x555560e96d00)
    at /OrcaSlicer/deps/build/dep_wxWidgets-prefix/src/dep_wxWidgets/src/common/evtloopcmn.cpp:87
#29 0x000055555b02b83a in wxAppConsoleBase::MainLoop() (this=0x55555ee91220)
    at /OrcaSlicer/deps/build/dep_wxWidgets-prefix/src/dep_wxWidgets/src/common/appbase.cpp:377
#30 0x000055555b02b5bf in wxAppConsoleBase::OnRun() (this=0x55555ee91220)
    at /OrcaSlicer/deps/build/dep_wxWidgets-prefix/src/dep_wxWidgets/src/common/appbase.cpp:298
#31 0x000055555ada1a7f in wxAppBase::OnRun() (this=0x55555ee91220)
    at /OrcaSlicer/deps/build/dep_wxWidgets-prefix/src/dep_wxWidgets/src/common/appcmn.cpp:341
#32 0x000055555b08154d in wxEntry(int&, wchar_t**) (argc=@0x55555e825e70: 1, argv=0x55555ebbd920)
    at /OrcaSlicer/deps/build/dep_wxWidgets-prefix/src/dep_wxWidgets/src/common/init.cpp:504
#33 0x000055555b08163a in wxEntry(int&, char**) (argc=@0x7fffffff7440: 1, argv=0x7fffffffd948)
    at /OrcaSlicer/deps/build/dep_wxWidgets-prefix/src/dep_wxWidgets/src/common/init.cpp:516
#34 0x0000555557248bca in Slic3r::GUI::GUI_Run(Slic3r::GUI::GUI_InitParams&) (params=...) at /OrcaSlicer/src/slic3r/GUI/GUI_Init.cpp:64
#35 0x0000555555b788c3 in Slic3r::CLI::run(int, char**) (this=0x7fffffffd710, argc=1, argv=0x7fffffffd948)
    at /OrcaSlicer/src/OrcaSlicer.cpp:1169
#36 0x0000555555bc6b86 in main(int, char**) (argc=1, argv=0x7fffffffd948) at /OrcaSlicer/src/OrcaSlicer.cpp:6306

I'm getting this dump on Debian 12, however it did also crash in the appimage format and also in the docker container. Unfortunately the debuginfod mechanism didn't get me the source code. Maybe I'll dig deeper into that direction.

So the issue is probably a bit tricky, if it's not happening directly inside this repo, and actually there's no call flow from the repo code to WebKit at all.. But perhaps it has set something incorrectly before, or perhaps we're facing a bug in WebKit itself?

I also gave a shot to valgrind after adding

    add_compile_options(-DCGAL_DISABLE_ROUNDING_MATH_CHECK=ON)

to CMakeLists.txt to skip rounding mode assertions from CGAL, but it crashed nevertheless before even starting the printer this time :(. There were numerous other errors from Valgrind however at that point, suggesting that deleted memory is being used, e.g.:

==3569797== Invalid read of size 8
==3569797==    at 0x1E4E5A2: Slic3r::GUI::SplashScreen::set_bitmap(wxBitmap&) (GUI_App.cpp:377)
==3569797==    by 0x1E4D9BE: Slic3r::GUI::SplashScreen::SetText(wxString const&) (GUI_App.cpp:294)
==3569797==    by 0x1E15994: Slic3r::GUI::GUI_App::on_init_inner() (GUI_App.cpp:2342)
==3569797==    by 0x1E12734: Slic3r::GUI::GUI_App::OnInit() (GUI_App.cpp:2101)
==3569797==    by 0x1E4B2A6: wxAppConsoleBase::CallOnInit() (app.h:93)
==3569797==    by 0x5C33791: wxEntry(int&, wchar_t**) (init.cpp:488)
==3569797==    by 0x5C338AF: wxEntry(int&, char**) (init.cpp:516)
==3569797==    by 0x1DFDA1D: Slic3r::GUI::GUI_Run(Slic3r::GUI::GUI_InitParams&) (GUI_Init.cpp:64)
==3569797==    by 0x72C8D2: Slic3r::CLI::run(int, char**) (OrcaSlicer.cpp:1169)
==3569797==    by 0x77AB95: main (OrcaSlicer.cpp:6306)
==3569797==  Address 0x19d2db00 is 1,072 bytes inside a block of size 1,472 free'd
==3569797==    at 0x9C4599B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==3569797==    by 0x1E73896: Slic3r::GUI::SplashScreen::~SplashScreen() (GUI_App.cpp:253)
==3569797==    by 0x5BDE3E2: wxAppConsoleBase::DeletePendingObjects() (appbase.cpp:634)
==3569797==    by 0x5BDDD83: wxAppConsoleBase::ProcessIdle() (appbase.cpp:440)
==3569797==    by 0x5954008: wxAppBase::ProcessIdle() (appcmn.cpp:403)
==3569797==    by 0x5C07EA6: wxEventLoopBase::ProcessIdle() (evtloopcmn.cpp:104)
==3569797==    by 0x5C08179: wxEventLoopBase::DoYieldFor(long) (evtloopcmn.cpp:178)
==3569797==    by 0x5AF3500: wxGUIEventLoop::DoYieldFor(long) (evtloop.cpp:385)
==3569797==    by 0x5C0806C: wxEventLoopBase::YieldFor(long) (evtloopcmn.cpp:144)
==3569797==    by 0x5C07F22: wxEventLoopBase::Yield(bool) (evtloopcmn.cpp:112)
==3569797==    by 0x5BDDC8F: wxAppConsoleBase::Yield(bool) (appbase.cpp:415)
==3569797==    by 0x5ADFFFA: wxYield() (utilscmn.cpp:1592)
==3569797==  Block was alloc'd at
==3569797==    at 0x9C42F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==3569797==    by 0x1E15910: Slic3r::GUI::GUI_App::on_init_inner() (GUI_App.cpp:2340)
==3569797==    by 0x1E12734: Slic3r::GUI::GUI_App::OnInit() (GUI_App.cpp:2101)
==3569797==    by 0x1E4B2A6: wxAppConsoleBase::CallOnInit() (app.h:93)
==3569797==    by 0x5C33791: wxEntry(int&, wchar_t**) (init.cpp:488)
==3569797==    by 0x5C338AF: wxEntry(int&, char**) (init.cpp:516)
==3569797==    by 0x1DFDA1D: Slic3r::GUI::GUI_Run(Slic3r::GUI::GUI_InitParams&) (GUI_Init.cpp:64)
==3569797==    by 0x72C8D2: Slic3r::CLI::run(int, char**) (OrcaSlicer.cpp:1169)
==3569797==    by 0x77AB95: main (OrcaSlicer.cpp:6306)
==3569797== 

My version is v2.2.0 aka 1088d0 running on Debian 12 (Bookworm) on x86_64.

@max-reynolds
Copy link

max-reynolds commented Feb 5, 2025

I observe the same issue. I think it is a duplicate of the #7210

Thread 1 "orcaslicer_main" received signal SIGSEGV, Segmentation fault.
webkitWebViewBaseEnterAcceleratedCompositingMode () at ./Source/WebKit/UIProcess/API/gtk/>WebKitWebViewBase.cpp:2938

This is actually a WebKitGtk problem as it can be reproduced with their test program MiniBrowser connecting to the Mainsail UI.

@liberodark
Copy link
Contributor

Hi,

For fix this issue have switch to flatpak.

Best Regards

@TYTheBeast
Copy link
Author

TYTheBeast commented Feb 15, 2025

switch to flatpak.

I hope you're tugging on my strings here, but, there is no such thing as OrcaSlicer on Flathub, nor is there a Flatpak release in the releases section. You're the first contributor to take notice of this thread, where multiple people are running into a segmentation fault, and your solution is to switch to the Flatpak?

First off, I'd like to ask, why the Flatpak? Is it the safest or most stable release? If so, why isn't the Wiki up to date to reference this?
Second, wouldn't it raise some concern that multiple people are getting a segmentation fault? This to me seems like a perfect vector for a specific individual attack, or to be nitpicky, a Memory Injection MITM SegFault Attack.
If this is not a possibility, then great, I'm worrying over nothing! 😅
But if this is a possibility, and if there's anything I can do to help resolve this, please do let me know! I am concerned about the security of OrcaSlicer, as it is built in C++, a really old language.

Have a great day 😄

P.S. Just installed OrcaSlicer through the Nightly flatpak release, and I can confirm that the interface with the printer works correctly! Thanks for the advice, but please make it clear next time that the Flatpak release is a recent addition and that it's part of the nightly builds, it was kind of difficult to locate without no other info 😅

@witc-git
Copy link

I had something similar happen with the flatpak release last night. Not sure if it's exactly the same, but I switched my printer from CrealityPrint to Klipper after rooting, Orca crashed and since then only opens with a black screen before immediately crashing again. Eventually got it reinstalled and working again with some extra environment variables form #8373

@TexZeTech
Copy link

TexZeTech commented Feb 25, 2025

What I find interesting is this doesn't seem to be an issue on X11 but does happen on Wayland.

I'm currently using the env variables __GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink WEBKIT_DISABLE_DMABUF_RENDERER=1

I don't think I need the env string on x11 but I'll verify that and edit this post.

Operating System: Arch Linux
KDE Plasma Version: 6.3.1
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.12.16-1-lts (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-3770K CPU @ 3.50GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080

So I have verified that v2.2.0 appimage & v2.3.0-beta (aur) works on x11 but doesn't render anything in the home ordevice tab with no fixes but I can use it.

The moment I add __GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink WEBKIT_DISABLE_DMABUF_RENDERER=1

or

_EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json WEBKIT_DISABLE_DMABUF_RENDERER=1 to load the pages it will crash if I have a connection without that port number.

I will update with more back from waylands side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants