0.92.4 Crash on CLI print

Migrated from: https://bugs.launchpad.net/inkscape/+bug/511361

Steps to reproduce:

  • Create a simple Inkscape file, e.g. a single rectangle mm.svg
  • inkscape --print=">mm.ps" mm.svg or inkscape --print="mm.ps" mm.svg

What happened?

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can fix it.
** Message: Error: Inkscape encountered an internal error and will close now.

Segmentation fault

Thread 1 "inkscape" received signal SIGSEGV, Segmentation fault.
0x00007ffff6697a08 in Inkscape::Extension::Extension::get_param (this=0x0, 
    name=0x7ffff749f8ce "destination") at ../src/extension/extension.cpp:410
410	    if (this->parameters == NULL) {
(gdb) bt
#0  0x00007ffff6697a08 in Inkscape::Extension::Extension::get_param(char const*) (this=0x0, name=0x7ffff749f8ce "destination")
    at ../src/extension/extension.cpp:410
#1  0x00007ffff6697b33 in Inkscape::Extension::Extension::get_param(char const*) const (this=0x0, name=0x7ffff749f8ce "destination")
    at ../src/extension/extension.cpp:434
#2  0x00007ffff6697b61 in Inkscape::Extension::Extension::get_param_string(char const*, SPDocument const*, Inkscape::XML::Node const*) const (this=0x0, name=0x7ffff749f8ce "destination", doc=0x0, node=0x0)
    at ../src/extension/extension.cpp:439
#3  0x00007ffff6f35e37 in sp_print_document_to_file(SPDocument*, char const*) (doc=0x5555563f2dc0, filename=0x555555909820 ">b.ps") at ../src/print.cpp:99
#4  0x0000555555566802 in sp_process_file_list(GSList*) (fl=0x5555558dc460)
    at ../src/main.cpp:1250
#5  0x00005555555674b7 in sp_main_console(int, char const**) (argc=3, argv=0x7fffffffdf88) at ../src/main.cpp:1454
#6  0x00005555555659ce in main(int, char**) (argc=3, argv=0x7fffffffdf88)
    at ../src/main.cpp:819

Backtrace from 0.92.x (0670a15bde, 2019-04-22) Linux Mint 19.1

What should have happened?

No crash. This feature is useful as it allows for piping. It is currently not present in 1.0alpha (to my knowledge), so did not test it on 1.0alpha.

Inkscape Version and Operating System:

  • 0.92.x (0670a15bde, 2019-04-22) Linux Mint 19.1
  • 0.92.3 (2405546, 2018-03-11) Linux Mint 19.1
  • 0.47pre4 r22446 Ubuntu 9.10
  • 0.46+devel r22653 (Jan 22 2010) Ubuntu 9.10
  • ... a lot more, with tests up to 2017 with up to date versions along the way and various OSs (Ubuntu, Debian, Mac)

Alvin Penner:

 works normally on Oct 13, 2008, SVN rev 19989  
 crashes on Nov 20, 2008, SVN rev 20225  

Lars Kruse:

 The first revision exposing the segfault is rev 20191

 From the svn log:
     remove old ps exporter, obsoleted by cairo ps export

     The relevant diff seems to be the following (but maybe I am wrong) in `src/extension/init.cpp: - Internal::PrintPS::init();`
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information