8000 Core dumped buttons of mpd's module · Issue #1007 · polybar/polybar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Core dumped buttons of mpd's module #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
doronbehar opened this issue Feb 7, 2018 · 18 comments
Closed

Core dumped buttons of mpd's module #1007

doronbehar opened this issue Feb 7, 2018 · 18 comments

Comments

@doronbehar
Copy link
Contributor

I have a password protected MPD server running on localhost and I have the environmental $MPD_HOST set in shell configuration files. With whatever configuration I put in module.mpd I can see the bar configured just fine but if I press on one of the buttons - for example pause/play I get the following traceback:

$ polybar default
polybar: src/error.c:49: mpd_connection_get_server_error: Assertion `connection->error.code == MPD_ERROR_SERVER' failed.
zsh: abort (core dumped)  polybar default

Environment:

$ polybar --version
polybar 3.1.0

Features: +alsa +curl -i3 +mpd +network
$ mpd --version
Music Player Daemon 0.20.15

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2017 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy upnp

Storage plugins:
 local smbclient nfs curl

Neighbor plugins:
 smbclient upnp

Decoders plugins:
 [mad] mp3 mp2
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [faad] aac
 [wavpack] wv
 [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe alsa ao oss pulse jack httpd recorder

Encoder plugins:
 null vorbis opus lame wave flac

Archive plugins:
 [bz2] bz2
 [zzip] zip

Input plugins:
 file alsa archive curl ffmpeg smbclient nfs mms

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// http:// https:// mms:// mmsh:// mmst:// mmsu:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// smb:// nfs:// alsa://

Other features:
 avahi epoll icu inotify ipv6 systemd tcp un
$ uname -orvs
Linux 4.14.15-1-ARCH #1 SMP PREEMPT Tue Jan 23 21:49:25 UTC 2018 GNU/Linux
$ pacman -Qi libmpdclient
Name            : libmpdclient
Version         : 2.11-1
Description     : Asynchronous API library for interfacing MPD in the C,
                  C++ & Objective C languages
Architecture    : x86_64
URL             : https://www.musicpd.org/libs/libmpdclient/
Licenses        : custom:BSD
Groups          : None
Provides        : None
Depends On      : None
Optional Deps   : None
Required By     : mpc  mpd  mpdscribble  ncmpcpp
Optional For    : polybar
Conflicts With  : None
Replaces        : None
Installed Size  : 333.00 KiB
Packager        : Gaetan Bisson <bisson@archlinux.org>
Build Date      : Sun 26 Mar 2017 02:18:21 IDT
Install Date    : Thu 30 Mar 2017 16:42:44 IDT
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
@NBonaparte
Copy link
Member

This error actually occurs in libmpdclient.
I'm guessing that other clients (ncmpcpp, mpc, etc.) work fine?
Does this still occur with other MPD servers?

@doronbehar
Copy link
Contributor Author

Other clients work fine.

I have just tested it and the problem appears only when my MPD server has a password.
I tried to debug this a little further and I couldn't find any more info with polybar -l info default and log_level verbose in /etc/mpd.conf.

@patrick96
Copy link
Member
patrick96 commented Feb 13, 2018

Can you compile in debug mode, run it through gdb and give us a full backtrace with the following command: gdb -batch -nh -ex run -ex bt full --args polybar command
To compile in debug mode add -DCMAKE_BUILD_TYPE=Debug to the cmake command during compilation,

Note: It is possible that your password is visible in the backtrace, so make sure you remove it before posting.

@doronbehar
Copy link
Contributor Author

Thanks for the instructions, I installed the package polybar-git from the aur and I added the flag -DCMAKE_BUILD_TYPE=Debug as you told me to.

Here is the traceback from gdb:

[Thread 0x7fffba7fc700 (LWP 4700) exited]
polybar: ../src/error.c:49: mpd_connection_get_server_error: Assertion `connection->error.code == MPD_ERROR_SERVER' failed.

Thread 14 "polybar" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffbaffd700 (LWP 4699)]
0x00007ffff4cca860 in raise () from /usr/lib/libc.so.6
#0  0x00007ffff4cca860 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff4ccbec9 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff4cc30bc in __assert_fail_base () from /usr/lib/libc.so.6
#3  0x00007ffff4cc3133 in __assert_fail () from /usr/lib/libc.so.6
#4  0x00007ffff6e2d64e in mpd_connection_get_server_error () from /usr/lib/libmpdclient.so.2
#5  0x00005555558bcb18 in polybar::v3_1_0_47_g4d48ffe::mpd::check_errors(mpd_connection*) ()
#6  0x00005555558bdec2 in polybar::v3_1_0_47_g4d48ffe::mpd::mpdconnection::pause(bool) ()
#7  0x00005555559fbd9b in polybar::v3_1_0_47_g4d48ffe::modules::mpd_module::input(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) ()
#8  0x000055555592f36e in polybar::v3_1_0_47_g4d48ffe::controller::process_inputdata() ()
#9  0x000055555592ee0b in polybar::v3_1_0_47_g4d48ffe::controller::process_eventqueue() ()
#10 0x000055555593a0c7 in void std::__invoke_impl<void, void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*>(std::__invoke_memfun_deref, void (polybar::v3_1_0_47_g4d48ffe::controller::*&&)(), polybar::v3_1_0_47_g4d48ffe::controller*&&) ()
#11 0x0000555555935d2e in std::__invoke_result<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*>::type std::__invoke<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*>(void (polybar::v3_1_0_47_g4d48ffe::controller::*&&)(), polybar::v3_1_0_47_g4d48ffe::controller*&&) ()
#12 0x0000555555947efd in decltype (__invoke((_S_declval<0ul>)(), (_S_declval<1ul>)())) std::thread::_Invoker<std::tuple<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) ()
#13 0x0000555555947e9e in std::thread::_Invoker<std::tuple<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*> >::operator()() ()
#14 0x0000555555947dae in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*> > >::_M_run() ()
#15 0x00007ffff5887b9f in std::execute_native_thread_routine (__p=0x555555e314a0) at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:83
#16 0x00007ffff505408c in start_thread () from /usr/lib/libpthread.so.0
#17 0x00007ffff4d8be7f in clone () from /usr/lib/libc.so.6

@patrick96
Copy link
Member

Thanks. However, if you install polybar as a package, pacman will strip all debug symbols, so the backtrace is incomplete (no line numbers etc). But since you compiled with debug symbols, there is a non-stripped version of the executable, in the build directory. It should be at src/polybar/build/bin/polybar inside the folder where you run makepkg. Please run this executable inside gdb and send us the backtrace.

@doronbehar
Copy link
Contributor Author

From some reason when I entered again the aur directory, there was no src directory - probably because of some makepkg settings. Anyway I've built it myself with the same flags as before and The traceback is this:

[Thread 0x7fffb9ffb700 (LWP 8877) exited]
polybar: ../src/error.c:49: mpd_connection_get_server_error: Assertion `connection->error.code == MPD_ERROR_SERVER' failed.

Thread 14 "polybar" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffba7fc700 (LWP 8876)]
0x00007ffff48bf860 in raise () from /usr/lib/libc.so.6
#0  0x00007ffff48bf860 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff48c0ec9 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff48b80bc in __assert_fail_base () from /usr/lib/libc.so.6
#3  0x00007ffff48b8133 in __assert_fail () from /usr/lib/libc.so.6
#4  0x00007ffff6e2d64e in mpd_connection_get_server_error () from /usr/lib/libmpdclient.so.2
#5  0x00005555558c91a9 in polybar::v3_1_0_47_g4d48ffe::mpd::check_errors (conn=0x7fffb008db80) at /var/cache/aursync/polybar-git/src/polybar/src/adapters/mpd.cpp:37
#6  0x00005555558ca4c3 in polybar::v3_1_0_47_g4d48ffe::mpd::mpdconnection::pause (this=0x7fffb00883d0, state=true) at /var/cache/aursync/polybar-git/src/polybar/src/adapters/mpd.cpp:238
#7  0x0000555555a02c5d in polybar::v3_1_0_47_g4d48ffe::modules::mpd_module::input (this=0x555555de90e0, cmd=...) at /var/cache/aursync/polybar-git/src/polybar/src/modules/mpd.cpp:348
#8  0x0000555555939861 in polybar::v3_1_0_47_g4d48ffe::controller::process_inputdata (this=0x555555de5c60) at /var/cache/aursync/polybar-git/src/polybar/src/components/controller.cpp:406
#9  0x0000555555939499 in polybar::v3_1_0_47_g4d48ffe::controller::process_eventqueue (this=0x555555de5c60) at /var/cache/aursync/polybar-git/src/polybar/src/components/controller.cpp:380
#10 0x0000555555944312 in std::__invoke_impl<void, void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*> (__f=@0x555555e36b10: (void (polybar::v3_1_0_47_g4d48ffe::controller::*)(polybar::v3_1_0_47_g4d48ffe::controller * const)) 0x55555593915c <polybar::v3_1_0_47_g4d48ffe::controller::process_eventqueue()>, __t=@0x555555e36b08: 0x555555de5c60) at /usr/include/c++/7.3.0/bits/invoke.h:73
#11 0x0000555555940058 in std::__invoke<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*> (__fn=@0x555555e36b10: (void (polybar::v3_1_0_47_g4d48ffe::controller::*)(polybar::v3_1_0_47_g4d48ffe::controller * const)) 0x55555593915c <polybar::v3_1_0_47_g4d48ffe::controller::process_eventqueue()>, __args#0=@0x555555e36b08: 0x555555de5c60) at /usr/include/c++/7.3.0/bits/invoke.h:95
#12 0x0000555555951e71 in std::thread::_Invoker<std::tuple<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*> >::_M_invoke<0ul, 1ul> (this=0x555555e36b08) at /usr/include/c++/7.3.0/thread:234
#13 0x0000555555951e12 in std::thread::_Invoker<std::tuple<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*> >::operator() (this=0x555555e36b08) at /usr/include/c++/7.3.0/thread:243
#14 0x0000555555951d22 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (polybar::v3_1_0_47_g4d48ffe::controller::*)(), polybar::v3_1_0_47_g4d48ffe::controller*> > >::_M_run (this=0x555555e36b00) at /usr/include/c++/7.3.0/thread:186
#15 0x00007ffff547cb9f in std::execute_native_thread_routine (__p=0x555555e36b00) at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:83
#16 0x00007ffff4c4908c in start_thread () from /usr/lib/libpthread.so.0
#17 0x00007ffff4980e7f in clone () from /usr/lib/libc.so.6

@patrick96
Copy link
Member
patrick96 commented Feb 13, 2018

This is interesting, polybar actually crashes while it is trying to throw an error. So unfortunately we can't see the error message. I will open a PR shortly, so that we actually get helpful information from polybar.

EDIT: Please try out #1024, it should give you a meaningfull error message

@doronbehar
Copy link
Contributor Author
doronbehar commented Feb 14, 2018

I'm not sure about the comments you received for your PR but I followed this guide: https://help.github.com/articles/checking-out-pull-requests-locally/ and ran the same cmake commands as before and now there is no traceback and polybar doesn't crash and I just get this message:

error: mpdconnection.pause: you don't have permission for "pause"

As I said before, I have the environmental variable $MPD_HOST set in shell configuration files. Usually mpd clients read this variable and I don't experience problems with them. I guess the problem is that libmpdclient or polybar doesn't tell it to read them?

@patrick96
Copy link
Member

Ah, I see. Polybar doesn't seem to respect $MPD_HOST, you have to specify explicitly, using the host parameter.
For now, try to add host = ${env:MPD_HOST:127.0.0.1} to your config and see if things get any better. I will push a commit making polybar use MPD_HOST, if available, later.

@doronbehar
Copy link
Contributor Author

Works, thanks! I guess it's OK to keep it this way in the meantime since there is no plain-text password explicitly set in the configuration file.

@patrick96
Copy link
Member

I just opened #1025 to fix this. Do you have the password set as part of MPD_HOST?

patrick96 added a commit to patrick96/polybar that referenced this issue Feb 14, 2018
@doronbehar
Copy link
Contributor Author
doronbehar commented Feb 14, 2018

Yes, just as explained here in mpc's man page - for example.

Edit: The usage of $MPD_HOST is documented in mpd's official documentation for libmpdclient: https://www.musicpd.org/doc/libmpdclient/settings_8h.html#a51e6b00dc6c668b610d236368600e8e3

@patrick96
Copy link
Member

Hmm, didn't know about this. Also mpc somehow doesn't have a manpage on my system.

@doronbehar
Copy link
Contributor Author

Yea I don't have it too here on Arch Linux from some reason. I remember I used to have it in the past.

@patrick96
Copy link
Member

Looks like the newest mpc version uses a new documentation system which the PKGBUILD doesn't have in its makedepends array

@doronbehar
Copy link
Contributor Author

NBonaparte pushed a commit that referenced this issue Feb 16, 2018
@doronbehar
Copy link
Contributor Author

Cool, thanks a lot!

1 similar comment
@doronbehar
Copy link
Contributor Author

Cool, thanks a lot!

patrick96 added a commit that referenced this issue Jul 23, 2018
Breaking Changes:

* `0 < label-NAME-maxlen < 3` will now throw an exception and disable the containing module, if ellipsis is enabled for that label. (#1198)

Changelog:

Deprecations:
* `internal/volume` is now called `internal/alsa` (#967)
* temperature: The `%temperature%` is deprecated in favor of `%temperature-c%`(#897)
* mpd: `icon-repeatone` is deprecated in favor of `icon-single` (#1295), see #1279

Features:
* feat(mpd): Add support for icon-consume (#861)
* feat(bspwm): Add workspace separator (#942) 
* feat(i3): Add workspace separator (#938), see #929
* feat(build): Make polybar build on FreeBSD (#931, polybar/xpp#8), see #239
* feat(volume): Add pulseaudio backend (#779)
* feat(script): Add %pid% token for tail commands (#934)
* feat(temp): Add temperature tokens without unit (#897)
* feat(memory): Add memory used/free ramp (#1038), see #1037
* feat(memory): Add swap tokens (#1018) 
* feat(net): Add unknown-as-up option (#1077), see #457
* feat(config): Support fractional size and offset (#972), see #953
* feat(xwindow): Add label-empty (#1136)
* feat(battery): Add animation-discharging (analog to animation-charging) (#1190)
* feat(config): Support pixel offset for bar size and offset values (#1224)
* feat(mpd): Add `%album-artist%` token (#1263)
* feat(net): Add local_ip6 token (#1239), see #1234
* feat(net): Add nl80211 support (#1009), see #277

Fixes:
* fix(mpd): Wrong elapsed time when after standby (#921), see #915
* fix(config): Wrong min, maxlen when using the same token multiple times (#974), see #971
* fix(battery): use power_now correctly (#958), see #928
* fix(mpd): Crash when mpd isn't running (#983), see #979
* fix(xworkspaces): Respect 'enable-scroll' (#1002)
* fix(xbacklight): Respect 'enable-scroll' (#1014)
* fix(build): support xcb-proto >=1.13 (polybar/xpp#11), see #973
* fix(mpd): Respect MPD_HOST env variable (#1025), see #1007
* fix(i3): Reconnect i3 IPC socket on restart/error (#1099), see #762
* fix(cursor): Occasional crash on mouseover (#1124), see #1117
* fix(net): Mark 'not connected' on querying failure (#1171), see #1163
* fix(gcc): Fix -Wstringop-truncation warning (#1216, polybar/i3ipcpp#7), see #1215
* fix(builder): Don't truncate colors with same channels (#1217), see #1183
* fix(bspwm): Consistent behavior when scrolling through multiple desktops (#986), see #981
* fix(builder): Respect label-ellipsis option (#1198), see #1194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0