FedeDP / Clight

A C daemon that turns your webcam into a light sensor. It will adjust screen backlight based on ambient brightness.
GNU General Public License v3.0
724 stars 27 forks source link

[BUG] Monitor Override DBus interface causes segfault #304

Open NickHu opened 3 months ago

NickHu commented 3 months ago

NOTE: Please try to upgrade Clight if not running on latest release, before reporting a bug!

Clight version the issue has been seen with:

4.11

Used distribution:

NixOS

Describe the bug Whenever the Monitor Override interface is poked, clight segfaults

Expected behavior No segfault

To Reproduce

busctl --user call org.clight.clight /org/clight/clight/Conf/MonitorOverride org.clight.clight.Conf.MonitorOverride List

Please attach a Clight verbose log too!

Config file /home/nick/.config/clight.conf not found.
Clightd found, version: 5.8-.
Disarmed timerfd on fd 9.
AC screen backlight curve: y = -0.024825 + 0.191641x + -0.008928x^2
BL
^
|        **
|      **  
|     *    
|    *     
|   *      
|  *       
|          
| *        
|*         
|          
*---------->BR
BATT screen backlight curve: y = -0.010629 + 0.153844x + -0.007284x^2
BL
^
|          
|          
|       ***
|     **   
|    *     
|   *      
|  *       
| *        
|          
|*         
*---------->BR
Set timeout of 30s 0ns on fd 16.
init_kbd_backlight(): No such file or directory
Keyboard backlight calibration unsupported.
org.freedesktop.ScreenSaver dbus interface exposed.
Disarmed timerfd on fd 38.
AC cable connected.
Laptop lid opened.
Emitting 'AcState' property
Set timeout of 5s 0ns on fd 41.
Emitting 'LidState' property
51.73 -1.31 loaded from cache file.
Loc distance: 51.73,-1.31 -> 91.00,181.00 : 2575.15 km.
New location received: 51.73, -1.31.
Set timeout of 0s 1ns on fd 42.
Emitting 'Location' property
Next alarm due to: Thu Jul  4 20:52:00 2024
Set timeout of 15417s 0ns on fd 42.
Emitting 'Sunrise' property
Emitting 'Sunset' property
Emitting 'DayTime' property
Normal transition to 6500 gamma temp.
Emitting 'NextEvent' property
Emitting 'Temp' property
Emitting 'Temp' property
51.73 -1.30 received from Geoclue2.
Loc distance: 51.73,-1.30 -> 51.73,-1.31 : 0.46 km.
Failed to validate location request.
Received sigsegv signal. Aborting.
fish: Job 1, 'clight --verbose' terminated by signal SIGSEGV (Address boundary error)
NickHu commented 3 months ago

I did a bisect from version 4.7, when this did not occur, and found the offending commit to be 405870ebdef995f8ffd9b96bc00dce8648e69c31