gnome-splashscreen-manager crash on start

Bug #199229 reported by Michael
6
Affects Status Importance Assigned to Milestone
gnome-art (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: gnome-splashscreen-manager

release: Ubuntu 7.10
package: gnome-splashscreen-manager
package version: 0.2-7ubuntu1
expected behaviour : Proper start of the gnome splash screen manager.
actual behaviour: Crash on start

The crash happened because of the faulty splash screen file in ~/.gnome2/gnome-art/download/splashscreens
The file name is "Splash-CountrySplash.png"

After starting the splash manager from the command line:

$ sudo gnome-splashscreen-manager
/usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:192:in `last_write': Unrecognised image file format (Gdk::PixbufError)
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:192:in `download_pixbuf'
        from /usr/lib/ruby/1.8/open-uri.rb:32:in `open_uri_original_open'
        from /usr/lib/ruby/1.8/open-uri.rb:32:in `open'
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:191:in `download_pixbuf'
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:199:in `create_thumbnail'
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:271:in `get_splash_screens'
        from /usr/lib/ruby/1.8/rexml/element.rb:934:in `each'
        from /usr/lib/ruby/1.8/rexml/xpath.rb:53:in `each'
        from /usr/lib/ruby/1.8/rexml/element.rb:934:in `each'
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:221:in `get_splash_screens'
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/ui/main_window.rb:261:in `reload_splash_screens'
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/ui/main_window.rb:458:in `initialize'
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/gnome_splashscreen_manager.rb:62:in `new'
        from /usr/lib/ruby/1.8/gnome-splashscreen-manager/gnome_splashscreen_manager.rb:62:in `main'
        from /usr/bin/gnome-splashscreen-manager:25

Solution: remove the file "~/.gnome2/gnome-art/download/splashscreens/Splash-CountrySplash.png"
...and the manager starts up properly

The file Splash-CountrySplash.png actually contains this:

<html><head>

<title></title></head>
<!-- Redirection Services Redirector2B-DAL H1 -->
<frameset rows='100%, *' frameborder=no framespacing=0 border=0>
<frame src="http://clientes.netvisao.pt/spookyftp/files/splah.png" name=mainwindow frameborder=no framespacing=0 marginheight=0 marginwidth=0></frame>
</frameset>
<noframes>
<h2>Your browser does not support frames. We recommend upgrading your browser.</h2><br><br>
<center>Click <a href="http://clientes.netvisao.pt/spookyftp/files/splah.png">here</a> to enter the site.</center>
</noframes></html>

.. the file is also attached to this bug report.

I don't think the file should have been saved as a splash screen by the splash manager if it hadn't been downloaded properly.
Since it was saved as such, the manager shouldn't simply crash the next time it's started.

I found a thread on the subject on ubuntu forums:

"http://ubuntuforums.org/showthread.php?p=4465395#post4465395"

.. that's also where I found the solution.

Revision history for this message
Michael (mnichau) wrote :
Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 or 9.04?

Changed in gnome-art:
status: New → Incomplete
Revision history for this message
Michael (mnichau) wrote :

Sorry, but I can't check it at the moment.

My system won't boot in graphical mode since I updated to Intrepid some time ago. I have to sort that out, but I didn't have time so far. ..so I'm stuck with Windows probably until I reinstall Ubuntu some time in the future.

To try to recreate the situation (with the splash manager - not with my broken ubuntu) try starting the Splash Manager and find and install the CountrySplash theme. Then try restarting the splash manager. Hopefully It should not crash. I'm not sure if CountrySplash is still available to choose anyway.

If anyone could check it out, it would be great

Cheers!

Revision history for this message
mehiel (aggelos-karalias) wrote :

I can confirm that on a debian lenny..

My specs are:
 linux kernel: 2.6.26-1-amd64
 gnome: 2.22.3
 gnome-splashscreen-manager: 0.2-12(testing)

I am not so familiar with ruby but i tried to find out what happened and i think that the problem is on the download_pixbuf method of the splash_screen.rb script. The loader throws a Gdk::PixbufError if the file is not a correct image file (from a corrupted download maybe) and this exception is unhandled. This method is used by the create_thumbnail method to read the image and create the thumbnail for the program's main window.

So because the MainWindow.rb constructor at start reads the #{Home_dir}/#{Gnome_dir}/splash-screens.xml and creates the thumbnails of the image files, it goes down..

You can reproduce it very easy, just add a <splash_screen> entry at #{Home_dir}/#{Gnome_dir}/splash-screens.xml file and touch the file you entered for filename in the entry. The file is not a correct image file and the whole thing will fail.

I think that the solution is pretty simple but I 'm a java developer at most and not at all familiar with ruby (so maybe there is a more sophisticated way to handle this situation), what I did to fix it is:

1) changed the splash_screens.rb script at line 190 to add an exception handler and return nil on error:
old code snippet:
 loader = Gdk::PixbufLoader.new
     open(url) { |f|
 loader.last_write(f.read)
     }

new code snippet:
 begin
      loader = Gdk::PixbufLoader.new
      open(url) { |f|
        loader.last_write(f.read)
      }
 rescue
  puts "Error in image file format: "+url

  return nil
 end

2) now edit the splash_screens.rb again into method create_thumbnail (line 205 with the new code snippet):
add between pixbuf = download_pixbuf(url) and pixbuf.scale(130, 90, Gdk::Pixbuf::INTERP_BILINEAR) this code snippet:
      if (pixbuf == nil)
            return nil
      end

and you are ok..

now the reload_splash_screens method that runs at start of the program will load the thumbnails and every nil thumbnail will be deleted from your #{Home_dir}/#{Gnome_dir}/splash-screens.xml file with a notification message at standard output to delete the image file manually from your filesystem.

thats all, sorry for my verbosity..
mehiel

Revision history for this message
papukaija (papukaija) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue for you. Can you try with the latest Ubuntu release? Thanks in advance.

Revision history for this message
papukaija (papukaija) wrote :

We'd like to figure out what's causing this bug for you, but we haven't heard back from you in a while. Could you please provide the requested information? Thanks!

Revision history for this message
Michael (mnichau) wrote :
Download full text (3.8 KiB)

Oh hey,

Sorry, it's just I haven't been using the software for a while now. The gnome-art project is apparently not maintained anymore (http://www.miketech.net/gnome-art/) . There's gnome-art NextGen instead (http://developer.berlios.de/projects/gnomeartng/).

Anyway, just to check, I installed gnome-splashscreen-manager (version 0.2-12 karmic) and gnome-art (version 0.2-12 karmic).

The problem still occurs. You can reproduce it as follows:

* start gnome-splashscreen-manager (System->Preferences->Splash Screen, or in the shell: gnome-splashscreen-manager)
* you can't do much here, because there are no splash screens currently installed. Exit the program.
* start gnome-art (eg. System->Preferences->Art Manager, or in the shell: gnome-art)
* Go to Art->Other Themes->Splash Screen
* A list of available splash screens will fill up the first time round (it will take a few minutes)
* Choose "Country Splash" - it's nearer the end (yup, it's still there - the same broken splash screen)
* Click "Install"
* You can now verify if the file "~/.gnome2/splash-screens.xml" contains the reference to the chosen theme (See the attached file)
* You can also verity that you have a broken png file called "Splash-CountrySplash.png" in the directory "~/.gnome2/gnome-art/download/splashscreens"
* Now try starting gnome-splashscreen-manager again (see how at the start) - it will silently fail. If you try starting it from terminal, you'll see something like:
---------------------snip
$ gnome-splashscreen-manager
/usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:192:in `last_write': Unrecognised image file format (Gdk::PixbufError)
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:192:in `download_pixbuf'
 from /usr/lib/ruby/1.8/open-uri.rb:32:in `open_uri_original_open'
 from /usr/lib/ruby/1.8/open-uri.rb:32:in `open'
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:191:in `download_pixbuf'
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:199:in `create_thumbnail'
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:271:in `get_splash_screens'
 from /usr/lib/ruby/1.8/rexml/element.rb:892:in `each'
 from /usr/lib/ruby/1.8/rexml/xpath.rb:53:in `each'
 from /usr/lib/ruby/1.8/rexml/element.rb:892:in `each'
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/splash_screens.rb:221:in `get_splash_screens'
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/ui/main_window.rb:281:in `reload_splash_screens'
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/ui/main_window.rb:479:in `initialize'
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/gnome_splashscreen_manager.rb:62:in `new'
 from /usr/lib/ruby/1.8/gnome-splashscreen-manager/gnome_splashscreen_manager.rb:62:in `main'
 from /usr/bin/gnome-splashscreen-manager:25
---------------------snip
* Now remove the offending file: $ rm ~/.gnome2/gnome-art/download/splashscreens/Splash-CountrySplash.png
* try to start gnome-splashscreen-manager again - should work this time. If ran from terminal, you'll see this:
---------------------snip
$ gnome-splashscreen-manager DELETE /home/michael/.gnome2/gnome-art/download/splashscreens/Splash-Count...

Read more...

Revision history for this message
papukaija (papukaija) wrote :

Ok, setting back to confirmed.

Changed in gnome-art (Ubuntu):
status: Incomplete → Confirmed
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.