Skip to content
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

Empty tag_cache causes crash #986

Closed
skidoo23 opened this issue Oct 22, 2020 · 3 comments
Closed

Empty tag_cache causes crash #986

skidoo23 opened this issue Oct 22, 2020 · 3 comments
Labels

Comments

@skidoo23
Copy link
Contributor

Bug report

Describe the bug

MPD crash at startup with empty or non existing database.

Expected Behavior

Normal startup.

Actual Behavior

Crash.

Version

Music Player Daemon 0.23~git (v0.22.1-67-gad585e179)
Copyright 2003-2007 Warren Dukes [email protected]
Copyright 2008-2018 Max Kellermann [email protected]
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

Storage plugins:
local udisks

Neighbor plugins:
udisks

Decoders plugins:
[mad] mp3 mp2
[mpg123] mp3
[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
[faad] aac
[mpcdec] mpc
[wavpack] wv
[modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
[mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
[sidplay] sid mus str prg P00
[wildmidi] mid
[fluidsynth] mid
[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 rtp:// rtsp:// rtsps://
[gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
[pcm]

Filters:
libsamplerate soxr

Tag plugins:
id3tag

Output plugins:
null fifo pipe alsa httpd

Encoder plugins:
null vorbis opus lame flac

Archive plugins:
[bz2] bz2
[zzip] zip
[iso] iso

Input plugins:
file io_uring archive alsa curl ffmpeg mms

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

Protocols:
file:// alsa:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mms:// mmsh:// mmst:// mmsu:// rtmp:// rtmps:// rtmpt:// rtmpts:// rtp:// rtsp:// rtsps:// scp:// sftp:// smb:// srtp://

Other features:
avahi dbus udisks epoll icu inotify systemd tcp un

Log

gdb --args mpd --stderr --no-daemon --verbose

GNU gdb (Debian 9.2-1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from mpd...
(gdb) run
Starting program: /usr/local/bin/mpd --stderr --no-daemon --verbose
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
config_file: loading file /etc/mpd.conf
path: SetFSCharset: fs charset is:
libsamplerate: libsamplerate converter 'Medium Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.3.1
sndfile: libsndfile-1.0.28
simple_db: reading DB
exception: Database corrupted
mpd: ../src/event/Loop.cxx:70: EventLoop::~EventLoop(): Assertion `sockets.empty()' failed.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.

@skidoo23
Copy link
Contributor Author

(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff2fc9537 in __GI_abort () at abort.c:79
#2 0x00007ffff2fc940f in __assert_fail_base
(fmt=0x7ffff3132108 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5555556f6560 "sockets.empty()", file=0x5555556f6528 "../src/event/Loop.cxx", line=70, function=) at assert.c:92
#3 0x00007ffff2fd85c2 in __GI___assert_fail
(assertion=0x5555556f6560 "sockets.empty()", file=0x5555556f6528 "../src/event/Loop.cxx", line=70, function=0x5555556f6510 "EventLoop::~EventLoop()")
at assert.c:101
#4 0x00005555555f5c4f in EventLoop::~EventLoop()
(this=0x7fffffffe498, __in_chrg=)
at ../src/event/Loop.cxx:70
#5 0x00005555555a46f6 in EventLoopHolder::~EventLoopHolder()
(this=0x7fffffffe498, __in_chrg=) at ../src/Instance.hxx:63
#6 0x00005555555a3d02 in Instance::~Instance()
(this=0x7fffffffe490, __in_chrg=) at ../src/Instance.cxx:59
#7 0x00005555555800a2 in MainConfigured(options const&, ConfigData const&)
(options=..., raw_config=...) at ../src/Main.cxx:384
#8 0x0000555555580143 in MainOrThrow(int, char**)
(argc=4, argv=0x7fffffffecc8) at ../src/Main.cxx:604
#9 0x00005555555801c4 in mpd_main(int, char**) (argc=4, argv=0x7fffffffecc8)
at ../src/Main.cxx:612
#10 0x0000555555580237 in main(int, char**) (argc=4, argv=0x7fffffffecc8) at ../src/Main.cxx:626

@skidoo23
Copy link
Contributor Author

Build -Dio_uring=disabled did not help.

@MaxKellermann
Copy link
Member

Build -Dio_uring=disabled did not help.

Of course not. This has nothing to do with io_uring.

MaxKellermann added a commit to MusicPlayerDaemon/ncmpc that referenced this issue Oct 28, 2020
Fixes use-after-free bugs causing assertion failures at shutdown,
because all "abandoned" SocketEvents are still in the linked list.

Closes MusicPlayerDaemon/MPD#986
Closes MusicPlayerDaemon/MPD#987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants