Bug 400459 - 4.1 only: CLI export does not work for some file while GUI export works for the same file
Summary: 4.1 only: CLI export does not work for some file while GUI export works for t...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 4.1.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-29 21:02 UTC by minecraft2048
Modified: 2019-05-16 10:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Krita file that this bug happened (2.07 MB, application/x-krita)
2018-10-29 21:02 UTC, minecraft2048
Details

Note You need to log in before you can comment on or make changes to this bug.
Description minecraft2048 2018-10-29 21:02:51 UTC
Created attachment 115969 [details]
Krita file that this bug happened

SUMMARY

When I try to export through command line for some file, there is no output.png in the folder while if I use the export dialog in File > Export the file exported successfully. The thing is that this happens only to some file, which is totally random to me

STEPS TO REPRODUCE
1. Download attached .kra file
2. Use Krita export dialog (File > Export) to any .png name and that will run successfully
3. Run krita assign3_6.kra --export --export-filename asdf.png on the same folder as the downloaded .kra file and see that there is no asdf.png in that folder after the command has exited

OBSERVED RESULT

For GUI export it works as expected, there is a correct not corrupted .png on destination folder, while with CLI export there is no .png at all, and no error message at the terminal window

Terminal output:
   
$  krita assign3_6.kra --export --export-filename aas.png
Invalid profile :  "/usr/share/color/icc/colord/Crayons.icc" "Crayon Colors"
Invalid profile :  "/usr/share/color/icc/colord/x11-colors.icc" "X11 Colors"
krita.general: Warning: some tiles have leaked:
krita.general: 	Tiles in memory: 11905 
 	Total tiles: 11905
$  ls
assign3_6.kra


EXPECTED RESULT

CLI export works if GUI export works, so there should be a .png file on that folder 

ADDITIONAL INFORMATION

Krita
  Version: 4.1.5

Qt
  Version (compiled): 5.11.2
  Version (loaded): 5.11.2

OS Information
  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.18.16-arch1-1-ARCH
  Pretty Productname: Arch Linux
  Product Type: arch
  Product Version: unknown

OpenGL Info
  **OpenGL not initialized**
Comment 1 Halla Rempt 2018-10-30 13:09:07 UTC
Interesting... With 4.1.3 and 4.1 built from the stable branch, I get a segmentation fault. The 4.1.5 appimage silently fails. However, with the nightly build, the png image is generated correctly. 

This is the backtrace:

#0  tcache_get (tc_idx=5) at malloc.c:2943
#1  __GI___libc_malloc (bytes=96) at malloc.c:3050
#2  0x00007ffff4a290a2 in QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff4aa1883 in QString::QString(int, Qt::Initialization) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff6578835 in QStringBuilder<QString, QChar>::convertTo<QString> (this=<optimized out>)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstringbuilder.h:112
#5  QStringBuilder<QString, QChar>::operator QString (this=<optimized out>)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstringbuilder.h:131
#6  cleanupDirs (path=...) at /home/boud/dev/4.1/libs/widgetutils/KoResourcePaths.cpp:53
#7  KoResourcePaths::saveLocation (type=<optimized out>, suffix=..., create=<optimized out>)
    at /home/boud/dev/4.1/libs/widgetutils/KoResourcePaths.cpp:236
#8  0x00007ffff16c8c94 in KoResourceTagStore::serializeTags (this=this@entry=0x5555591b9170)
    at /home/boud/dev/4.1/libs/widgets/KoResourceTagStore.cpp:416
#9  0x00007ffff16c8f2e in KoResourceTagStore::~KoResourceTagStore (this=0x5555591b9170, 
    __in_chrg=<optimized out>) at /home/boud/dev/4.1/libs/widgets/KoResourceTagStore.cpp:58
#10 0x00007ffff717cd66 in KoResourceServer<KisResourceBundle, PointerStoragePolicy<KisResourceBundle> >::~KoResourceServer (this=this@entry=0x55555915a9f0, __in_chrg=<optimized out>)
    at /home/boud/dev/4.1/libs/widgets/KoResourceServer.h:150
#11 0x00007ffff717d043 in KoResourceServerSimpleConstruction<KisResourceBundle, PointerStoragePolicy<KisResourceBundle> >::~KoResourceServerSimpleConstruction (this=0x55555915a9f0, __in_chrg=<optimized out>)
    at /home/boud/dev/4.1/libs/widgets/KoResourceServer.h:747
#12 KoResourceServerSimpleConstruction<KisResourceBundle, PointerStoragePolicy<KisResourceBundle> >::~KoResourceServerSimpleConstruction (this=0x55555915a9f0, __in_chrg=<optimized out>)
    at /home/boud/dev/4.1/libs/widgets/KoResourceServer.h:747
#13 0x00007ffff717b611 in KisResourceBundleServerProvider::~KisResourceBundleServerProvider (
    this=0x7ffff7dcc0d0 <_ZZN12_GLOBAL__N_116Q_QGS_s_instance13innerFunctionEvE6holder>, 
    __in_chrg=<optimized out>) at /home/boud/dev/4.1/libs/ui/KisResourceBundleServerProvider.cpp:56
#14 0x00007ffff717b629 in (anonymous namespace)::Q_QGS_s_instance::Holder::~Holder (this=<optimized out>, 
    __in_chrg=<optimized out>) at /home/boud/dev/4.1/libs/ui/KisResourceBundleServerProvider.cpp:38
#15 0x00007ffff4029041 in __run_exit_handlers (status=0, listp=0x7ffff43d1718 <__exit_funcs>, 
    run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#16 0x00007ffff402913a in __GI_exit (status=<optimized out>) at exit.c:139
#17 0x00007ffff4007b9e in __libc_start_main (main=0x555555e8be00 <main(int, char**)>, argc=5, 
    argv=0x7fffffffd7f8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffffffd7e8) at ../csu/libc-start.c:344
#18 0x0000555555e8deba in _start ()

The crash happens when the application is destructing itself, so that cannot explain the issue that the png image isn't created, though.

The issue is fixed in master, and the next Krita release will be 4.2.0, there won't be a 4.1.7 in all likelihood.

Note that there's a workaround: you can extract the mergedimage.png from the kra file without needing to do any conversion.

 unzip assign3_6.kra mergedimage.png 
 mv mergedimage.png assign3_6.png

I will leave the bug open until we release 4.2.0, in case we do decide to release another 4.1.x, because then we need to figure out how to backport the fix.
Comment 2 Halla Rempt 2019-05-16 10:24:40 UTC
We're releasing 4.2 this month.