-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Segmentation fault at startup on Debian 10.10 amd64 with mympd 8.0 #524
Comments
I can not reproduce your error. Can you build a debug version with |
I didn't want to "pollute" my linux host with compilation packages, so I changed the contrib/packagin/debian/rules as follows to obtain the same result as with the build.sh memcheck:
Hopefully I didn't miss anything else the "memcheck" flag shoud have enabled. Here's the output with the resulting mympd executable : 1 - with the /var/lib/mympd folder content from the previous working mympd release:
2 - with a fresh /var/lib/mympd folder
|
In this logs myMPD exits because he can not access the htdocs directory. This is in most cases a permission problem. The segfault must occur later. |
That's strange. because it makes no difference running the package as root or as the mympd user. Moreover, I checked the permissions on /var/lib/mympd, and the mympd users has complete rwX access to it. Is the htdoc folder content written on disk at runtime ? Now obviously, the path "/build/mympd-eUoqoF/mympd-8.0.0/htdocs" does not exist, as it is the temporary path those files were in during the package compiling process. I spun up a blanco VM to compile directly without using sbuild. I first installed the package from you repo using dpkg -i mympd_8.0.0-1_amd64.deb, then I built the package to get the debug build. When I compile the package directly as root:
So it seems mympd is trying to grab the htdocs folder from the location it was compiled.... Not sure this is a sane behavior :) Now if I compile after cloning the repository in the /var/lib/mympd "home folder"
Now if I try this debug executable on my usual mpd server, after copying the htdocs directory in the expected spot: /var/lib/mympd/myMPD/htdocs I get the following log:
The same behaviour happens if I purge the content of the /var/lib/mympd folder before starting the daemon. Downgrading to mympd 7.0.2, the mympd server runs fine again. |
In the release build the htdocs directory is served from compile time embedded files. In the debug build the htdocs directory is server from disc. Path is hardcoded from compile time. myMPD switches the user to myMPD if startet as root. Can you add the verbose log of MPD. It is a communication error with MPD. |
Here's the nverbose mpd log Before myMPD startup:
after myMPD startup:
Using socat to intercept the communications between myMPD and the mpd server, I don't see any command exchange between them when the following error repeats in loop:
I've sent you the complete logs by email. |
Thanks for debugs. There are very helpfull. I found two problems:
Disable the comment tag in the mpd configuration as a workarround. There is already an issue open in the libmpdclient repository: MusicPlayerDaemon/libmpdclient#69 |
I added a pull request to increase the buffer size of libmpdclient to 8192 (same as in MPD) and make it configurable at compile time. |
Disabling the comment tag in the mpd "metadata_to_use" config entry does indeed provide a workaround to this issue. I'll be using that pending the definitive fix. Thanks for your quick feedback on this ! |
I investigated a bit more. It seems that each tag value that exceeds the 4096 byte buffer limit of libmpdclient causes the response line to large error. The mpd output size is configureable and defaults to 8 MiB. Disabling the commet tag or setting the buffer size to a higher value are only workarounds. libmpdclients needs a dynamic growing buffer or mpd must limit the max line length to fix this issue. |
How comes this problem didn't happen with the previous version of mympd ? What changed in the way this is handled ? |
The cause was the missing tagtypes command in the mpd_worker thread. I think you have not enabled this tag in myMPD only in MPD. With enabled comment tag the issue should appear with each mp dclient that uses libmpdclient. |
I am closing this issue. I increased the buffer to 32768 bytes. I thinks this little bit more memory overhead is acceptable. |
myMPD version: 8.0
Describe the bug
After updating from previous release, mympd encounter a segmentation fault at startup.
Purging the folder /var/lib/mympd does not solve the issue.
Problem happens with the "official" mympd debian package as well as with a home-compiled debian package using the "./build.sh sbuild_build" command.
Expected behavior
No segmentation fault at startup
Server plattform (please complete the following information):
Debug logs (please attach if it can be usefull)
Configuration (please attach if it can be usefull)
irrelevant as it happens with a the default mympd configuration
The text was updated successfully, but these errors were encountered: