I'm trying to run mplayer or mpv on my Raspberry Pi, but even after multiple apt-get removes and even apt-get install --reinstalls, I'm still getting the annoyingly undetailed Segmentation fault error message, even though other packages like vlc and aplayer work just fine.

I have the stretch repo in my sources.list, but the default repo is jessie. How can I get the mplayer/mpv to work on my device?

I don't think it's my SD Card's problem.


the annoyingly undetailed Segmentation fault error message

If this is happening something is probably broken, and if you have really replaced the executable repeatedly, it is likely something it links to -- a library, but obviously not too critical a one or else you would be having this problem with other things as well (or, it could be the broken bit is in a common library, but it is an obscure bit).

By "broken" I mean the file has become corrupted. The only other possibility, since you are using stretch ("but the default repo is jessie") is it is some subtle mismatch in pieces that has gone unnoticed (which might happen particularly if it is a relatively unique mismatch of jessie and stretch pieces).

If you want to try tracking the problem down (and I cannot promise it will work), apt install gdb, then run gdb mplayer, it will take 10 seconds or so to get to a prompt, then enter run ... where ... is the rest of the commandline you would usually use with mplayer.

When the segfault happens, the prompt will come back. Type bt or backtrace. The first time you do this, you may get a lot of in ???, but you may also get a message to install some debugging packages (I'm not positive the Debian/Raspbian version does this; if not things just got too complicated). Unfortunately those can sometimes be quite large. You can then try the backtrace again and get more details.

If you edit that backtrace into your question I can hazard a guess at what is broken.

However, if this is happening more widely you might as well re-install; random corruption of system libraries is not something that can easily be fixed.

Another possibility, since mpv has the same problem, is to look at the output of ldd $(which mplayer) and ldd $(which mpv) and see what the most obscure things they have in common are (not libc or libdl, etc. -- again if you post this in the question I could hazard a guess). You should then try replacing the packages that provide those libraries. If you are not sure use the Debian package contents search.

  • Thank you for the well-written and through answer, using ldd and the gdb I managed to track down the misbehaving libraries, and reinstalled them from Jessie. The ones from the stretch seems to be the cause of the problem. Everything works great now! May 14 '17 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.