Segmentation fault (core dumped) when calling ScreenImageMgr.creaeteScreenImage() with non-existent path

Bug #1276737 reported by Jake Chapman-Olsen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
Medium
Alexander Wolf

Bug Description

Stellarium will crash when trying to createScreenImage() from a script where the path to image is invalid.
After running the following in a script

ScreenImageMgr.createScreenImage("image", "path/to/image.png", 100, 100, 1, true, 1, 1);

Stellarium will crash with

Failed to create ScreenImage: file not found: scripts/path/to/image.png
Segmentation fault (core dumped)

On occasion I would need to run the script twice to get the crash.
I was also unable to catch the error in a try, catch statement.

Tested with Stellarium 0.12.4 on Ubuntu 13.10 64-bit.
But have also noticed the bug in other versions of Stellarium on OS X as well.

Jake

Tags: scripting

Related branches

Revision history for this message
Jake Chapman-Olsen (jake-k-co) wrote :
tags: added: scripting
Changed in stellarium:
importance: Undecided → Medium
assignee: nobody → Alexander Wolf (alexwolf)
milestone: none → 0.13.0
Revision history for this message
Alexander Wolf (alexwolf) wrote :

I can't catch crash. Can you give script, which gave crash?

Revision history for this message
Jake Chapman-Olsen (jake-k-co) wrote :

That one line is simply all I needed in a script to crash. It does seem that the script needs to be run twice to get the crash however.

ScreenImageMgr.createScreenImage("image", "path/to/image.png", 100, 100, 1, true, 1, 1);

I'll upload the log I get when in OS X as well

Revision history for this message
Jake Chapman-Olsen (jake-k-co) wrote :

Stellarium log.txt doesn't show "Segmentation fault: 11" which is shown when Stellarium is run from OS X terminal

Revision history for this message
Jake Chapman-Olsen (jake-k-co) wrote :

And here is the OS X "Problem Report for Stellarium"

Changed in stellarium:
status: New → Confirmed
Revision history for this message
Alexander Wolf (alexwolf) wrote :

A fix has been committed as revision 6558 of the trunk branch in Stellarium's Bazaar repository at Launchpad:
http://bazaar.launchpad.net/~stellarium/stellarium/trunk/revision/6558

Note: work of file management in series 0.13 was changed and if you want porting this patch into series 0.12, then you should use try() catch() instead path.isEmpty() inside ScreenImageMgr::createScreenImage() method.

Changed in stellarium:
status: Confirmed → Fix Committed
Changed in stellarium:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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