Bug 365920 - Exporting file from pdf in command line crashes with segmentation fault.
Summary: Exporting file from pdf in command line crashes with segmentation fault.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 2.9
Platform: Microsoft Windows Android 5.x
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-21 04:15 UTC by a246246_246-kde
Modified: 2016-10-31 15:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description a246246_246-kde 2016-07-21 04:15:15 UTC
When I try to convert pdf to tiff using the following command line:

$krita.exe" --export --export-filename=sample.tif -- sample.pdf

It opens dialog "PDF Import Options".  Select First page and other settings are also kept as default, then click OK.

Program crashes with

Segmentation fault

and no tif image is generated. Note that sample.pdf is 1 page.


Reproducible: Always

Steps to Reproduce:
See Details.


Actual Results:  
Segmentation fault without result image.

Expected Results:  
result image is generated.
Comment 1 wolthera 2016-07-21 10:41:24 UTC
Are you sure you are on ms windows?

Anyway, reproducible on ubuntu 16.04, here's the GDB backtrace(seems to crash on the progress bar...):

(gdb) start --export --export-filename=sample.tif -- test.pdf
Temporary breakpoint 1 at 0x403f80: file /home/krita/kde/src/krita/krita/main.cc, line 63.
Starting program: /home/krita/kde/inst/bin/krita --export --export-filename=sample.tif -- test.pdf
conti[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
nukrita.lib.pigment: Legacy integer arithmetics implementation

Temporary breakpoint 1, main (argc=5, argv=0x7fffffffd8f8)
    at /home/krita/kde/src/krita/krita/main.cc:63
63	{
(gdb) continue
Continuing.
[New Thread 0x7fffe488c700 (LWP 30358)]
[New Thread 0x7fffda03e700 (LWP 30359)]
[New Thread 0x7fffd983d700 (LWP 30360)]
[New Thread 0x7fffd903c700 (LWP 30361)]
[New Thread 0x7fffcbfff700 (LWP 30362)]
[New Thread 0x7fffc0b41700 (LWP 30364)]
[New Thread 0x7fffbbfff700 (LWP 30365)]
Set style "fusion"
OpenGL Info
  Vendor:  Intel Open Source Technology Center
  Renderer:  Mesa DRI Intel(R) Ivybridge Mobile 
  Version:  3.0 Mesa 11.2.0
  Shading language:  1.30
  Requested format:  QSurfaceFormat(version 3.0, options QFlags(0x4), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 0, profile  2)
  Current format:    QSurfaceFormat(version 3.0, options QFlags(0x4), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 0, profile  0)
krita has opengl true
Setting XDG_DATA_DIRS "/home/krita/kde/inst/bin/../share:/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop"
Available translations QSet("en_US")
Available domain translations QSet("en_US")
Override language: ""
KoJsonTrader will load its plugins from "/home/krita/kde/inst/lib/x86_64-linux-gnu/kritaplugins"
[Thread 0x7fffbbfff700 (LWP 30365) exited]
krita.general: ERROR: no sample brush found in  "/home/krita/.local/share/krita/brushes/PHOTOSHOP_BRUSHES___swirls_by_darkmercy.abr"
[New Thread 0x7fffbbfff700 (LWP 30369)]
[New Thread 0x7fffa78e6700 (LWP 30370)]

Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
KoProgressUpdater::startSubtask (this=0x0, weight=weight@entry=1, name=...)
    at /home/krita/kde/src/krita/libs/widgetutils/KoProgressUpdater.cpp:115
115	    d->totalWeight += weight;
(gdb) thread apply all backtrace

Thread 10 (Thread 0x7fffa78e6700 (LWP 30370)):
#0  pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff558e7eb in QWaitCondition::wait(QMutex*, unsigned long) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#2  0x00007ffff5588116 in QSemaphore::tryAcquire(int, int) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#3  0x00007ffff3115dc3 in KisTileDataSwapper::waitForWork (
    this=<optimized out>)
    at /home/krita/kde/src/krita/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:86
#4  0x00007ffff3115fba in KisTileDataSwapper::run (
    this=0x7ffff3593380 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder+64>)
    at /home/krita/kde/src/krita/libs/image/tiles3/swap/kis_tile_data_swapper.cpp:92
#5  0x00007ffff558dc89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#6  0x00007fffef17f6fa in start_thread (arg=0x7fffa78e6700)
    at pthread_create.c:333
#7  0x00007ffff4c89b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
---Type <return> to continue, or q <return> to quit---

Thread 9 (Thread 0x7fffbbfff700 (LWP 30369)):
#0  pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff558e7eb in QWaitCondition::wait(QMutex*, unsigned long) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#2  0x00007ffff5587e8b in QSemaphore::acquire(int) ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#3  0x00007ffff30fc16e in KisTileDataPooler::waitForWork (
    this=0x7ffff3593340 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder>)
    at /home/krita/kde/src/krita/libs/image/tiles3/kis_tile_data_pooler.cc:165
#4  0x00007ffff30fc92a in KisTileDataPooler::run (
    this=0x7ffff3593340 <(anonymous namespace)::Q_QGS_s_instance::innerFunction()::holder>)
    at /home/krita/kde/src/krita/libs/image/tiles3/kis_tile_data_pooler.cc:187
#5  0x00007ffff558dc89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#6  0x00007fffef17f6fa in start_thread (arg=0x7fffbbfff700)
    at pthread_create.c:333
#7  0x00007ffff4c89b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

---Type <return> to continue, or q <return> to quit---
Thread 7 (Thread 0x7fffc0b41700 (LWP 30364)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fffee898cca in g_cond_wait_until ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffee828929 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fffee828f4b in g_async_queue_timeout_pop ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fffee87b59a in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fffee87ab45 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007fffef17f6fa in start_thread (arg=0x7fffc0b41700)
    at pthread_create.c:333
#7  0x00007ffff4c89b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7fffcbfff700 (LWP 30362)):
#0  0x00007ffff4c7de8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffee85431c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffee85442c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff579f4fc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#4  0x00007ffff574defa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---
#5  0x00007ffff558938c in QThread::exec() ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#6  0x00007fffef3aacd5 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5DBus.so.5
#7  0x00007ffff558dc89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#8  0x00007fffef17f6fa in start_thread (arg=0x7fffcbfff700)
    at pthread_create.c:333
#9  0x00007ffff4c89b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7fffd903c700 (LWP 30361)):
#0  0x00007ffff4c7de8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffee85431c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffee8546a2 in g_main_loop_run ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fffde499906 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007fffee87ab45 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fffef17f6fa in start_thread (arg=0x7fffd903c700)
    at pthread_create.c:333
#6  0x00007ffff4c89b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

---Type <return> to continue, or q <return> to quit---
Thread 4 (Thread 0x7fffd983d700 (LWP 30360)):
#0  0x00007ffff4c7de8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffee85431c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffee85442c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fffee854469 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fffee87ab45 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fffef17f6fa in start_thread (arg=0x7fffd983d700)
    at pthread_create.c:333
#6  0x00007ffff4c89b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fffda03e700 (LWP 30359)):
#0  0x00007ffff4c7de8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fffee85431c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffee85442c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fffda04628d in ?? ()
   from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007fffee87ab45 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fffef17f6fa in start_thread (arg=0x7fffda03e700)
    at pthread_create.c:333
#6  0x00007ffff4c89b5d in clone ()
---Type <return> to continue, or q <return> to quit---
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fffe488c700 (LWP 30358)):
#0  0x00007ffff4c7de8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff35acc62 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007ffff35ae8d7 in xcb_wait_for_event ()
   from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fffe573bdc9 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5
#4  0x00007ffff558dc89 in ?? ()
   from /home/krita/Qt/5.6/gcc_64/lib/libQt5Core.so.5
#5  0x00007fffef17f6fa in start_thread (arg=0x7fffe488c700)
    at pthread_create.c:333
#6  0x00007ffff4c89b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ffff7f0f8c0 (LWP 30353)):
#0  KoProgressUpdater::startSubtask (this=0x0, weight=weight@entry=1, name=...)
    at /home/krita/kde/src/krita/libs/widgetutils/KoProgressUpdater.cpp:115
#1  0x00007fffa844d1b7 in KisPDFImport::convert (this=0xc94fe50)
    at /home/krita/kde/src/krita/plugins/impex/pdf/kis_pdf_import.cpp:137
#2  0x00007ffff78f9e25 in CalligraFilter::ChainLink::invokeFilter (
    this=0xc30fb80)
---Type <return> to continue, or q <return> to quit---
    at /home/krita/kde/src/krita/libs/ui/KisFilterChainLink.cpp:87
#3  0x00007ffff78f9045 in KisFilterChain::invokeChain (
    this=this@entry=0xc904670)
    at /home/krita/kde/src/krita/libs/ui/KisFilterChain.cpp:92
#4  0x00007ffff7900605 in KisImportExportManager::importDocument (
    this=0xc2e59d0, location=..., documentMimeType=..., 
    status=@0x7fffffffcf10: KisImportExportFilter::OK)
    at /home/krita/kde/src/krita/libs/ui/KisImportExportManager.cpp:156
#5  0x00007ffff78eaa8d in KisDocument::openFile (this=0xc2e5f40)
    at /home/krita/kde/src/krita/libs/ui/KisDocument.cpp:1212
#6  0x00007ffff78eb168 in KisDocument::Private::openFile (this=0xc2e6510)
    at /home/krita/kde/src/krita/libs/ui/KisDocument.cpp:370
#7  KisDocument::Private::openLocalFile (this=0xc2e6510)
    at /home/krita/kde/src/krita/libs/ui/KisDocument.cpp:387
#8  KisDocument::openUrlInternal (this=this@entry=0xc2e5f40, url=...)
    at /home/krita/kde/src/krita/libs/ui/KisDocument.cpp:2213
#9  0x00007ffff78eb5bb in KisDocument::openUrl (this=this@entry=0xc2e5f40, 
    _url=..., flags=flags@entry=KisDocument::OPEN_URL_FLAG_NONE)
    at /home/krita/kde/src/krita/libs/ui/KisDocument.cpp:1144
#10 0x00007ffff78d9d8c in KisApplication::start (
    this=this@entry=0x7fffffffd760, args=...)
    at /home/krita/kde/src/krita/libs/ui/KisApplication.cpp:426
#11 0x0000000000404a1f in main (argc=5, argv=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at /home/krita/kde/src/krita/krita/main.cc:219
(gdb) q
Comment 2 a246246_246-kde 2016-07-21 10:56:20 UTC
(In reply to wolthera from comment #1)
> Are you sure you are on ms windows?

Yes. I forgot to say I invoked the command from cygwin.
Comment 3 wolthera 2016-07-21 13:47:44 UTC
Ah, seems we have a cygwin option under ms windows :) I'll mark it like that.
Comment 4 Halla Rempt 2016-07-21 13:53:31 UTC
https://cygwin.com/cgi-bin2/package-grep.cgi?grep=krita&arch=x86_64 doesn't carry 3.0, so I'm wondering if this really is 3.0? In any case, we can reproduce it in master.
Comment 5 a246246_246-kde 2016-07-23 23:33:54 UTC
Sorry for confusing. I invoked standard windows binary (3.0) distributed from you from cygwin bash.
From command prompt, it also crashed with windows dialog.
Comment 6 Halla Rempt 2016-10-31 15:07:17 UTC
I no longer get a crash. Export to pdf sucks, but it "works" now.