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

Crash updating library over WebDAV: "pure virtual method called" #665

gward opened this issue Oct 16, 2019 · 1 comment


Copy link

@gward gward commented Oct 16, 2019

Bug report

Running with WebDAV (curl) storage, MPD crashes during update. The crash happens unpredictably, usually after reading dozens of directories and hundreds of files. The error on its own is:

pure virtual method called
terminate called without an active exception

Thread 3 "io" received signal SIGABRT, Aborted.

More detail below.

I'm running under gdb out of a git source dir (at v0.21.16):

$ cat .gdbinit 
set args --no-daemon --stderr /tmp/mpddav/mpd.conf
$ gdb ./mpd

My config file is

music_directory     "http://localhost:8080/albums/"
playlist_directory  "/tmp/mpddav/playlists"
db_file             "/tmp/mpddav/mpddb"
log_file            "/tmp/mpddav/mpd.log"
state_file          "/tmp/mpddav/mpdstate"
log_level           "verbose"
port                "6601"

The WebDAV server on port 8080 is Apache 2.4 (Ubuntu package: 2.4.38-2ubuntu2.3).

Expected Behavior

Database update runs to completion without crashing.

Actual Behavior

Database update crashes after reading an unpredictable number of files/directories.


Music Player Daemon 0.21.16 (v0.21.16)
Copyright 2003-2007 Warren Dukes <>
Copyright 2008-2018 Max Kellermann <>
This is free software; see the source for copying conditions.  There is NO

Database plugins:
 simple proxy upnp

Storage plugins:
 local smbclient udisks nfs curl

Neighbor plugins:
 smbclient upnp 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
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [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
 [adplug] amd d00 hsc laa rad raw sa2
 [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

 libsamplerate soxr

Tag plugins:

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

Encoder plugins:
 null vorbis opus lame wave flac

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

Input plugins:
 file archive alsa tidal curl ffmpeg smbclient nfs mms cdio_paranoia

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

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

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

(from a git checkout)


update: reading wolfstone-1999-seven/03.jens_tune.ogg
[New Thread 0x7fffe6911700 (LWP 12156)]
[Thread 0x7fffe6911700 (LWP 12156) exited]
update: added wolfstone-1999-seven/03.jens_tune.ogg
update: reading wolfstone-1999-seven/05.quinie_fae_rhynie.ogg
[New Thread 0x7fffe6911700 (LWP 12157)]
[Thread 0x7fffe6911700 (LWP 12157) exited]
update: added wolfstone-1999-seven/05.quinie_fae_rhynie.ogg
update: reading wolfstone-1999-seven/04.black_dog.ogg
update: ignoring unrecognized file wolfstone-1999-seven/04.black_dog.ogg
update: reading wolfstone-1999-seven/09.crowfeathers.ogg
[New Thread 0x7fffe6911700 (LWP 12158)]
[Thread 0x7fffe6911700 (LWP 12158) exited]
update: added wolfstone-1999-seven/09.crowfeathers.ogg
update: reading wolfstone-1999-seven/08.wild_and_the_free.ogg
[New Thread 0x7fffe6911700 (LWP 12159)]
[Thread 0x7fffe6911700 (LWP 12159) exited]
update: added wolfstone-1999-seven/08.wild_and_the_free.ogg
update: reading wolfstone-1999-seven/11.fingals_cave.ogg
[New Thread 0x7fffe6911700 (LWP 12160)]
[Thread 0x7fffe6911700 (LWP 12160) exited]
update: added wolfstone-1999-seven/11.fingals_cave.ogg
update: reading wolfstone-1999-seven/10.maggies.ogg
[New Thread 0x7fffe6911700 (LWP 12161)]
[Thread 0x7fffe6911700 (LWP 12161) exited]
update: added wolfstone-1999-seven/10.maggies.ogg
update: reading wolfstone-1999-seven/06.john_simmers.ogg
[New Thread 0x7fffe6911700 (LWP 12162)]
[Thread 0x7fffe6911700 (LWP 12162) exited]
update: added wolfstone-1999-seven/06.john_simmers.ogg
update: reading wolfstone-1999-seven/07.j_time.ogg
[New Thread 0x7fffe6911700 (LWP 12163)]
[Thread 0x7fffe6911700 (LWP 12163) exited]
update: added wolfstone-1999-seven/07.j_time.ogg
update: reading wolfstone-1999-seven/01.psycho_woman.ogg
[New Thread 0x7fffe6911700 (LWP 12164)]
update: added wolfstone-1999-seven/01.psycho_woman.ogg
update: reading wolfstone-1999-seven/02.brave_boys.ogg
[Thread 0x7fffe6911700 (LWP 12164) exited]
[New Thread 0x7fffe6911700 (LWP 12165)]
[Thread 0x7fffe6911700 (LWP 12165) exited]
update: added wolfstone-1999-seven/02.brave_boys.ogg
exception: Status 200 from WebDAV server; expected "207 Multi-Status"
pure virtual method called
terminate called without an active exception

Thread 3 "io" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe3913700 (LWP 1506)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50


(gdb) where
#0  0x00007ffff17f5ed7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff17d7535 in __GI_abort () at abort.c:79
#2  0x00007ffff1a73672 in  () at /usr/lib/x86_64-linux-gnu/
#3  0x00007ffff1a7f2b6 in  () at /usr/lib/x86_64-linux-gnu/
#4  0x00007ffff1a7f301 in  () at /usr/lib/x86_64-linux-gnu/
#5  0x00007ffff1a8001f in  () at /usr/lib/x86_64-linux-gnu/
#6  0x000055555561582e in CurlRequest::FinishHeaders() (this=0x7fffe71110a0) at ../src/lib/curl/Request.cxx:147
#7  0x0000555555616784 in CurlRequest::DataReceived(void const*, unsigned long)
    (this=0x7fffe71110a0, ptr=0x7fffd400721c, received_size=2833) at ../src/lib/curl/Request.cxx:247
#8  0x0000555555615b52 in CurlRequest::WriteFunction(void*, unsigned long, unsigned long, void*)
    (ptr=0x7fffd400721c, size=2833, nmemb=2833, stream=0x7fffe71110a0) at ../src/lib/curl/Request.cxx:273
#9  0x00007ffff7933d64 in  () at /usr/lib/x86_64-linux-gnu/
#10 0x00007ffff794697b in  () at /usr/lib/x86_64-linux-gnu/
#11 0x00007ffff794fc13 in  () at /usr/lib/x86_64-linux-gnu/
#12 0x00007ffff7951191 in  () at /usr/lib/x86_64-linux-gnu/
#13 0x00007ffff79512c5 in curl_multi_socket_action () at /usr/lib/x86_64-linux-gnu/
#14 0x0000555555614945 in CurlGlobal::SocketAction(int, int) (this=0x555555871670, fd=-1, ev_bitmask=0)
    at ../src/lib/curl/Global.cxx:261
#15 0x0000555555614b1e in CurlGlobal::InvalidateSockets() (this=0x555555871670) at ../src/lib/curl/Global.hxx:74
#16 0x0000555555614745 in CurlGlobal::Add(void*, CurlRequest&) (this=0x555555871670, easy=0x7fffd40c91d0, request=...)
    at ../src/lib/curl/Global.cxx:174
#17 0x00005555556154b2 in CurlRequest::Start() (this=0x7fffe71110a0) at ../src/lib/curl/Request.cxx:80
#18 0x00005555556ee2b9 in BlockingHttpRequest::OnDeferredStart() (this=0x7fffe7111060)
--Type <RET> for more, q to quit, c to continue without paging--c
    at ../src/storage/plugins/CurlStorage.cxx:149
#19 0x00005555556efa69 in BindMethodDetail::BindMethodWrapperGenerator2<BlockingHttpRequest, void (BlockingHttpRequest::*)(), &BlockingHttpRequest::OnDeferredStart, void>::Invoke(void*) (_instance=0x7fffe7111060) at ../src/util/BindMethod.hxx:147
#20 0x00005555555f265c in BoundMethod<void ()>::operator()() const (this=0x7fffe7111080) at ../src/util/BindMethod.hxx:77
#21 0x00005555555f8c74 in DeferEvent::RunDeferred() (this=0x7fffe7111068) at ../src/event/DeferEvent.hxx:66
#22 0x00005555555f880b in EventLoop::HandleDeferred() (this=0x555555870c20) at ../src/event/Loop.cxx:269
#23 0x00005555555f88b5 in EventLoop::OnSocketReady(unsigned int) (this=0x555555870c20, flags=1) at ../src/event/Loop.cxx:281
#24 0x00005555555f2ab0 in SocketMonitor::Dispatch(unsigned int) (this=0x555555870c20, flags=1) at ../src/event/SocketMonitor.cxx:37
#25 0x00005555555f84c4 in EventLoop::Run() (this=0x555555870c20) at ../src/event/Loop.cxx:214
#26 0x00005555555f7a10 in EventThread::Run() (this=0x555555870c20) at ../src/event/Thread.cxx:65
#27 0x00005555555a93a6 in BindMethodDetail::BindMethodWrapperGenerator2<EventThread, void (EventThread::*)(), &EventThread::Run, void>::Invoke(void*) (_instance=0x555555870c20) at ../src/util/BindMethod.hxx:147
#28 0x00005555555f265c in BoundMethod<void ()>::operator()() const (this=0x555555870d88) at ../src/util/BindMethod.hxx:77
#29 0x00005555555fd402 in Thread::Run() (this=0x555555870d88) at ../src/thread/Thread.cxx:63
#30 0x00005555555fd3e2 in Thread::ThreadProc(void*) (ctx=0x555555870d88) at ../src/thread/Thread.cxx:92
#31 0x00007ffff19a6182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#32 0x00007ffff18cfb1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

This comment has been minimized.

Copy link
Contributor Author

@gward gward commented Oct 16, 2019

Digging in a bit: at Request.cxx:147 (i.e. in method FinishHeaders()), it looks like handler is a CurlResponseHandler:

(gdb) up
#1  0x00007ffff17d7535 in __GI_abort () at abort.c:79
79	abort.c: No such file or directory.
(gdb) up
#2  0x00007ffff1a73672 in ?? () from /usr/lib/x86_64-linux-gnu/
(gdb) up
#3  0x00007ffff1a7f2b6 in ?? () from /usr/lib/x86_64-linux-gnu/
(gdb) up
#4  0x00007ffff1a7f301 in std::terminate() () from /usr/lib/x86_64-linux-gnu/
(gdb) up
#5  0x00007ffff1a8001f in __cxa_pure_virtual () from /usr/lib/x86_64-linux-gnu/
(gdb) up
#6  0x000055555561582e in CurlRequest::FinishHeaders (this=0x7fffe7110df0) at ../src/lib/curl/Request.cxx:147
147		handler.OnHeaders(status, std::move(headers));
(gdb) p handler
$1 = (CurlResponseHandler &) @0x7fffe7110db0: {
  _vptr.CurlResponseHandler = 0x5555558186d8 <vtable for HttpGetInfoOperation+16>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.