! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Plugin crashes constantly
Status:
RESOLVED: FIXED
Product:
Xfce4-mpc-plugin
Component:
General

Comments

Description Urmas 2019-05-19 07:42:52 CEST
The plugin repeatedly crashes while controlling a version 0.21.5 mpd. The "restart or remove" dialog appears.

The mpd log contains lines like these:

exception: Integer expected: -731outputs
exception: Integer expected: -731status (the number changes randomly)
Comment 1 Landry Breuil editbugs 2019-05-19 18:47:11 CEST
What os ? Built against libmpd or using the standalone simple-libmpd code ? What is your output list ? can you build with --enable-debug=full and show me the debug log ?
Comment 2 Urmas 2019-05-19 20:23:23 CEST
It's this package:

https://packages.debian.org/source/sid/xfce4-mpc-plugin

The debug log is attached.
Comment 3 Urmas 2019-05-19 20:28:17 CEST
Created attachment 8544 
Log
Comment 4 Urmas 2019-05-21 19:45:41 CEST
There is an error here:

DBG[simple-libmpd.c:219] mpd_wait_for_answer(): Read 117 bytes, buff="outputid: 0
outputname: My ALSA Device
plugin: alsa
outputenabled: 1
attribute: allowed_formats=
attribute: dop=0
OK
"
DBG[simple-libmpd.c:457] parse_outputs_answer(): Going to parse output #0
DBG[simple-libmpd.c:463] parse_outputs_answer(): key="outputid",value="0"
DBG[simple-libmpd.c:463] parse_outputs_answer(): key="outputname",value="My ALSA Device"
DBG[simple-libmpd.c:463] parse_outputs_answer(): key="plugin",value="alsa"
DBG[simple-libmpd.c:463] parse_outputs_answer(): key="outputenabled",value="1"
DBG[simple-libmpd.c:457] parse_outputs_answer(): Going to parse output #1

It seems to be parsing junk.
Comment 5 Landry Breuil editbugs 2019-05-21 20:18:11 CEST
Created attachment 8566 
skip attribute lines

Ok, thanks for the log, i think i understand where it comes from - the code doesn't expect those lines with 'attribute' and should ignore them, skipping to the final 'OK' which signals the end of outputs. Instead of that, ones it sees the 'outputenabled' line and not immediately an 'OK' line, it thinks there's another output to parse, and then s**t happens.

here with 0.21.6, on my 4 outputs i dont have such lines, that explains why i'm not seeing those crashes.

...
outputname: sndio on localhost/ssh
plugin: sndio
outputenabled: 0
outputid: 3
outputname: HTTP stream
plugin: httpd
outputenabled: 1
OK
...

do you have any idea what can cause those lines from MPD so that i can try reproducing ? Is this with mpc plugin 0.5.1 ? can you try the attached blind patch ?
Comment 6 Urmas 2019-05-23 05:18:05 CEST
Your patch works, but it looks strange to me. The more logical thing is just skip everything until the next "outputid", so it won't break sometime again in the future.

I don't know why there are those lines. They were there in the default configuration.
Comment 7 Landry Breuil editbugs 2019-05-23 08:27:46 CEST
There might not be another outputid.. that might require more changes to the logic. Can you provide a tested patch if you think of a better way ?
Comment 8 Git Bot editbugs 2019-08-13 12:16:54 CEST
Landry Breuil referenced this bugreport in commit 9a21bf63df679ef22bc775d7fbfd971a0b423875

Ignore extra lines with attribute: entries (bug #15415)

https://git.xfce.org/panel-plugins/xfce4-mpc-plugin/commit?id=9a21bf63df679ef22bc775d7fbfd971a0b423875

Bug #15415

Reported by:
Urmas
Reported on: 2019-05-19
Last modified on: 2019-08-18

People

Assignee:
Landry Breuil
CC List:
1 user

Version

Version:
unspecified

Attachments

Log (2.21 KB, application/gzip)
2019-05-19 20:28 CEST , Urmas
no flags
skip attribute lines (629 bytes, patch)
2019-05-21 20:18 CEST , Landry Breuil
no flags

Additional information