After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657364 - gnome-settings-daemon crashed with SIGFPE in g_main_context_dispatch()
gnome-settings-daemon crashed with SIGFPE in g_main_context_dispatch()
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
3.1.x
Other Linux
: Normal critical
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2011-08-25 18:40 UTC by Pedro Villavicencio
Modified: 2011-09-07 16:51 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
power: Fix impossible to hit error paths (2.48 KB, patch)
2011-08-30 15:35 UTC, Bastien Nocera
committed Details | Review

Description Pedro Villavicencio 2011-08-25 18:40:25 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/833595

"System Settings - then Screen Background - then crash report is starting"

".

Thread 1 (Thread 0x7fa327e09940 (LWP 1401))

  • #0 backlight_get_percentage
    at gsd-power-manager.c line 2354
  • #1 handle_method_call_screen
    at gsd-power-manager.c line 3406
  • #2 handle_method_call
    at gsd-power-manager.c line 3561
  • #3 call_in_idle_cb
    at /build/buildd/glib2.0-2.29.16/./gio/gdbusconnection.c line 4440
  • #4 g_main_dispatch
    at /build/buildd/glib2.0-2.29.16/./glib/gmain.c line 2439
  • #5 g_main_context_dispatch
    at /build/buildd/glib2.0-2.29.16/./glib/gmain.c line 3008
  • #6 g_main_context_iterate
    at /build/buildd/glib2.0-2.29.16/./glib/gmain.c line 3086
  • #7 g_main_loop_run
    at /build/buildd/glib2.0-2.29.16/./glib/gmain.c line 3294
  • #8 gtk_main
    at /build/buildd/gtk+3.0-3.1.12/./gtk/gtkmain.c line 1367
  • #9 main
    at main.c line 451

Comment 1 Bastien Nocera 2011-08-30 15:35:13 UTC
Created attachment 195223 [details] [review]
power: Fix impossible to hit error paths

guint is always positive, so "value < 0" will never catch errors,
and might cause crashers.
Comment 2 Bastien Nocera 2011-08-30 16:19:57 UTC
Attachment 195223 [details] pushed as 30060b2 - power: Fix impossible to hit error paths
Comment 3 Bastien Nocera 2011-09-07 15:35:03 UTC
Rodrigo, when I say that there is a bug in gnome-desktop or in the backlight helper, I'd appreciate if you didn't commit a gross work-around for the problem.


commit e64a5d0b56d551c653027a6040ccfa28fbd101e5
Author: Bastien Nocera <hadess@hadess.net>
Date:   Wed Sep 7 16:32:35 2011 +0100

    power: Reset value to -1 when parsing failed
    
    When we fail to parse the value output of the backlight helper,
    also reset the value, as g_ascii_strtoll() returns 0 on failure.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657364

commit 8c61c54ba6248891541d5d849d1d9871ad3c4940
Author: Bastien Nocera <hadess@hadess.net>
Date:   Wed Sep 7 16:31:13 2011 +0100

    power: Correctly check for helper exit status
    
    By using WEXITSTATUS() and not relying solely on the
    return value of g_spawn_command_line_sync().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657364

commit 5be38144f19d1479c908039ffc2991052b06111b
Author: Bastien Nocera <hadess@hadess.net>
Date:   Wed Sep 7 16:18:46 2011 +0100

    power: Make ABS_TO_PERCENTAGE warn on invalid input
    
    Works around this problem, whilst producing a warning.
    https://bugzilla.gnome.org/show_bug.cgi?id=657364

commit 7742a3bc9619eb79fdf212ab835c2b706ef7e856
Author: Bastien Nocera <hadess@hadess.net>
Date:   Wed Sep 7 15:57:01 2011 +0100

    Revert "power: Guard against dividing by 0 in ABS_TO_PERCENTAGE macro"
    
    This reverts commit fcd4e082cc1528b633b7d07732adb2921d244ab8.
    
    This is the wrong fix, as we have gnome-desktop or the backlight
    helper giving us back garbage. We want to fix that, not work-around
    the problem with sticky tape.

And reopen if you manage to reproduce this problem with the above patches.
Comment 4 Sebastien Bacher 2011-09-07 16:36:57 UTC
infos that Rodrigo asked on the ubuntu bug

"$ /usr/lib/gnome-settings-daemon/gsd-backlight-helper --get-max-brightness
No backlights were found on your system
$ /usr/lib/gnome-settings-daemon/gsd-backlight-helper --get-brightness
No backlights were found on your system

This is a real hardware, desktop with two LCD monitors and NVIDIA card."
Comment 5 Sebastien Bacher 2011-09-07 16:37:57 UTC
seems it's an issue for virtualbox users as well.

Rodrigo could you backport the patches to the current oneiric package and see if that solves the issue?
Comment 6 Bastien Nocera 2011-09-07 16:51:12 UTC
(In reply to comment #4)
> infos that Rodrigo asked on the ubuntu bug
> 
> "$ /usr/lib/gnome-settings-daemon/gsd-backlight-helper --get-max-brightness
> No backlights were found on your system
> $ /usr/lib/gnome-settings-daemon/gsd-backlight-helper --get-brightness
> No backlights were found on your system
> 
> This is a real hardware, desktop with two LCD monitors and NVIDIA card."

That would be what 8c61c54ba6248891541d5d849d1d9871ad3c4940 corrects then.