Skip to content

Deadlock when importing from PDF (KDE Neon)

Summary:

Inkscape freezes when importing a empty PDF document exported from LibreOffice (empty.pdf). (Or, for that matter, any PDF I tried.)

Steps to reproduce:

  • Run inkscape empty.pdf

or

  • Start Inkscape
  • Try to open empty.pdf

or

  • Start Inkscape
  • Do File > Import PDF
  • Select empty.pdf
  • Click OK

What happened?

Nothing. Inkscape stays idle for hours. Attaching gdb gives the following backtrace:

#0  futex_wait (private=0, expected=2, futex_word=0x555556bfb888) at ../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait (futex=futex@entry=0x555556bfb888, private=0) at ./nptl/lowlevellock.c:49
#2  0x00007ffff61f8082 in lll_mutex_lock_optimized (mutex=0x555556bfb888) at ./nptl/pthread_mutex_lock.c:48
#3  ___pthread_mutex_lock (mutex=0x555556bfb888) at ./nptl/pthread_mutex_lock.c:93
#4  0x00007ffff54dec64 in __gthread_mutex_lock (__mutex=0x555556bfb888) at /usr/include/x86_64-linux-gnu/c++/11/bits/gthr-default.h:749
#5  __gthread_recursive_mutex_lock (__mutex=0x555556bfb888) at /usr/include/x86_64-linux-gnu/c++/11/bits/gthr-default.h:811
#6  std::recursive_mutex::lock() (this=0x555556bfb888) at /usr/include/c++/11/mutex:108
#7  std::unique_lock<std::recursive_mutex>::lock() (this=<synthetic pointer>) at /usr/include/c++/11/bits/unique_lock.h:139
#8  std::unique_lock<std::recursive_mutex>::unique_lock(std::recursive_mutex&) (__m=..., this=<synthetic pointer>, this=<optimized out>, __m=<optimized out>) at /usr/include/c++/11/bits/unique_lock.h:69
#9  Catalog::getNumPages() (this=0x555556bfb760) at ./poppler/Catalog.cc:818
#10 0x00007ffff538bd1a in poppler_document_get_page(PopplerDocument*, int) (document=0x555556bc8e00, index=0) at ./glib/poppler-document.cc:762
#11 0x00007ffff7135274 in Inkscape::Extension::Internal::PdfImportDialog::_setPreviewPage(int) (this=0x555555601c00, page=1) at ./src/extension/internal/pdfinput/pdf-input.cpp:627
#12 0x00007ffff713edfd in Inkscape::Extension::Internal::PdfImportDialog::PdfImportDialog(std::shared_ptr<PDFDoc>, char const*)Python Exception <class 'gdb.error'>: value has been optimized out
Python Exception <class 'gdb.error'>: value has been optimized out
 (this=0x555555601c00, doc=, this=<optimized out>, doc=) at ./src/extension/internal/pdfinput/pdf-input.cpp:351
#13 0x00007ffff7149149 in std::make_unique<Inkscape::Extension::Internal::PdfImportDialog, std::shared_ptr<PDFDoc>&, char const*&>(std::shared_ptr<PDFDoc>&, char const*&) () at /usr/include/c++/11/bits/unique_ptr.h:962
#14 Inkscape::Extension::Internal::PdfInput::open(Inkscape::Extension::Input*, char const*) (this=<optimized out>, uri=0x7fffffffd510 "/tmp/empty.pdf") at ./src/extension/internal/pdfinput/pdf-input.cpp:706
#15 0x00007ffff70832e5 in Inkscape::Extension::open(Inkscape::Extension::Extension*, char const*) (key=<optimized out>, filename=0x7fffffffd510 "/tmp/empty.pdf") at ./src/extension/system.cpp:125
#16 0x00007ffff719237a in ink_file_open(Glib::RefPtr<Gio::File> const&, bool*) (file=<optimized out>, cancelled_param=0x0) at /usr/include/c++/11/bits/basic_string.h:194
#17 0x00007ffff79a8754 in InkscapeApplication::document_open(Glib::RefPtr<Gio::File> const&, bool*) (this=0x555555599c00, file=..., cancelled=0x0) at ./src/inkscape-application.cpp:131
#18 0x00007ffff79cf288 in InkscapeApplication::on_open(std::vector<Glib::RefPtr<Gio::File>, std::allocator<Glib::RefPtr<Gio::File> > > const&, Glib::ustring const&) (this=0x555555599c00, files=<optimized out>, hint=<optimized out>) at ./src/inkscape-application.cpp:1021
#19 0x00007ffff6739565 in  () at /lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#20 0x00007ffff5818d2f in g_closure_invoke () at /usr/bin/../lib/x86_64-linux-gnu/inkscape/../libgobject-2.0.so.0
#21 0x00007ffff5834d51 in  () at /usr/bin/../lib/x86_64-linux-gnu/inkscape/../libgobject-2.0.so.0
#22 0x00007ffff5836554 in g_signal_emit_valist () at /usr/bin/../lib/x86_64-linux-gnu/inkscape/../libgobject-2.0.so.0
#23 0x00007ffff58367a3 in g_signal_emit () at /usr/bin/../lib/x86_64-linux-gnu/inkscape/../libgobject-2.0.so.0
#24 0x00007ffff5944900 in  () at /usr/bin/../lib/x86_64-linux-gnu/inkscape/../libgio-2.0.so.0
#25 0x00007ffff5944c16 in g_application_run () at /usr/bin/../lib/x86_64-linux-gnu/inkscape/../libgio-2.0.so.0
#26 0x00007ffff6189d90 in __libc_start_call_main (main=main@entry=0x5555555566a0 <main(int, char**)>, argc=argc@entry=2, argv=argv@entry=0x7fffffffdd28) at ../sysdeps/nptl/libc_start_call_main.h:58
#27 0x00007ffff6189e40 in __libc_start_main_impl (main=0x5555555566a0 <main(int, char**)>, argc=2, argv=0x7fffffffdd28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd18) at ../csu/libc-start.c:392
#28 0x00005555555570d5 in _start ()

There are some other threads waiting on mutexes, but they don't look all that interesting (they're in libgc and not waiting for the same mutex).

What should have happened?

Something.

Version info

Inkscape 1.1.2 (0a00cf5339, 2022-02-04)

    GLib version:     2.72.1
    GTK version:      3.24.33
    glibmm version:   2.66.2
    gtkmm version:    3.24.5
    libxml2 version:  2.9.13
    libxslt version:  1.1.34
    Cairo version:    1.16.0
    Pango version:    1.50.6
    HarfBuzz version: 2.7.4
    Poppler version:  22.02.0

    OS version:       KDE neon 5.26
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information