getsolus / packages

Solus Package Monorepo & Issue Tracker
62 stars 78 forks source link

Conky segfault while loading libcairo #563

Closed elusian closed 10 months ago

elusian commented 11 months ago

Summary

Conky can load and execute functions from a user provided lua file. This is commonly used together with cairo to draw freely inside the conky window.

After last update, loading a scripts that imports cairo causes a segfault during startup. Specifically, this does not require cairo to be used, only

require 'cairo'

at the top of the script is necessary

Steps to reproduce

  1. Create the required configs

    -- conky_test_draw.lua
    require 'cairo'
    
    -- conky_test.conf
    conky.config = {
    alignment = 'top_left',
    background = false,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'DejaVu Sans Mono:size=12',
    gap_x = 60,
    gap_y = 60,
    minimum_height = 10,
    minimum_width = 10,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
    
    lua_load = '/path/to/conky_draw_test.lua',

};

conky.text = [[ test successful ]]

2. Execute the config

conky -c conky_test.lua


### Expected result

conky window with `test successful` in it

### Actual result

Segfault

0 0x00007ffff7c7224f in luaH_get () from /usr/lib/liblua.so.5.3

1 0x00007ffff7c72a59 in luaH_set () from /usr/lib/liblua.so.5.3

2 0x00007ffff7c63225 in lua_rawset () from /usr/lib/liblua.so.5.3

3 0x00007ffff7fb3d0e in set_ubox (L=0x5555557ab5b8) at /home/build/YPKG/root/conky/build/conky-1.19.5/3rdparty/toluapp/src/lib/tolua_map.c:126

4 mapinheritance (L=0x5555557ab5b8, name=, base=) at /home/build/YPKG/root/conky/build/conky-1.19.5/3rdparty/toluapp/src/lib/tolua_map.c:151

5 0x00007ffff7fb4475 in tolua_cclass (L=0x5555557ab5b8, lname=0x7ffff7fb8112 "cairo_matrix_t", name=0x7ffff7fb8112 "cairo_matrix_t", base=0x7ffff7fbafff "", col=0x0)

at /home/build/YPKG/root/conky/build/conky-1.19.5/3rdparty/toluapp/src/lib/tolua_map.c:584

6 0x00007ffff7fb0b7b in tolua_cairo_open (tolua_S=0x5555557ab5b8) at /home/build/YPKG/root/conky/build/conky-1.19.5/solusBuildDir/lua/libcairo.c:9552

7 0x00007ffff7c67d1f in luaD_precall () from /usr/lib/liblua.so.5.3

8 0x00007ffff7c6809b in luaD_callnoyield () from /usr/lib/liblua.so.5.3

9 0x00007ffff7c635c9 in lua_callk () from /usr/lib/liblua.so.5.3

10 0x00007ffff7c84d2c in ll_require () from /usr/lib/liblua.so.5.3

11 0x00007ffff7c67d1f in luaD_precall () from /usr/lib/liblua.so.5.3

12 0x00007ffff7c75231 in luaV_execute () from /usr/lib/liblua.so.5.3

13 0x00007ffff7c680d8 in luaD_callnoyield () from /usr/lib/liblua.so.5.3

14 0x00007ffff7c6745f in luaD_rawrunprotected () from /usr/lib/liblua.so.5.3

15 0x00007ffff7c6844b in luaD_pcall () from /usr/lib/liblua.so.5.3

16 0x00007ffff7c6368a in lua_pcallk () from /usr/lib/liblua.so.5.3

17 0x00005555555ba9a0 in llua_load (script=) at /home/build/YPKG/root/conky/build/conky-1.19.5/src/llua.cc:212

18 0x00005555555bb4ad in (anonymous namespace)::lua_load_setting::lua_setter (this=, l=..., init=) at /usr/include/c++/12/bits/basic_string.h:233

19 0x00005555555b7bc2 in conky::priv::config_setting_base::process_setting (l=..., init=init@entry=true) at /home/build/YPKG/root/conky/build/conky-1.19.5/src/setting.cc:197

20 0x00005555555b88e0 in conky::set_config_settings (l=...) at /home/build/YPKG/root/conky/build/conky-1.19.5/src/setting.cc:284

21 0x000055555557ec89 in initialisation (argc=argc@entry=3, argv=argv@entry=0x7fffffffde58) at /usr/include/c++/12/bits/unique_ptr.h:191

22 0x000055555556c79f in main (argc=3, argv=0x7fffffffde58) at /home/build/YPKG/root/conky/build/conky-1.19.5/src/main.cc:351


### Environment

- [X] Is system up to date?

### Repo

Shannon (stable)

### Desktop Environment

Budgie

### System details

from `inxi`

System: Host: me Kernel: 6.5.7-259.current arch: x86_64 bits: 64 Desktop: Budgie v: 10.8.1 Distro: Solus 4.4 harmony Machine: Type: Portable System: Dell product: Inspiron 7559 v: 1.1.8 Battery: ID-1: BAT0 charge: 74.0 Wh (100.0%) condition: 74.0/74.0 Wh (100.0%) CPU: Info: quad core Intel Core i7-6700HQ [MT MCP] speed (MHz): avg: 800 min/max: 800/3500 Graphics: Device-1: Intel HD Graphics 530 driver: i915 v: kernel Device-2: NVIDIA GM107M [GeForce GTX 960M] driver: nvidia v: 535.113.01 Device-3: Sunplus Innovation Integrated_Webcam_HD driver: uvcvideo type: USB Display: x11 server: X.Org v: 1.20.14 with: Xwayland v: 23.1.2 driver: X: loaded: modesetting,nvidia dri: iris gpu: i915 resolution: 1920x1080 API: OpenGL v: 4.6.0 vendor: nvidia v: 535.113.01 renderer: NVIDIA GeForce GTX 960M/PCIe/SSE2



### Other comments

`lua-dbginfo` is installed, but apparently the backtrace cannot look inside `/usr/lib/liblua.so.5.3` (which should be inside the `lua` package)

Also, unless I'm looking at the wrong program, copy pasting from _About This System_ is a bit annoying (I can only select a line), so a different suggestion would be appreciated, if possible
algent-al commented 11 months ago

Any difference if you use require 'libcairo' instead of require 'cairo'?

elusian commented 11 months ago
conky: llua_load: /path/to/conky_draw_test.lua:1: module 'libcairo' not found:
    no field package.preload['libcairo']
    no file '/usr/share/lua/5.3/libcairo.lua'
    no file '/usr/share/lua/5.3/libcairo/init.lua'
    no file '/usr/lib/lua/5.3/libcairo.lua'
    no file '/usr/lib/lua/5.3/libcairo/init.lua'
    no file './libcairo.lua'
    no file './libcairo/init.lua'
    no file '/usr/lib/conky/liblibcairo.so'
    no file '/usr/lib/lua/5.3/libcairo.so'
    no file '/usr/lib/lua/5.3/loadall.so'
    no file './libcairo.so'
elusian commented 10 months ago

Somehow this was solved in the last update. Thanks!