Comment 9 for bug 1670688

Revision history for this message
wixkkomi (wixkkomi) wrote : Re: [Bug 1670688] Re: Internal error on closing or saving
  • sigsegv.diff Edit (737 bytes, text/plain; charset=US-ASCII; name="sigsegv.diff")

Through debugging, I can confirm that this bug is caused by accessing a
deleted pointer which is an undefined behaviour. The reason that it does
not happen every time is we immediately allocate a new EventLog after
deleting an older one. And for most of the time, the new EventLog is
allocated from the same address where the deleted one resided. Thus
accessing that address in the destructor of the replaced document doesn't
trigger SIGSEGV. I've tested it by deleting the older pointer after
allocating the new one and Inkscape crashes every time now. I've attached
the modified code for your review.

The line "doc->removeUndoObserver(*event_log);" has no effect now because
bug lp:1071082 has been fixed in rev.13127. I'll update the branch later.

On Tue, Mar 14, 2017 at 4:38 AM, Eman Modnar <email address hidden>
wrote:

> I've tested the patch with r15592 on Linux. No crash anymore.
>
> This report (https://bugs.launchpad.net/inkscape/+bug/1667622) could be
> related to the bug.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1670688
>
> Title:
> Internal error on closing or saving
>
> Status in Inkscape:
> In Progress
>
> Bug description:
> Version: 0.92.1-1 (actually it happens with versions start from 0.92.0-3)
> Platform: 64-bit Arch, kernel version is 4.9.11
> Locale: en_US
>
> Steps to reproduce:
> Start Inkscape, leave the untitled window as it is and opens another
> file (any file is OK). Draw something in the opened window and try to save
> or close it w/o saving. Inkscape will crash afterwards. However, if
> multiple files are opened, the error will not be triggered unless the last
> opened file gets saved/closed.
>
> Downgrading to 0.91 r13725 eliminates the error.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/inkscape/+bug/1670688/+subscriptions
>