Dear Maintainer,
I tried to investigate a little further and think
I have found some details.

When starting inkscape from a terminal and opening the
given PDF shows a "double free" message.

A valgrind run [2] shows the causing lines at a first glance.

On a second look [3] it might be related to
having the PDFDoc object constructed by libpoppler.so.123.
But the deconstructor is called from libpoppler.so.118.

These two versions of lippoppler in the same process seem
to be caused by the old version 1.1.2-3+b1 of inkscape still in testing
and the new version 1.2.1+ds-1 not transitioning
from unstable to testing [4] [6].

Unfortunately libpoppler-glib8 is already in a version in testing
that is pulling the newer libpoppler.so.123 into the process. [5]

As a workaround it might work to install just the inkscape package
from unstable into a testing system. The PDF import worked at least
for me in my test VM without this issue.

Kind regards,
Bernhard



[1]
free(): double free detected in tcache 2



[2]
==1617== Invalid free() / delete / delete[] / realloc()
==1617==    at 0x484399B: operator delete(void*, unsigned long) 
(vg_replace_malloc.c:935)
==1617==    by 0x75AD734: PDFDoc::~PDFDoc() (PDFDoc.cc:362)
==1617==    by 0x77997BD: _poppler_document_new_from_pdfdoc(std::unique_ptr<GlobalParamsIniter, 
std::default_delete<GlobalParamsIniter> >&&, PDFDoc*, _GError**) 
(poppler-document.cc:148)
==1617==    by 0x7799A43: poppler_document_new_from_file 
(poppler-document.cc:232)
...
==1617==  Address 0xe2b4ac0 is 0 bytes inside a block of size 62 free'd
==1617==    at 0x484317B: free (vg_replace_malloc.c:872)
==1617==    by 0x7799A33: poppler_document_new_from_file 
(poppler-document.cc:230)
...
==1617==  Block was alloc'd at
==1617==    at 0x48407B4: malloc (vg_replace_malloc.c:381)
==1617==    by 0x61FE678: g_malloc (gmem.c:130)
==1617==    by 0x6218C8E: g_strdup (gstrfuncs.c:363)
==1617==    by 0x61D75E8: g_filename_from_uri (gconvert.c:1786)
==1617==    by 0x77998FA: poppler_document_new_from_file 
(poppler-document.cc:196)
...



[3]
(rr) bt 2
#0  PDFDoc::PDFDoc(std::unique_ptr<GooString, std::default_delete<GooString> >&&, std::optional<GooString> 
const&, std::optional<GooString> const&, void*, std::function<void ()> const&) (this=this@entry=0x55746d763710, 
fileNameA=..., ownerPassword=std::optional<GooString> [no contained value], userPassword=std::optional<GooString> [no contained 
value], guiDataA=guiDataA@entry=0x0, xrefReconstructedCallback=...) at ./poppler/PDFDoc.cc:127
#1  0x00007f31cfa0a9cd in poppler_document_new_from_file(char const*, char const*, 
GError**) (uri=<optimized out>, password=0x0, error=0x0) at 
./glib/poppler-document.cc:223
(More stack frames follow...)
(rr) info symbol $pc
PDFDoc::PDFDoc(std::unique_ptr<GooString, std::default_delete<GooString> >&&, std::optional<GooString> 
const&, std::optional<GooString> const&, void*, std::function<void ()> const&) in section .text of 
/lib/x86_64-linux-gnu/libpoppler.so.123
(rr) ptype /o this
type = class PDFDoc {
                             private:
/*      0      |       8 */    std::unique_ptr<GooString> fileName;
/*      8      |       8 */    std::unique_ptr<GooFile> file;
/*     16      |       8 */    BaseStream *str;
...
(rr) cont
...
(rr) bt 2
#0  PDFDoc::~PDFDoc() (this=0x55746d763710, __in_chrg=<optimized out>) at 
./poppler/PDFDoc.cc:334
#1  0x00007f31cfa0a7be in _poppler_document_new_from_pdfdoc(std::unique_ptr<GlobalParamsIniter, 
std::default_delete<GlobalParamsIniter> >&&, PDFDoc*, GError**) (initer=..., 
newDoc=newDoc@entry=0x55746d763710, error=error@entry=0x0) at ./glib/poppler-document.cc:148
(More stack frames follow...)
(rr) info symbol $pc
PDFDoc::~PDFDoc() in section .text of 
/usr/bin/../lib/x86_64-linux-gnu/inkscape/../libpoppler.so.118
(rr) ptype /o this
type = class PDFDoc {
                             private:
/*      0      |       8 */    const GooString *fileName;
/*      8      |       8 */    GooFile *file;
/*     16      |       8 */    BaseStream *str;
...



[4]
$ dpkg -l | grep -E "inkscape|poppler"
ii  inkscape                           1.1.2-3+b1                        amd64  
      vector-based drawing program
ii  libpoppler-glib8:amd64             22.08.0-2.1                       amd64  
      PDF rendering library (GLib-based shared library)
ii  libpoppler118:amd64                22.02.0-3                         amd64  
      PDF rendering library
ii  libpoppler123:amd64                22.08.0-2.1                       amd64  
      PDF rendering library
...



[5]
# libtree /usr/bin/inkscape
/usr/bin/inkscape
├── libinkscape_base.so [runpath]
...
│   ├── libpoppler-glib.so.8 [runpath]
│   │   ├── libpoppler.so.123 [ld.so.conf]
...
│   ├── libpoppler.so.118 [runpath]
...



[6]
https://tracker.debian.org/pkg/inkscape

Reply via email to