Crash on opening/importing specific PDF
<!-- See our full bug reporting guidelines at https://inkscape.org/contribute/report-bugs/ Writing a good bug report will ensure we'll be able to help efficiently. 🙂 --> #### Summary: <!-- Summarize the issue/suggestion concisely: --> Inkscape crashes when I try to import a specific PDF (attached, with permission from author). As an aside: I also work with PDFs and know how impossible it is to account for all the possible ways they are authored. I wrote a utility last year to mangle PDF content so that people can attach proprietary documents along with bug reports, perhaps it would be useful for you as well: https://github.com/cfcurtis/pdf-mangler. Right now the content stream is parsed and re-written, but I've been slowly working on a branch to mangle the byte stream directly. #### Steps to reproduce: <!-- Describe what you did (step-by-step) so we can reproduce: --> - open Inkscape - Select File -> Import or File -> Open and choose the "Raglan v1.pdf" file attached - Use internal import with default options (shown below) ![image](/uploads/893a3c8d58b0f82ffd79e0a288b84bac/image.png) - Select Ok #### What happened? Inkscape crashes with a backtrace and dialog suggesting I file a bug report. #### What should have happened? The PDF should have opened properly. Note that I am able to open this document with Inkscape v1.2. Sample attachments: <!-- Attach the sample file(s) highlighting the issue, if appropriate. --> [Raglan_v1.pdf](/uploads/2b2c92e01a265dc3e0eceb00542b4c90/Raglan_v1.pdf) #### Version info <!-- Open 'Help > About' and click on the little bug icon in the bottom right corner that copies the debug information to your clipboard. For command line users, run 'inkscape --debug-info'. For Inkscape 1.0.2 and older, please manually add the Inkscape Version and Operating System Version. The Inkscape version is listed in the About dialog. For command line users, run 'inkscape -V' Paste the information in the empty space between the apostrophes below: --> ``` Inkscape 1.3 (0e150ed6c4, 2023-07-21) GLib version: 2.76.4 GTK version: 3.24.38 glibmm version: 2.66.6 gtkmm version: 3.24.7 libxml2 version: 2.10.4 libxslt version: 1.1.38 Cairo version: 1.17.8 Pango version: 1.50.14 HarfBuzz version: 7.1.0 OS version: Fedora Linux 38 (Workstation Edition) ``` ### Backtrace <pre> 0# Inkscape::Application::crash_handler(int) in /usr/bin/inkscape 1# 0x00007F4EF1A3BB70 in /lib64/libc.so.6 2# 0x00007F4EF1A8C844 in /lib64/libc.so.6 3# gsignal in /lib64/libc.so.6 4# abort in /lib64/libc.so.6 5# __gnu_debug::_Safe_sequence_base::_M_get_mutex() in /lib64/libstdc++.so.6 6# Inkscape::Extension::Internal::SvgBuilder::addChar(GfxState*, double, double, double, double, double, double, unsigned int, int, unsigned int const*, int) in /usr/bin/inkscape 7# PdfParser::doShowText(GooString const*) in /usr/bin/inkscape 8# PdfParser::go(bool) in /usr/bin/inkscape 9# PdfParser::parse(Object*, bool) in /usr/bin/inkscape 10# Inkscape::Extension::Internal::PdfInput::add_builder_page(std::shared_ptr<PDFDoc>, Inkscape::Extension::Internal::SvgBuilder*, SPDocument*, int) in /usr/bin/inkscape 11# Inkscape::Extension::Internal::PdfInput::open(Inkscape::Extension::Input*, char const*) in /usr/bin/inkscape 12# Inkscape::Extension::open(Inkscape::Extension::Extension*, char const*) in /usr/bin/inkscape 13# ink_file_open(Glib::RefPtr<Gio::File> const&, bool*) in /usr/bin/inkscape 14# InkscapeApplication::document_open(Glib::RefPtr<Gio::File> const&, bool*) in /usr/bin/inkscape 15# InkscapeApplication::create_window(Glib::RefPtr<Gio::File> const&) in /usr/bin/inkscape 16# sp_file_open_dialog(Gtk::Window&, void*, void*) in /usr/bin/inkscape 17# 0x00007F4EF2D07C59 in /lib64/libgiomm-2.4.so.1 18# g_closure_invoke in /lib64/libgobject-2.0.so.0 19# 0x00007F4EF3A9915D in /lib64/libgobject-2.0.so.0 20# g_signal_emit_valist in /lib64/libgobject-2.0.so.0 21# g_signal_emit in /lib64/libgobject-2.0.so.0 22# 0x00007F4EF3BA5595 in /lib64/libgio-2.0.so.0 23# Gio::ActionGroup_Class::activate_action_vfunc_callback(_GActionGroup*, char const*, _GVariant*) in /lib64/libgiomm-2.4.so.1 24# Inkscape::Shortcuts::invoke_action(_GdkEventKey const*) in /usr/bin/inkscape 25# InkscapeWindow::on_key_press_event(_GdkEventKey*) in /usr/bin/inkscape 26# Gtk::Widget_Class::key_press_event_callback(_GtkWidget*, _GdkEventKey*) in /lib64/libgtkmm-3.0.so.1 27# 0x00007F4EF2299FE7 in /lib64/libgtk-3.so.0 28# g_signal_emit_valist in /lib64/libgobject-2.0.so.0 29# g_signal_emit in /lib64/libgobject-2.0.so.0 30# 0x00007F4EF2571174 in /lib64/libgtk-3.so.0 31# 0x00007F4EF240863F in /lib64/libgtk-3.so.0 32# gtk_main_do_event in /lib64/libgtk-3.so.0 33# 0x00007F4EF2A33427 in /lib64/libgdk-3.so.0 34# 0x00007F4EF2A6BE0E in /lib64/libgdk-3.so.0 35# g_main_context_dispatch in /lib64/libglib-2.0.so.0 36# 0x00007F4EF3D42648 in /lib64/libglib-2.0.so.0 37# g_main_context_iteration in /lib64/libglib-2.0.so.0 38# g_application_run in /lib64/libgio-2.0.so.0 39# main in /usr/bin/inkscape 40# 0x00007F4EF1A25B4A in /lib64/libc.so.6 41# __libc_start_main in /lib64/libc.so.6 42# _start in /usr/bin/inkscape </pre> <!-- ❤️ Thank you for filling in a new bug report, we appreciate the help! ❤️ Please be patient while we try to find the time to look into your issue. Remember that Inkscape is developed by volunteers in their spare time, we'll try our best to respond to all reports. --> <!-- Please be careful when/after writing # for example in logs, code, or versions of linux - use inline code span - single backticks (`) before and after it, like this - `#1618` - use multi-line code block - triple backticks (```) to fence/enclose console logs - attach long logs as a text file. -->
issue