usplash segfaults on shutdown when pulsating

Bug #259761 reported by Jan-Marek Glogowski on 2008-08-20
6
Affects Status Importance Assigned to Milestone
usplash (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: usplash

While testing my own usplash theme on debian using usplash 0.5.19, usplash was crashing when shutdown in pulsating mode, because the SIGALRM triggered while graphics were already shut down.

The attached simple fix sets pulsating = 0 when exiting the main_loop().

BTW: is there a reason, why the timer isn't stopped and started, instead of setting pulsating? Toggling pulsating mode shouldn't happen that often...

Related branches

Jan-Marek Glogowski (jmglogow) wrote :

here is the debdiff with Jan-Mareks Patch included

Colin Watson (cjwatson) wrote :

It seems like sheer coincidence that it crashes on shutdown. do_animate is an absolutely horrific thing to call in a signal handler and we're very lucky that it works at all.

Rather than applying this band-aid, I think it would be better to fix it properly. Since main_loop uses select() and Linux doesn't have a working pselect() last I checked, we'll need to use the self-pipe trick: the SIGALRM handler should write a byte to a pipe which we monitor in main_loop. I'm thinking of something along the lines of the attachment but I have not tested this at all.

Andrea Gasparini (gaspa) wrote :

Colin: tested, It has a little bug (the nfds parameter should be adapted as well).
Attacching the patch that should work.

Changed in usplash:
status: New → Confirmed
Colin Watson (cjwatson) wrote :

Thanks. I don't think we have time to test this adequately for 8.10, but I've milestoned this bug for attention afterwards.

Changed in usplash:
milestone: none → later
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package usplash - 0.5.26

---------------
usplash (0.5.26) jaunty; urgency=low

  * Fix various compiler warnings.
  * debian/splash-functions: Kill usplash more gracefully in splash_stop;
    introduces new SPLASH_ORIG_CONSOLE environment variable which can be
    checked by other init scripts (LP: #304136).
  * Notify the main loop by means of a self-pipe when SIGALRM is triggered,
    rather than attempting to animate the display from a signal handler
    (thanks to Andrea Gasparini for testing and adjustment; LP: #259761).
  * Sleep for 0.1 second rather than 1 second in init script while waiting
    for usplash to die, and adjust the loop count both there and in
    splash-functions to match the previous behaviour of giving usplash up to
    10 seconds to go away (LP: #313574).

 -- Colin Watson <email address hidden> Tue, 06 Jan 2009 12:00:21 +0000

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

Other bug subscribers

Bug attachments