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

Crash on start - SIGSEGV in ImFont::CalcTextSizeA #9774

Closed
2 tasks
mkyral opened this issue Feb 18, 2023 · 15 comments
Closed
2 tasks

Crash on start - SIGSEGV in ImFont::CalcTextSizeA #9774

mkyral opened this issue Feb 18, 2023 · 15 comments

Comments

@mkyral
Copy link

mkyral commented Feb 18, 2023

Description of the bug

PrusaSlicer 2.6.0-alpha4 compiled from sources on my Gentoo is crashing on start. The pre-compilled binary downloaded from github works well. I've tested start with clean profile, but still crashing.

Backtrace:

Reading symbols from /usr/bin/prusa-slicer...
Reading symbols from /usr/lib/debug//usr/bin/prusa-slicer.debug...
(gdb) run
Starting program: /usr/bin/prusa-slicer
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[2023-02-18 20:45:04.884193] [0x00007fffeebfe9c0] [trace]   Initializing StaticPrintConfigs
[Detaching after fork from child process 28436]
[New Thread 0x7fffee53f6c0 (LWP 28437)]
[New Thread 0x7fffedd3e6c0 (LWP 28438)]
[New Thread 0x7fffed53d6c0 (LWP 28439)]
[New Thread 0x7fffecd3c6c0 (LWP 28440)]
[New Thread 0x7fffdffff6c0 (LWP 28441)]
[Thread 0x7fffdffff6c0 (LWP 28441) exited]
[New Thread 0x7fffdffff6c0 (LWP 28442)]
[New Thread 0x7fffdf13c6c0 (LWP 28443)]
[Thread 0x7fffdffff6c0 (LWP 28442) exited]
[Thread 0x7fffdf13c6c0 (LWP 28443) exited]
[New Thread 0x7fffdf13c6c0 (LWP 28444)]
[New Thread 0x7fffdffff6c0 (LWP 28445)]
[Thread 0x7fffdf13c6c0 (LWP 28444) exited]
[New Thread 0x7fffdf13c6c0 (LWP 28446)]
[New Thread 0x7fffde93b6c0 (LWP 28447)]
[Thread 0x7fffdf13c6c0 (LWP 28446) exited]
[Thread 0x7fffdffff6c0 (LWP 28445) exited]
[New Thread 0x7fffdffff6c0 (LWP 28448)]
[New Thread 0x7fffdf13c6c0 (LWP 28449)]
[Thread 0x7fffde93b6c0 (LWP 28447) exited]
[Thread 0x7fffdffff6c0 (LWP 28448) exited]
[Thread 0x7fffdf13c6c0 (LWP 28449) exited]
[New Thread 0x7fffdf13c6c0 (LWP 28450)]
[New Thread 0x7fffdffff6c0 (LWP 28451)]
[Thread 0x7fffdf13c6c0 (LWP 28450) exited]
[Thread 0x7fffdffff6c0 (LWP 28451) exited]
[New Thread 0x7fffdffff6c0 (LWP 28452)]
[New Thread 0x7fffdf13c6c0 (LWP 28453)]
[Thread 0x7fffdffff6c0 (LWP 28452) exited]
[Thread 0x7fffdf13c6c0 (LWP 28453) exited]
[New Thread 0x7fffdf13c6c0 (LWP 28454)]
[New Thread 0x7fffdffff6c0 (LWP 28455)]
[Thread 0x7fffdf13c6c0 (LWP 28454) exited]
[Thread 0x7fffdffff6c0 (LWP 28455) exited]
[New Thread 0x7fffdffff6c0 (LWP 28456)]
[New Thread 0x7fffdf13c6c0 (LWP 28457)]
[New Thread 0x7fffde93b6c0 (LWP 28458)]
[New Thread 0x7fffdcdff6c0 (LWP 28477)]
[New Thread 0x7fffc97ab6c0 (LWP 28478)]
[New Thread 0x7fffc8faa6c0 (LWP 28479)]
[2023-02-18 20:45:05.824344] [0x00007fffeebfe9c0] [error]   Unable to init glew library: Unknown error
[2023-02-18 20:45:05.825244] [0x00007fffeebfe9c0] [error]   Unable to init glew library: Unknown error
[2023-02-18 20:45:05.858521] [0x00007fffeebfe9c0] [error]   Unable to init glew library: Unknown error
[2023-02-18 20:45:05.859554] [0x00007fffeebfe9c0] [error]   Unable to init glew library: Unknown error
[Thread 0x7fffde93b6c0 (LWP 28458) exited]
[Thread 0x7fffecd3c6c0 (LWP 28440) exited]

Thread 1 "slic3r_main" received signal SIGSEGV, Segmentation fault.
0x000055555693b9b5 in ImFont::CalcTextSizeA (this=0x0, size=0, max_width=max_width@entry=3.40282347e+38, wrap_width=-1, text_begin=text_begin@entry=0x555556a406fc "A", text_end=0x555556a406fd "", remaining=remaining@entry=0x0) at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/imgui/imgui_draw.cpp:3408
3408        const float scale = size / FontSize;
(gdb) bt
#0  0x000055555693b9b5 in ImFont::CalcTextSizeA(float, float, float, char const*, char const*, char const**) const
    (this=0x0, size=0, max_width=max_width@entry=3.40282347e+38, wrap_width=-1, text_begin=text_begin@entry=0x555556a406fc "A", text_end=0x555556a406fd "", remaining=remaining@entry=0x0)
    at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/imgui/imgui_draw.cpp:3408
#1  0x00005555568f6a38 in ImGui::CalcTextSize(char const*, char const*, bool, float)
    (text=text@entry=0x555556a406fc "A", text_end=text_end@entry=0x0, hide_text_after_double_hash=hide_text_after_double_hash@entry=false, wrap_width=wrap_width@entry=-1)
    at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/imgui/imgui.cpp:4538
#2  0x00005555562b233b in Slic3r::GUI::NotificationManager::HintNotification::count_spaces() (this=0x55555a74fdc0)
    at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/slic3r/GUI/HintNotification.cpp:566
#3  0x00005555562b1958 in Slic3r::GUI::NotificationManager::HintNotification::init() (this=0x55555a74fdc0)
    at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/slic3r/GUI/HintNotification.cpp:724
#4  0x00005555562bfee4 in Slic3r::GUI::NotificationManager::HintNotification::retrieve_data(bool) (this=0x55555a74fdc0, new_hint=<optimized out>)
    at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/slic3r/GUI/HintNotification.cpp:1063
#5  0x000055555627bf17 in Slic3r::GUI::NotificationManager::HintNotification::HintNotification(Slic3r::GUI::NotificationManager::NotificationData const&, Slic3r::GUI::NotificationManager::NotificationIDProvider&, wxEvtHandler*, bool) (new_hint=true, evt_handler=0x555559f480d0, id_provider=..., n=..., this=0x55555a74fdc0) at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/slic3r/GUI/HintNotification.hpp:75
#6  std::make_unique<Slic3r::GUI::NotificationManager::HintNotification, Slic3r::GUI::NotificationManager::NotificationData&, Slic3r::GUI::NotificationManager::NotificationIDProvider&, wxEvtHandler*&, bool&>(Slic3r::GUI::NotificationManager::NotificationData&, Slic3r::GUI::NotificationManager::NotificationIDProvider&, wxEvtHandler*&, bool&) () at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/bits/unique_ptr.h:962
#7  Slic3r::GUI::NotificationManager::push_hint_notification(bool) (this=0x55555a1f1d10, open_next=<optimized out>)
    at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/slic3r/GUI/NotificationManager.cpp:2708
#8  0x0000555555fdc704 in Slic3r::GUI::GUI_App::post_init() (this=0x555556f58870) at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/slic3r/GUI/GUI_App.cpp:807
#9  0x0000555555fdcd1c in operator() (event=<optimized out>, __closure=0x55555af39258) at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/slic3r/GUI/GUI_App.cpp:1380
#10 wxEventFunctorFunctor<wxEventTypeTag<wxIdleEvent>, Slic3r::GUI::GUI_App::on_init_inner()::<lambda(wxIdleEvent&)> >::operator()(wxEvtHandler *, wxEvent &) (this=0x55555af39250, event=<optimized out>)
    at /usr/include/wx-3.2-gtk3/wx/event.h:547
#11 0x00007ffff40a4a5e in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#12 0x00007ffff40a4f06 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#13 0x00007ffff40a52a0 in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#14 0x00007ffff40a534b in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#15 0x00007ffff40a5461 in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#16 0x00007ffff3f34b38 in wxAppConsoleBase::ProcessIdle() () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#17 0x00007ffff3a27ce1 in wxAppBase::ProcessIdle() () at /usr/lib64/libwx_gtk3u_core-3.2-gtk3.so.0
#18 0x00007ffff392c995 in wxApp::DoIdle() () at /usr/lib64/libwx_gtk3u_core-3.2-gtk3.so.0
#19 0x00007ffff392ca93 in wxapp_idle_callback () at /usr/lib64/libwx_gtk3u_core-3.2-gtk3.so.0
#20 0x00007ffff2a11f95 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#21 0x00007ffff2a12348 in g_main_context_iterate.constprop () at /usr/lib64/libglib-2.0.so.0
#22 0x00007ffff2a12633 in g_main_loop_run () at /usr/lib64/libglib-2.0.so.0
#23 0x00007ffff2dad3dd in gtk_main () at /usr/lib64/libgtk-3.so.0
#24 0x00007ffff394aeb5 in wxGUIEventLoop::DoRun() () at /usr/lib64/libwx_gtk3u_core-3.2-gtk3.so.0
#25 0x00007ffff3f6d01d in wxEventLoopBase::Run() () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#26 0x00007ffff3f36a5b in wxAppConsoleBase::MainLoop() () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#27 0x00007ffff3fb62c6 in wxEntry(int&, wchar_t**) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#28 0x0000555555fbf920 in Slic3r::GUI::GUI_Run(Slic3r::GUI::GUI_InitParams&) (params=...) at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/slic3r/GUI/GUI_Init.cpp:61
#29 0x000055555587f145 in Slic3r::CLI::run(int, char**) (this=0x7fffffffce90, argc=1, argv=0x7fffffffd0c8) at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/PrusaSlicer.cpp:688
#30 0x000055555585dada in main(int, char**) (argc=1, argv=0x7fffffffd0c8) at /usr/src/debug/media-gfx/prusaslicer-2.6.0_alpha4/PrusaSlicer-version_2.6.0-alpha4/src/PrusaSlicer.cpp:947

Config:

(note, I'm using some patches to make PrusaSlicer correctly build, but should not cause the issue)

>>> Emerging (1 of 1) media-gfx/prusaslicer-2.6.0_alpha4::mkyral
 * prusaslicer-2.6.0_alpha4.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                 [ ok ]
>>> Unpacking source...
>>> Unpacking prusaslicer-2.6.0_alpha4.tar.gz to /var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work
>>> Source unpacked in /var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work
>>> Preparing source in /var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4 ...
 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4_build"
 * Applying prusaslicer-2.6.0_alpha3-fix-cgal55.patch ...                                                                                                                                                                      [ ok ]
 * Applying prusaslicer-2.6.0_alpha3-OpenCASCADE_version.patch ...                                                                                                                                                             [ ok ]
 * Applying prusaslicer-2.6.0_alpha3-remove-libxpat-cmake-module.patch ...                                                                                                                                                     [ ok ]
 * Applying prusaslicer-2.6.0_alpha3-fix-missing-fstream-header.patch ...                                                                                                                                                      [ ok ]
 * Hardcoded definition(s) removed in CMakeLists.txt:
 *    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)"
 * Hardcoded definition(s) removed in deps/CMakeLists.txt:
 *      set(CMAKE_BUILD_TYPE Release)
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4 ...
 *
 * Requested wxWidgets:        3.2-gtk3
 * Using wxWidgets:            gtk3-unicode-3.2-gtk3
 *
 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4_build"
cmake -C /var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DOPENVDB_FIND_MODULE_PATH=/usr/lib64/cmake/OpenVDB -DSLIC3R_BUILD_TESTS=no -DSLIC3R_FHS=ON -DSLIC3R_GTK=3 -DSLIC3R_GUI=ON -DSLIC3R_PCH=OFF -DSLIC3R_STATIC=OFF -DSLIC3R_WX_STABLE=ON -Wno-dev -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4_build/gentoo_toolchain.cmake /var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4
loading initial cache file /var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4_build/gentoo_common_config.cmake
-- The C compiler identification is GNU 11.3.1
-- The CXX compiler identification is GNU 11.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SLIC3R_ASAN: OFF
-- SLIC3R_BUILD_SANDBOXES: OFF
-- SLIC3R_BUILD_TESTS: no
-- SLIC3R_ENABLE_FORMAT_STEP: ON
-- SLIC3R_FHS: ON
-- SLIC3R_GTK: 3
-- SLIC3R_GUI: ON
-- SLIC3R_MSVC_COMPILE_PARALLEL: ON
-- SLIC3R_MSVC_PDB: ON
-- SLIC3R_PCH: OFF
-- SLIC3R_PERL_XS: OFF
-- SLIC3R_STATIC: OFF
-- SLIC3R_UBSAN: OFF
-- SLIC3R_WX_STABLE: ON
-- SLIC3R_STATIC: OFF
-- CMAKE_PREFIX_PATH: (default)
-- Found PkgConfig: /usr/bin/x86_64-pc-linux-gnu-pkg-config (found version "1.8.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found DBus: /usr/include/dbus-1.0;/usr/lib64/dbus-1.0/include
-- Found Boost: /usr/lib64/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.66.0") found components: system filesystem thread log locale regex chrono atomic date_time iostreams
-- Boost::boost exists
-- TBB found in /usr/lib64/cmake/TBB
-- Could NOT find CURL (missing: CURL_DIR)
-- Falling back to MODULE search for CURL...
-- Found CURL: /usr/lib64/libcurl.so (found version "7.87.0")
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.13")
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "3.3")
-- Found EXPAT: /usr/lib64/libexpat.so (found version "2.5.0")
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.39")
-- Found OpenGL: /usr/lib64/libOpenGL.so
-- Could NOT find GLEW (missing: GLEW_DIR)
-- Falling back to MODULE search for GLEW...
-- Found GLEW: /usr/include (found version "2.2.0")
-- Found NLopt in '/usr/lib64'.
-- Using NLopt include directory '/usr/include'.
-- Using NLopt library '/usr/lib64/libnlopt.so'.
COMPONENT = openvdb
-- Found TBB: /usr/include (found version "2021.7") found components: tbb
-- Found Boost: /usr/lib64/cmake/Boost-1.81.0/BoostConfig.cmake (found version "1.81.0") found components: iostreams
-- Found Blosc: /usr/lib64/libblosc.so (found version "1.21.3")
-- IGL NOT found, using bundled version...
-- Using header-only CGAL
-- Targetting Ninja
-- Using /usr/bin/x86_64-pc-linux-gnu-g++ compiler.
-- Found GMP: /usr/lib64/libgmp.so
-- Found MPFR: /usr/lib64/libmpfr.so
-- Found Boost: /usr/lib64/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.66")
-- Boost include dirs: /usr/include
-- Boost libraries:
-- Using gcc version 4 or later. Adding -frounding-math
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62")
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found wxWidgets: -L/usr/lib64;-pthread;;;-lwx_baseu-3.2-gtk3;-lwx_gtk3u_core-3.2-gtk3;-lwx_gtk3u_html-3.2-gtk3;-lwx_gtk3u_gl-3.2-gtk3 (found suitable version "3.2.2", minimum required is "3.0")
-- wx-config path: /usr/lib64/wx/config/gtk3-unicode-3.2-gtk3
-- wx libs: -L/usr/lib64;-pthread;;;-lwx_baseu-3.2-gtk3;-lwx_gtk3u_core-3.2-gtk3;-lwx_gtk3u_html-3.2-gtk3;-lwx_gtk3u_gl-3.2-gtk3;/usr/lib64/libpng.so;/usr/lib64/libz.so;/usr/lib64/libtiff.so;/usr/lib64/libjpeg.so;libexpat;/usr/lib64/librt.a;X11;wayland-client;wayland-egl;EGL
-- Found GTK3: /usr/include/gtk-3.0;/usr/include/pango-1.0;/usr/include/glib-2.0;/usr/lib64/glib-2.0/include;/usr/lib64/libffi/include;/usr/include/harfbuzz;/usr/include/freetype2;/usr/include/libmount;/usr/include/blkid;/usr/include/fribidi;/usr/include/cairo;/usr/include/lzo;/usr/include/libpng16;/usr/include/pixman-1;/usr/include/gdk-pixbuf-2.0;/usr/include/gio-unix-2.0;/usr/include/atk-1.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib64/dbus-1.0/include
-- <<< Gentoo configuration >>>
Build type      Release
Install path    /usr
Compiler flags:
C               -march=native -O2 -pipe -ggdb3
C++             -march=native -O2 -pipe -ggdb3 -fext-numeric-literals -Wall -Wno-reorder
Linker flags:
Executable      -Wl,-O1 -Wl,--as-needed
Module          -Wl,-O1 -Wl,--as-needed
Shared          -Wl,-O1 -Wl,--as-needed

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha4/work/PrusaSlicer-version_2.6.0-alpha4_build
>>> Source configured.

Project file & How to reproduce

  1. Run prusa-slicer ;-)

Checklist of files included above

  • Project file
  • Screenshot

Version of PrusaSlicer

2.6.0-alpha4

Operating system

Gentoo Linux

Printer model

MK3S

@lukasmatena
Copy link
Collaborator

Seems to be related to #9780.

@lukasmatena
Copy link
Collaborator

lukasmatena commented Feb 19, 2023

The backtrace would indicate that the call to CalcTextSize happens before imgui font is initialized. Same problem is described in ocornut/imgui#4769.
SPE-1501

@kocikdav
Copy link
Collaborator

Hello, for those who compile from git, there is a branch dk_hints_public with commit 6cb9947. Hopefully this fixes the issue. For the rest, Im going to prepare a custom build and share it under this issue.

@kocikdav
Copy link
Collaborator

Please try this build. It is alpha4 build with just fix of this issue.
MacOS:
https://slicerbuilds.prusa3d.com/files/DK/PrusaSlicer-2.6.0-alpha4+1-dk-hints-public-MacOS-universal-g6cb994706-202302201434.dmg
Linux:
https://slicerbuilds.prusa3d.com/files/DK/PrusaSlicer-2.6.0-alpha4+1-dk-hints-public-linux-x64-GTK3-g6cb9947-202302201436.AppImage

If it works and you are downloading from Printables.com, please try starting PrusaSlicer via the download button there. Unfortunately we do not poses a computer with this bug and I would like to test this works as well.

@kocikdav
Copy link
Collaborator

@mkyral
Copy link
Author

mkyral commented Feb 26, 2023

Hi,
I've tested the mentioned commit on alpha4.
No error on start, but the 3D view is not initialized. Other tabs are working, but not 3D view.

In console I can see many errors with glew initialization.

[2023-02-26 08:48:43.633681] [0x00007fffeebfe9c0] [error]   Unable to init glew library: Unknown error
[2023-02-26 08:48:43.634523] [0x00007fffeebfe9c0] [error]   Unable to init glew library: Unknown error
[2023-02-26 08:48:44.071529] [0x00007fffeebfe9c0] [error]   Unable to init glew library: Unknown error
[2023-02-26 08:48:44.072370] [0x00007fffeebfe9c0] [error]   Unable to init glew library: Unknown error

This is not an issue with pre-compiled binaries. Probably because the pre-compiled binary is not linked to glew library.

[08:54:45 marian@txp bin]$ ./prusa-slicer -h |grep PrusaSlicer-2
PrusaSlicer-2.6.0-alpha4+linux-x64-GTK3-202302180033 based on Slic3r (with GUI support)
[08:55:19 marian@txp bin]$ ldd prusa-slicer |grep -i glew
[08:55:19 marian@txp bin]$
[08:55:45 marian@txp bin]$ /usr/bin/prusa-slicer -h |grep PrusaSlicer-2
PrusaSlicer-2.6.0-alpha4+UNKNOWN based on Slic3r (with GUI support)
[08:55:58 marian@txp bin]$ ldd /usr/bin/prusa-slicer |grep -i glew
        libGLEW.so.2.2 => /usr/lib64/libGLEW.so.2.2 (0x00007f3c0b8f3000)

obrazek

@mkyral
Copy link
Author

mkyral commented Feb 26, 2023

Probably it could be this: wxWidgets/wxWidgets#22710

I'm not sure what exactly I should do when in Gentoo I have x11-libs/wxGTK-3.2.2.1 installed.

Update: I've recompiled wxGTK with EGL disabled as mentioned in wxWidgets/wxWidgets#22710 (comment) and prusaslicer works correctly. So it is different issue.

@lukasmatena
Copy link
Collaborator

@mkyral Could you please test this with 2.6.0-alpha5? Thanks.

@mkyral
Copy link
Author

mkyral commented Mar 18, 2023

Hi @lukasmatena.
sorry for delay. Alpha-5 does not work with distribution wxGTK 3.2

$ prusa-slicer
[2023-03-18 17:11:47.552724] [0x00007f11b684b9c0] [trace]   Initializing StaticPrintConfigs
[2023-03-18 17:11:50.138656] [0x00007f11b684b9c0] [error]   Unable to init glew library: Unknown error
[2023-03-18 17:11:50.141066] [0x00007f11b684b9c0] [error]   Unable to init glew library: Unknown error
[2023-03-18 17:11:50.366244] [0x00007f11b684b9c0] [error]   Unable to init glew library: Unknown error
[2023-03-18 17:11:50.372588] [0x00007f11b684b9c0] [error]   Unable to init glew library: Unknown error

(prusa-slicer:15604): Gtk-CRITICAL **: 17:11:55.725: gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
17:11:55: Debug: window wxTreeCtrl@0x5633410eb280 ("treeCtrl") lost focus even though it didn't have it
17:11:55: Debug: window wxTreeCtrl@0x5633410eb280 ("treeCtrl") lost focus even though it didn't have it
17:11:55: Debug: window wxTreeCtrl@0x5633410eb280 ("treeCtrl") lost focus even though it didn't have it
17:11:55: Debug: window wxTreeCtrl@0x5633410eb280 ("treeCtrl") lost focus even though it didn't have it

@fff7d1bc
Copy link

fff7d1bc commented Apr 1, 2023

Locally built alpha6 with wxGTK 3.2 and glew 2.2.0 it fails the same for me. Since now you use wxBitmapBundle the wx 3.2 is required and it no longer can be built with wx 3.0.

% prusa-slicer 
[2023-04-01 18:06:57.655410] [0x00007f47678e0a00] [trace]   Initializing StaticPrintConfigs

(prusa-slicer:23969): Gtk-CRITICAL **: 18:06:58.083: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed
[2023-04-01 18:06:58.130270] [0x00007f47678e0a00] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:06:58.130881] [0x00007f47678e0a00] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:06:58.132555] [0x00007f47678e0a00] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:06:58.133142] [0x00007f47678e0a00] [error]   Unable to init glew library: Unknown error
zsh: segmentation fault  prusa-slicer

The appimage PrusaSlicer-2.6.0-alpha6+linux-x64-GTK3-202303311518.AppImage does work just fine.

However because you do not publish any build scripts how those AppImage images are put together I have no way to find what you do there to make it work. Would be really great if you could share those.

Here's backtrace with debug symbols

[Detaching after fork from child process 31420]

(prusa-slicer:31362): Gtk-CRITICAL **: 18:17:11.317: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed
[2023-04-01 18:17:11.364230] [0x00007fffee302a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:17:11.364830] [0x00007fffee302a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:17:11.366358] [0x00007fffee302a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:17:11.366941] [0x00007fffee302a80] [error]   Unable to init glew library: Unknown error

Thread 1 "slic3r_main" received signal SIGSEGV, Segmentation fault.
0x000055555787530e in ImFont::CalcTextSizeA (this=0x0, size=0, max_width=3.40282347e+38, wrap_width=-1, text_begin=0x555557997102 "A", text_end=0x555557997103 "", remaining=0x0)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/imgui/imgui_draw.cpp:3408
3408	/var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/imgui/imgui_draw.cpp: No such file or directory.
(gdb) bt
#0  0x000055555787530e in ImFont::CalcTextSizeA(float, float, float, char const*, char const*, char const**) const
    (this=0x0, size=0, max_width=3.40282347e+38, wrap_width=-1, text_begin=0x555557997102 "A", text_end=0x555557997103 "", remaining=0x0)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/imgui/imgui_draw.cpp:3408
#1  0x00005555578124f1 in ImGui::CalcTextSize(char const*, char const*, bool, float) (text=0x555557997102 "A", text_end=0x0, hide_text_after_double_hash=false, wrap_width=-1)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/imgui/imgui.cpp:4538
#2  0x0000555556cd9467 in Slic3r::GUI::NotificationManager::HintNotification::count_spaces() (this=0x55555a2f4400)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/HintNotification.cpp:566
#3  0x0000555556cdac07 in Slic3r::GUI::NotificationManager::HintNotification::init() (this=0x55555a2f4400)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/HintNotification.cpp:724
#4  0x0000555556c79a94 in Slic3r::GUI::NotificationManager::PopNotification::update(Slic3r::GUI::NotificationManager::NotificationData const&) (this=0x55555a2f4400, n=...)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/NotificationManager.cpp:649
#5  0x0000555556cddd0d in Slic3r::GUI::NotificationManager::HintNotification::retrieve_data(bool) (this=0x55555a2f4400, new_hint=true)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/HintNotification.cpp:1063
#6  0x0000555556c914ac in Slic3r::GUI::NotificationManager::HintNotification::HintNotification(Slic3r::GUI::NotificationManager::NotificationData const&, Slic3r::GUI::NotificationManager::NotificationIDProvider&, wxEvtHandler*, bool) (this=0x55555a2f4400, n=..., id_provider=..., evt_handler=0x555559439cd0, new_hint=true)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/HintNotification.hpp:75
#7  0x0000555556c93768 in std::make_unique<Slic3r::GUI::NotificationManager::HintNotification, Slic3r::GUI::NotificationManager::NotificationData&, Slic3r::GUI::NotificationManager::NotificationIDProvider&, wxEvtHandler*&, bool&>(Slic3r::GUI::NotificationManager::NotificationData&, Slic3r::GUI::NotificationManager::NotificationIDProvider&, wxEvtHandler*&, bool&) ()
    at /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/unique_ptr.h:1065
#8  0x0000555556c8a7cf in Slic3r::GUI::NotificationManager::push_hint_notification(bool) (this=0x555559763400, open_next=true)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/NotificationManager.cpp:2708
#9  0x0000555556859df4 in Slic3r::GUI::GUI_App::post_init() (this=0x55555899a740)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/GUI_App.cpp:816
#10 0x000055555685dea8 in operator()(wxIdleEvent&) const (__closure=0x555559bc5098, event=...)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/GUI_App.cpp:1388
#11 0x000055555687559b in wxEventFunctorFunctor<wxEventTypeTag<wxIdleEvent>, Slic3r::GUI::GUI_App::on_init_inner()::<lambda(wxIdleEvent&)> >::operator()(wxEvtHandler *, wxEvent &)
    (this=0x555559bc5090, event=...) at /usr/include/wx-3.2-gtk3/wx/event.h:547
#12 0x00007ffff3a76562 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#13 0x00007ffff3a76a76 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#14 0x00007ffff3a76e10 in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#15 0x00007ffff3a76eba in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#16 0x00007ffff3a76fd1 in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#17 0x00007ffff38a99d2 in wxAppConsoleBase::ProcessIdle() () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#18 0x00007ffff3295131 in wxAppBase::ProcessIdle() () at /usr/lib64/libwx_gtk3u_core-3.2-gtk3.so.0
#19 0x00007ffff3166da9 in wxApp::DoIdle() () at /usr/lib64/libwx_gtk3u_core-3.2-gtk3.so.0
#20 0x00007ffff3166ef3 in  () at /usr/lib64/libwx_gtk3u_core-3.2-gtk3.so.0
#21 0x00007ffff210b1ce in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#22 0x00007ffff210b598 in  () at /usr/lib64/libglib-2.0.so.0
#23 0x00007ffff210b84f in g_main_loop_run () at /usr/lib64/libglib-2.0.so.0
#24 0x00007ffff242fbad in gtk_main () at /usr/lib64/libgtk-3.so.0
#25 0x00007ffff318c255 in wxGUIEventLoop::DoRun() () at /usr/lib64/libwx_gtk3u_core-3.2-gtk3.so.0
#26 0x00007ffff38f755d in wxEventLoopBase::Run() () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#27 0x00007ffff38abd90 in wxAppConsoleBase::OnRun() () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#28 0x00007ffff3956b27 in wxEntry(int&, wchar_t**) () at /usr/lib64/libwx_baseu-3.2-gtk3.so.0
#29 0x0000555556853c8f in Slic3r::GUI::GUI_Run(Slic3r::GUI::GUI_InitParams&) (params=...)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/slic3r/GUI/GUI_Init.cpp:61
#30 0x00005555557baf65 in Slic3r::CLI::run(int, char**) (this=0x7fffffffdce0, argc=1, argv=0x7fffffffdf18)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/PrusaSlicer.cpp:688
#31 0x00005555557bd281 in main(int, char**) (argc=1, argv=0x7fffffffdf18)
    at /var/portage/tmp/portage/media-gfx/prusaslicer-2.6.0_alpha6/work/PrusaSlicer-version_2.6.0-alpha6/src/PrusaSlicer.cpp:947

@fff7d1bc
Copy link

fff7d1bc commented Apr 1, 2023

@lukasmatena I followed up with your comment regarding show_hints from #9780 and if I modify PrusaSlicer.ini to have show_hints set to 0, locally built 2.6.0_alpha6 does start up, however it does not render at all the Plater tab though I can interact with UI elements and switch tabs.

% prusa-slicer 
[2023-04-01 18:44:56.291627] [0x00007fb8c52a6a80] [trace]   Initializing StaticPrintConfigs

(prusa-slicer:9052): Gtk-CRITICAL **: 18:44:57.555: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed
[2023-04-01 18:44:57.605352] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:57.605961] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:57.607729] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:57.608312] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:57.658343] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:57.658934] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:57.670567] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:57.671156] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:58.038187] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error
[2023-04-01 18:44:58.038770] [0x00007fb8c52a6a80] [error]   Unable to init glew library: Unknown error

(prusa-slicer:9052): Gtk-CRITICAL **: 18:44:58.434: gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it
18:44:58: Debug: window wxTreeCtrl@0x5555b1fc8c40 ("treeCtrl") lost focus even though it didn't have it

@cjmayo
Copy link

cjmayo commented Apr 3, 2023

For the glew errors as mentioned above probably the easiest option is to build wxGTK with EGL disabled; that does look like how the binaries are built: 25b2ff5

With GLEW being built for either EGL or GLX there is no easy solution.

Building media-libs/glew for EGL is only possible if there is nothing else installed that uses GLEW with GLX.

Possibly the ideal solution would if PrusaSlicer followed GNOME, Firefox and Libreoffice and used epoxy instead of GLEW. I suggest that isn't going to happen immediately before a major release.

@mkyral
Copy link
Author

mkyral commented May 14, 2023

Just tested 2.6.0-beta1 and issue remains. No 3D view. I have to recompile wxGTK with --disable-glcanvasegl option.

@fff7d1bc
Copy link

Following the example of Fedora[1] I will force the GLCanvas GLX in Gentoo along with PrusaSlicer 2.6.0. I can confirm that it works in full, though still requires a handful of patches to make it build, and the wxWidgets new asserts are noisy as well, patched it out.

Perhaps the README of repo should state to disable the GLCanvas EGL as requirement and then this issue could be closed.

[1] https://src.fedoraproject.org/rpms/wxGTK/c/4b153842efce56595f3320fa9d888741060a2464

@lukasmatena
Copy link
Collaborator

Perhaps the README of repo should state to disable the GLCanvas EGL as requirement and then this issue could be closed.

Thanks. In the next release, this information will be added into doc/How to build - Linux et al.md, along with a reference to this issue.
Closing.

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

5 participants