Bug#895649: inkscape: Segfault closing dialog after importing PDF

2019-10-30 Thread Omari Stephens
I just ran into (and resolved) this.  It appears to be a packaging / 
dynamic-linking problem.  Fundamentally, it seems that inkscape is not 
compatible with having multiple versions of libpoppler present and 
usable.  This also explains why this issue is so consistent for the 
people who encounter it, but never occurs for the people who don't 
encounter it.


My first thought, on seeing the ldd output in this bug, was "isn't it 
weird that inkscape is picking up two different versions of the same 
library?"  This turned out to be the fundamental issue.


My ldd output looked like this when I was experiencing the crash:
$ldd /usr/bin/inkscape | grep poppler
    libpoppler.so.82 => /usr/lib/x86_64-linux-gnu/libpoppler.so.82 
(0x7f09b1c4b000)
    libpoppler-glib.so.8 => 
/usr/lib/x86_64-linux-gnu/libpoppler-glib.so.8 (0x7f09b19ef000)
    libpoppler.so.72 => /usr/lib/x86_64-linux-gnu/libpoppler.so.72 
(0x7f09a8e74000)


I then checked to see which versions of libpoppler were installed.  It 
was a whole bunch of them:

15:20:51> [xsdg{angular}@/usr/lib/x86_64-linux-gnu]
$dpkg -S libpoppler*
libpoppler-cpp0v5:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-cpp.so.0
libpoppler-cpp-dev:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-cpp.so
libpoppler-cpp0v5:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-cpp.so.0.3.0
libpoppler-cpp0v5:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-cpp.so.0
libpoppler-cpp0v5:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-cpp.so.0.3.0
libpoppler-cpp0v5:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-cpp.so.0.3.0
libpoppler-glib-dev: /usr/lib/x86_64-linux-gnu/libpoppler-glib.so
libpoppler-glib8:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-glib.so.8.9.0
libpoppler-glib8:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-glib.so.8
libpoppler-glib8:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-glib.so.8.9.0
libpoppler-glib8:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-glib.so.8
libpoppler-glib8:amd64: /usr/lib/x86_64-linux-gnu/libpoppler-glib.so.8.9.0
libpoppler68:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.68.0.0
libpoppler-dev:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so
libpoppler72:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.72.0.0
libpoppler64:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.64
libpoppler73:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.73.0.0
libpoppler68:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.68
libpoppler80:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.80.0.0
libpoppler82:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.82.0.0
libpoppler64:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
libpoppler82:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.82
libpoppler80:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.80
libpoppler74:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.74.0.0
libpoppler74:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.74
libpoppler72:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.72
libpoppler73:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.73
libpoppler64:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.64
libpoppler64:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
libpoppler64:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
libpoppler68:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.68.0.0
libpoppler68:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.68
libpoppler68:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.68.0.0
libpoppler72:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.72.0.0
libpoppler72:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.72
libpoppler72:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.72.0.0
libpoppler73:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.73.0.0
libpoppler73:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.73
libpoppler73:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.73.0.0
libpoppler74:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.74.0.0
libpoppler74:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.74
libpoppler74:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.74.0.0
libpoppler80:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.80.0.0
libpoppler80:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.80
libpoppler80:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.80.0.0
libpoppler82:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.82.0.0
libpoppler82:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.82
libpoppler82:amd64: /usr/lib/x86_64-linux-gnu/libpoppler.so.82.0.0

I uninstalled all of the deprecated versions and upgraded to the latest:
(excerpt from /var/log/aptitude):
[REMOVE (PURGE)] libpoppler64:amd64 0.48.0-2
[REMOVE (PURGE)] libpoppler68:amd64 0.57.0-2
[REMOVE (PURGE)] libpoppler72:amd64 0.61.1-2
[REMOVE (PURGE)] libpoppler73:amd64 0.62.0-2
[REMOVE (PURGE)] libpoppler74:amd64 0.63.0-2
[REMOVE (PURGE)] libpoppler80:amd64 0.69.0-2
[UPGRADE] gir1.2-poppler-0.18:amd64 0.61.1-2 -> 0.71.0-6
[UPGRADE] libpoppler-cpp-dev:amd64 0.61.1-2 -> 0.71.0-6
[UPGRADE] libpoppler-cpp0v5:amd64 0.61.1-2 -> 0.71.0-6
[UPGRADE] libpoppler-dev:amd64 0.61.1-2 -> 0.71.0-6
[UPGRADE] libpoppler-glib-dev:amd64 0.61.1-2 -> 0.71.0-6
[UPGRAD

Bug#895649: inkscape: Segfault closing dialog after importing PDF

2018-04-20 Thread Kevin Locke
forwarded 895649 https://bugs.launchpad.net/inkscape/+bug/1541848
thanks

Hi Mattia,

Sorry for my long delay in responding.

On Sat, 2018-04-14 at 23:36 +0200, Mattia Rizzolo wrote:
> On Fri, Apr 13, 2018 at 07:25:25PM -0600, Kevin Locke wrote:
>> 4.  Open a second, PDF file with a different name (can be same or
>> different file contents).
>> This should open a second window for second PDF, but the second
>> window will have no dialogs open while the first window has two
>> duplicate Layers dialogs open.
> 
> I tried a couple of times, but this doesn't happen to me as you
> describe, the second PDF opens in a new window, with not Layers dialog,
> and the first window keeps only one -its own- Layers dialog.

After some more testing I realized after opening the Layers dialog you
must close then re-open Inkscape to save the open state in preferences
before step 4.  I have attached a script which reliably reproduces the
issue using a temporary home directory to avoid preferences issues.

>> At this point Inkscape will crash with SIGSEGV and the following
>> backtrace:
> … 
>> If you need any more details or more symbols in the backtrace, let me
>> know.
> 
> Could you please open a bug upstream on
> https://bugs.launchpad.net/inkscape ?
> We will then add a bug link here, but it's really an upstream problem.

Sure.  It's https://bugs.launchpad.net/inkscape/+bug/1541848

Cheers,
Kevin
#!/bin/sh
# Script to reproduce "Segfault closing dialog after importing PDFs"

set -Ceux

# Create an empty home directory for test prefs
temp_home=$(mktemp -d -t temphome-)

# Create PDF file (from https://stackoverflow.com/a/17280876) (any will work)
cat > "$temp_home/blank.pdf" <<'PDF'
%PDF-1.0
1 0 obj<>endobj 2 0 obj<>endobj 3 0 
obj<>endobj
trailer<>
PDF

# Make Layers visible by default in preferences
HOME=$temp_home inkscape --verb DialogLayers --verb FileQuit

# Run Inkscape and open any two PDF files
# User Action Required:
# - Press OK on each of the two Import Options dialogs
# - Should produce two Inkscape windows with both Layers dialogs in one window.
# - Close the two Layers dialogs then switch focus to the other window to crash.
HOME=$temp_home gdb -q -ex run --args \
inkscape -f "$temp_home/blank.pdf" -f "$temp_home/blank.pdf"


Bug#895649: inkscape: Segfault closing dialog after importing PDF

2018-04-14 Thread Mattia Rizzolo
Control: tag -1 unreproducible

Hi Kevin,

On Fri, Apr 13, 2018 at 07:25:25PM -0600, Kevin Locke wrote:
> 4.  Open a second, PDF file with a different name (can be same or
> different file contents).
> This should open a second window for second PDF, but the second
> window will have no dialogs open while the first window has two
> duplicate Layers dialogs open.

I tried a couple of times, but this doesn't happen to me as you
describe, the second PDF opens in a new window, with not Layers dialog,
and the first window keeps only one -its own- Layers dialog.

> At this point Inkscape will crash with SIGSEGV and the following
> backtrace:
… 
> If you need any more details or more symbols in the backtrace, let me
> know.

Could you please open a bug upstream on
https://bugs.launchpad.net/inkscape ?
We will then add a bug link here, but it's really an upstream problem.

Thanks in advance.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#895649: inkscape: Segfault closing dialog after importing PDF

2018-04-13 Thread Kevin Locke
Package: inkscape
Version: 0.92.3-1
Severity: normal

Dear Maintainer,

I am able to reliably produce a crash due to SIGSEGV when closing the
Layers dialog using the following procedure:

1.  Open Inkscape.
2.  Open the Layers dialog (Shift+Ctrl+L or Layer->Layers).
3.  Open a PDF file (File->Open select .pdf file, press OK, then
press OK to default import settings.)
4.  Open a second, PDF file with a different name (can be same or
different file contents).
This should open a second window for second PDF, but the second
window will have no dialogs open while the first window has two
duplicate Layers dialogs open.
5.  Close both of the Layers dialog in window for the first PDF file.
6.  Switch to the Inkscape window for the second PDF file.

At this point Inkscape will crash with SIGSEGV and the following
backtrace:

#0  0x75cdbfea in g_type_get_qdata ()
at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#1  0x70574ccb in Glib::wrap_auto(_GObject*, bool) ()
at /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#2  0x71b5292d in Glib::wrap(_GtkWidget*, bool) ()
at /usr/lib/x86_64-linux-gnu/libgtkmm-2.4.so.1
#3  0x77372200 in Inkscape::UI::Widget::DockItem::getWidget() 
(this=) at ./src/ui/widget/dock-item.cpp:109
#4  0x77372fa0 in Inkscape::UI::Widget::DockItem::getWindow() 
(this=) at ./src/ui/widget/dock-item.cpp:457
#5  0x771f1c3a in 
Inkscape::UI::Dialog::Behavior::DockBehavior::onDesktopActivated(SPDesktop*) 
(this=0x5a59fe30, desktop=0x564c9800)
at ./src/ui/dialog/dock-behavior.cpp:248
#6  0x774fab38 in sigc::internal::signal_emit1::emit(sigc::internal::signal_impl*, SPDesktop* const&) 
(_A_a1=@0x7fffd5b8: 0x564c9800, impl=0x56fe4ad0)
at /usr/include/sigc++-2.0/sigc++/signal.h:1045
#7  0x774fab38 in sigc::signal1::emit(SPDesktop* const&) const (this=0x5590fa50, 
_A_a1=@0x7fffd5b8: 0x564c9800) at 
/usr/include/sigc++-2.0/sigc++/signal.h:2955
#8  0x774fab38 in Inkscape::Application::activate_desktop(SPDesktop*) 
(this=0x5590fa00, desktop=) at ./src/inkscape.cpp:882
#9  0x774284b4 in SPDesktopWidget::onFocusInEvent(_GdkEventFocus*) 
(this=0x55866410) at ./src/widgets/desktop-widget.cpp:1919
#10 0x71b4f24b in  () at /usr/lib/x86_64-linux-gnu/libgtkmm-2.4.so.1
#11 0x710f62ab in  () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#12 0x75cb7f6d in g_closure_invoke ()
at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x75cca8d1 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x75cd2d8f in g_signal_emit_valist ()
at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x75cd3e0f in g_signal_emit ()
at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#16 0x7120c26c in  () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#17 0x710f4a23 in gtk_main_do_event ()
at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#18 0x7fffefe8504c in  () at /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#19 0x74a2f287 in g_main_context_dispatch ()
at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x74a2f4c0 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x74a2f7d2 in g_main_loop_run ()
at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x710f3977 in gtk_main ()
at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#23 0xce53 in sp_main_gui(int, char const**) (argc=, 
argv=) at ./src/main.cpp:1164
#24 0x7fffed7e0a87 in __libc_start_main (main=
0xa9c0 , argc=1, argv=0x7fffe008, 
init=, fini=, rtld_fini=, 
stack_end=0x7fffdff8) at ../csu/libc-start.c:310
#25 0xaf2a in _start ()

Note that after step 4 the following messages were printed:

** (inkscape:11143): WARNING **: 19:14:02.898: master 0x57795d80: unable to 
add object 0x5a5abad0[DialogFillStroke] to the hash.  There already is an 
item with that name (0x589e15b0).

** (inkscape:11143): WARNING **: 19:14:02.913: master 0x57795d80: unable to 
add object 0x5a5e62d0[DialogLayers] to the hash.  There already is an item 
with that name (0x589f8500).

If you need any more details or more symbols in the backtrace, let me
know.

Thanks,
Kevin


-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.16.1-kevinoid1 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), 
LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages inkscape depends on:
ii  libaspell150.60.7~20110707-4
ii  libatk1.0-02.28.1-1
ii  libatkmm-1.6-1v5   2.24.2-3
ii  libc6  2.27-3
ii  libcairo2  1.15.10-1
ii