shdown / luastatus

universal status bar content generator
GNU General Public License v3.0
293 stars 12 forks source link

Segmentation fault when using mpd plugin #62

Closed b3nj5m1n closed 3 years ago

b3nj5m1n commented 3 years ago

I'm trying to use an mpd module, however whenever I try to start luastatus with it, I get a seg fault.

I'm using lemonbar, however I've also tried it with the dwm option and with stdout.

So far, I've tried reinstalling, that didn't fix my issue. Since my other modules work fine, I'm assuming that this could be a problem with the plugin itself.

Here is what I put in the mpd.lua file (I tried several variations of this, including the one in the examples directory, none worked):

lib = require 'lib'
utf8 = require 'utf8'

text, time, total, is_playing = nil, nil, nil, false
timeout = 2
titlewidth = 40

widget = {
    plugin = 'mpd',
    opts = {
        timeout = timeout,
    },
    cb = function(t)
        return {full_tex = t.song.Title}
    end
}

Here is how I launch lemonbar (This works fine with all my other modules):

luastatus-lemonbar-launcher -p -a"$CLICKABLE_AREAS" \
    -p -g"$PANEL_WIDTH"x"$PANEL_HEIGHT"+"$PANEL_HORIZONTAL_OFFSET"+"$PANEL_VERTICAL_OFFSET" \
    -p -f"$PANEL_FONT" -p -f"$PANEL_ICON_FONT" -p -F"$COLOR_DEFAULT_FG" -p -B"$COLOR_DEFAULT_BG" \
    -p -u"$UNDERLINE_HEIGHT" -p -n"$PANEL_WM_NAME" -- -l trace -Bseparator=' ' \
    mpd.lua \

And finally, here is the output from the various commands I've run:

Lemonbar

luastatus: debug: initializing widget 'left.lua'
luastatus: debug: running file 'left.lua'
luastatus: debug: loading plugin from file '/usr/local/lib/luastatus/plugins/plugin-timer.so'
luastatus: debug: plugin successfully loaded
luastatus: debug: widget successfully initialized
luastatus: debug: initializing widget 'mpd.lua'
luastatus: debug: running file 'mpd.lua'
luastatus: debug: loading plugin from file '/usr/local/lib/luastatus/plugins/plugin-mpd.so'
luastatus: debug: plugin successfully loaded
./start-lemonbar-luastatus.sh: line 27: 179831 Segmentation fault      (core dumped) luastatus-lemonbar-launcher -p -a"$CLICKABLE_AREAS" -p -g"$PANEL_WIDTH"x"$PANEL_HEIGHT"+"$PANEL_HORIZONTAL_OFFSET"+"$PANEL_VERTICAL_OFFSET" -p -f"$PANEL_FONT" -p -f"$PANEL_ICON_FONT" -p -F"$COLOR_DEFAULT_FG" -p -B"$COLOR_DEFAULT_BG" -p -u"$UNDERLINE_HEIGHT" -p -n"$PANEL_WM_NAME" -- -l trace -Bseparator=' ' mpd.lua

Stdout

luastatus-stdout-wrapper mpd.lua
[1]    178718 segmentation fault (core dumped)  luastatus-stdout-wrapper mpd.lua

Dwm

luastatus -b dwm -B separator=' • ' mpd.lua
[1]    178489 segmentation fault (core dumped)  luastatus -b dwm -B separator=' • ' mpd.lua
shdown commented 3 years ago

Thanks for reporting. We certainly do need tests for plugins and barlibs, huh.