core dump exporting to non existing folder

Bug #430301 reported by Jeroen van der Vegt
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
John Smith

Bug Description

These are three (minor) reports in one:

1. Exporting an SVG to a PDF on the commandline to a non-exisiting folder using inkscape 0.46 results in a segfault. See the example below (the folder 'pfd' is a typo in the command and should have been 'pdf'):

$ inkscape -f svg/dbschema.svg -A pfd/dbschema.pdf
inkscape: fopen(pfd/dbschema.pdf): No such file or directory
terminate called after throwing an instance of 'Inkscape::Extension::Output::save_failed'

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.

Afgebroken (core dumped)
$

Exporting to other formats (like PS or EPS) does not show this behaviour.

2. Exporting a PNG shows this error:

$ inkscape -f svg/dbschema.svg -e pfd/dbschema.png
Background RRGGBBAA: ffffff00
Area 0:0:744.094:1052.36 exported to 744 x 1052 pixels (90 dpi)
Bitmap saved as: pfd/dbschema.png

** (inkscape:15526): CRITICAL **: bool sp_png_write_rgba_striped(const gchar*, long unsigned int, long unsigned int, double, double, int (*)(const guchar**, int, int, void*), void*): assertion `fp != NULL' failed
$

3. Supplying the '-D' argument when exporting a PDF results in a weird and incorrect warning: the file IS exported correctly.

$ inkscape -D -f svg/dbschema.svg -A dbschema.pdf

** (inkscape:15636): WARNING **: No export filename given and no filename hint. Nothing exported.
$

Revision history for this message
theAdib (theadib) wrote :

Hello Jeroen, I guess you are using inkscape-0.46 on a Linux system.
Could you please:
- get a daily version higher than svn revision 22241 and test again,
- could you also describe what would you expect? Sould the export fail on nonexisting path or should inkscape create the path?
  In my opinion inkscape should fail as a simple copy command would do. Do you agree.
  I agree inkscape must not die that way.
Regards, Adib.

tags: added: crash exporting saving
Changed in inkscape:
status: New → Triaged
importance: Undecided → Medium
importance: Medium → High
Revision history for this message
Jeroen van der Vegt (ajvdvegt) wrote : Re: [Bug 430301] Re: core dump exporting to non existing folder

Hello,

Yes, I'm using Inkscape 0.46 on Linux. I couldn't find a preview of
0.47 for Linux on the Inkscape website, that's why I couldn't supply a
report of a more up-to-date version.

As to my expection: an error telling me that the file couldn't be
created would be perfect (and returning an error code > 0); please no
auto-creation of folders. So I agree to failing as copy would do.

I'm upgrading my distribution right now, I'll try recreating the error
this weekend.

Regards,

Jeroen.

2009/9/16 theAdib <email address hidden>:
> Hello Jeroen, I guess you are using inkscape-0.46 on a Linux system.
> Could you please:
> - get a daily version higher than svn revision 22241 and test again,
> - could you also describe what would you expect? Sould the export fail on nonexisting path or should inkscape create the path?
>  In my opinion inkscape should fail as a simple copy command would do. Do you agree.
>  I agree inkscape must not die that way.
> Regards, Adib.
>
> ** Tags added: crash exporting saving
>
> ** Changed in: inkscape
>       Status: New => Triaged
>
> ** Changed in: inkscape
>   Importance: Undecided => Medium
>
> ** Changed in: inkscape
>   Importance: Medium => High
>
> --
> core dump exporting to non existing folder
> https://bugs.launchpad.net/bugs/430301
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Jeroen van der Vegt (ajvdvegt) wrote :

I reproduced the problem with the PPA version of inkscpae, I suppose
0.47 pre3? (though 'inkscape --version still reports 0.46+devel!). It
was build today, september 25th.

It seems issue three is resolved, but (1) and (2) still exist:

(1)
Exporting a PDF to a non-existing folder generates this:

jeroen@cerebro:/tmp$ LANG=C inkscape-devel -A pdf/test.pdf Tekening.svg
inkscape: fopen(pdf/test.pdf): No such file or directory
terminate called after throwing an instance of
'Inkscape::Extension::Output::save_failed'

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.

Aborted
jeroen@cerebro:/tmp

(2):
Exporting a PNG to a non-existing folder generates this:

jeroen@cerebro:/tmp$ LANG=C inkscape-devel -e pdf/test.png Tekening.svg
Background RRGGBBAA: ffffff00
Area 0:0:744.094:1052.36 exported to 744 x 1052 pixels (90 dpi)
Bitmap saved as: pdf/test.png

** (inkscape-devel:28279): CRITICAL **: bool
sp_png_write_rgba_striped(SPDocument*, const gchar*, long unsigned
int, long unsigned int, double, double, int (*)(const guchar**, int,
int, void*), void*): assertion `fp != NULL' failed
jeroen@cerebro:/tmp$

Regards,

Jeroen.

Revision history for this message
Jeroen van der Vegt (ajvdvegt) wrote :
Download full text (4.0 KiB)

Hi,

I just upgraded to the build from oktober 4th, and the bug is still
in. Exporting to vector formats to non-exisiting folders give an
identical crash message, exporting to PNG gives a completely different
error:

jeroen@cerebro:/tmp$ inkscape-devel -P ps/test.ps Tekening.svg
inkscape: fopen(ps/test.ps): Bestand of map bestaat niet
terminate called after throwing an instance of
'Inkscape::Extension::Output::save_failed'

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: Er is een interne fout opgetreden in Inkscape. Het
programma wordt afgesloten.

Afgebroken
jeroen@cerebro:/tmp$ inkscape-devel -A pdf/test.pdf Tekening.svg
inkscape: fopen(pdf/test.pdf): Bestand of map bestaat niet
terminate called after throwing an instance of
'Inkscape::Extension::Output::save_failed'

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: Er is een interne fout opgetreden in Inkscape. Het
programma wordt afgesloten.

Afgebroken
jeroen@cerebro:/tmp$ inkscape-devel -E eps/test.eps Tekening.svg
inkscape: fopen(eps/test.eps): Bestand of map bestaat niet
terminate called after throwing an instance of
'Inkscape::Extension::Output::save_failed'

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: Er is een interne fout opgetreden in Inkscape. Het
programma wordt afgesloten.

Afgebroken
jeroen@cerebro:/tmp$ inkscape-devel -e png/test.png Tekening.svg
Background RRGGBBAA: ffffff00
Area 0:0:744,094:1052,36 exported to 744 x 1052 pixels (90 dpi)
Bitmap saved as: png/test.png

** (inkscape-devel:7634): CRITICAL **: bool
sp_png_write_rgba_striped(SPDocument*, const gchar*, long unsigned
int, long unsigned int, double, double, int (*)(const guchar**, int,
int, void*), void*): assertion `fp != NULL' failed
jeroen@cerebro:/tmp$ inkscape-devel -V
Inkscape 0.46+devel (Oct 4 2009)
jeroen@cerebro:/tmp$ ls -1
Tekening.svg
test.ps
jeroen@cerebro:/tmp$

I would expect a more or less identical error in all cases, telling me
the folder I entered does not exists an that I should make it my self
first.

Regards,

Jeroen van der Vegt.

2009/9/25 Jeroen van der Vegt <email address hidden>:
> I reproduced the problem with the PPA version of inkscpae, I suppose
> 0.47 pre3? (though 'inkscape --version still reports 0.46+devel!). It
> was build today, september 25th.
>
> It seems issue three is resolved, but (1) and (2) still exist:
>
> (1)
> Exporting a PDF to a non-existing folder generates this:
>
> jeroen@cerebro:/tmp$ LANG=C inkscape-devel -A pdf/test.pdf Tekening.svg
> inkscape: fopen(pdf/test.pdf): No such file or directory
> terminate called after throwing an instance of
> 'Inkscape::Extension::...

Read more...

su_v (suv-lp)
tags: added: cli
Revision history for this message
Jan Pulmann (jan-pulmann) wrote :

Hi.
I wrote patch that should fix this bug. It checks the directory of path you specify, and I also changed return values of few functions in main.cpp so it is possible to return 1 on failure. You also get warning with more apt message.
I would like to ask for someone kind to review it, I am not sure about changes in main, if there was reason for the way return code was handled previosly
Jan Pulmann

Revision history for this message
John Smith (john-smithi) wrote :

@Jan thanks for the patch - It looks good to me !
There has been some changes to exit codes on error (bug #993500), that conflicted with this patch.

Have modified your patch a little to compile again.

Changed in inkscape:
assignee: nobody → John Smith (john-smithi)
Revision history for this message
John Smith (john-smithi) wrote :

Fix committed to trunk as 11915.

Changed in inkscape:
status: Triaged → Fix Committed
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.