Rebuilt with --buildtype=debug -Db_ndebug=false flags.
edwin@debian:~$ ~/MPD/output/release/mpd --no-daemon --stdout --verbose
config_file: loading file /usr/local/etc/mpd.conf
server_socket: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
libsamplerate: libsamplerate converter "Fastest Sinc Interpolator"
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.3.1
sndfile: libsndfile-1.2.0
decoder: Decoder plugin "wildmidi" is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
adplug: adplug 2.3.3
input: Input plugin "qobuz" is not configured: No Qobuz app_id configured
curl: version 7.88.1
curl: with GnuTLS/3.7.9
event: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
terminate called after throwing an instance of 'fmt::v9::format_error'
what(): string pointer is null
Aborted
edwin@debian:~$ gdb --args ~/MPD/output/release/mpd --stderr --no-daemon --verbose
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 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:
<https://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 /home/edwin/MPD/output/release/mpd...
(gdb) run
Starting program: /home/edwin/MPD/output/release/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 /usr/local/etc/mpd.conf
server_socket: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
libsamplerate: libsamplerate converter "Fastest Sinc Interpolator"
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.3.1
sndfile: libsndfile-1.2.0
decoder: Decoder plugin "wildmidi" is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
adplug: adplug 2.3.3
input: Input plugin "qobuz" is not configured: No Qobuz app_id configured
curl: version 7.88.1
curl: with GnuTLS/3.7.9
[New Thread 0x7fffea7ff6c0 (LWP 4505)]
event: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
[New Thread 0x7fffe9ffe6c0 (LWP 4506)]
terminate called after throwing an instance of 'fmt::v9::format_error'
what(): string pointer is null
Thread 2 "rtio" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffea7ff6c0 (LWP 4505)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1 0x00007ffff44a9e8f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 0x00007ffff445afb2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff4445472 in __GI_abort () at ./stdlib/abort.c:79
#4 0x00007ffff469d919 in () at /lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff46a8e1a in () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff46a7e89 in () at /lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00007ffff46a85a6 in __gxx_personality_v0 () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007ffff4c7c934 in () at /lib/x86_64-linux-gnu/libgcc_s.so.1
#9 0x00007ffff4c7d38d in _Unwind_Resume () at /lib/x86_64-linux-gnu/libgcc_s.so.1
#10 0x0000555555594149 in fmt::v9::vformat_to_n<char*, , 0>(char*, unsigned long, fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >) (out=<optimized out>, n=<optimized out>, fmt=..., args=...) at /usr/include/fmt/core.h:3253
#11 0x000055555559401a in VFmtToBuffer<256ul>(StringBuffer<256ul>&, fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >)
(buffer=..., format_str=..., args=...) at ../../src/lib/fmt/ToBuffer.hxx:15
#12 0x0000555555593cbd in VFmtBuffer<256ul>(fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >) (format_str=..., args=...)
at ../../src/lib/fmt/ToBuffer.hxx:27
#13 0x0000555555593ed9 in FmtBuffer<256ul, char [7], char const*&, char const*&>(char const (&) [7], char const*&, char const*&) (format_str=...) at ../../src/lib/fmt/ToBuffer.hxx:44
#14 0x000055555568538d in FormatNfsClientError(nfs_context*, char const*) (nfs=0x5555559bdf60, msg=0x555555791f01 "nfs_mount_async() failed") at ../../src/lib/nfs/Error.cxx:20
#15 0x00005555556853dc in NfsClientError::NfsClientError(nfs_context*, char const*) (this=0x7fffea7fdd10, nfs=0x5555559bdf60, msg=0x555555791f01 "nfs_mount_async() failed")
at ../../src/lib/nfs/Error.cxx:24
#16 0x0000555555683ed1 in NfsConnection::MountCallback(int, nfs_context*, void*) (this=0x5555559be000, status=-14, nfs=0x5555559bdf60, data=0x0) at ../../src/lib/nfs/Connection.cxx:544
#17 0x0000555555683232 in NfsConnection::MountCallback(int, nfs_context*, void*, void*) (status=-14, nfs=0x5555559bdf60, data=0x0, private_data=0x5555559be000)
at ../../src/lib/nfs/Connection.cxx:556
#18 0x00007ffff71d08d2 in () at /lib/x86_64-linux-gnu/libnfs.so.13
#19 0x00007ffff71d2b1b in () at /lib/x86_64-linux-gnu/libnfs.so.13
#20 0x00007ffff71c0e36 in () at /lib/x86_64-linux-gnu/libnfs.so.13
#21 0x00007ffff71d8602 in rpc_process_pdu () at /lib/x86_64-linux-gnu/libnfs.so.13
#22 0x00007ffff71d93c3 in rpc_service () at /lib/x86_64-linux-gnu/libnfs.so.13
#23 0x0000555555683e2a in NfsConnection::Service(unsigned int) (this=0x5555559be000, flags=1) at ../../src/lib/nfs/Connection.cxx:459
#24 0x0000555555682ff5 in NfsConnection::OnSocketReady(unsigned int) (this=0x5555559be000, flags=1) at ../../src/lib/nfs/Connection.cxx:488
#25 0x0000555555684a76 in BindMethodDetail::WrapperGenerator<void (NfsConnection::*)(unsigned int) noexcept, &NfsConnection::OnSocketReady>::Invoke(void*, unsigned int)
(_instance=0x5555559be000, args#0=1) at ../../src/util/BindMethod.hxx:102
#26 0x000055555563bad2 in BoundMethod<void (unsigned int) noexcept>::operator()(unsigned int) const (this=0x5555559be020, args#0=1) at ../../src/util/BindMethod.hxx:52
#27 0x000055555563bd57 in SocketEvent::Dispatch() (this=0x5555559be008) at ../../src/event/SocketEvent.cxx:105
#28 0x000055555564113f in EventLoop::Run() (this=0x7fffffffccb8) at ../../src/event/Loop.cxx:365
#29 0x00005555556407a9 in EventThread::Run() (this=0x7fffffffccb8) at ../../src/event/Thread.cxx:54
#30 0x00005555555d96fe in BindMethodDetail::WrapperGenerator<void (EventThread::*)() noexcept, &EventThread::Run>::Invoke(void*) (_instance=0x7fffffffccb8) at ../../src/event/Thread.hxx:22
#31 0x000055555563b5e6 in BoundMethod<void () noexcept>::operator()() const (this=0x7fffffffd568) at ../../src/util/BindMethod.hxx:52
#32 0x0000555555644780 in Thread::Run() (this=0x7fffffffd568) at ../../src/thread/Thread.cxx:53
#33 0x0000555555644760 in Thread::ThreadProc(void*) (ctx=0x7fffffffd568) at ../../src/thread/Thread.cxx:82
#34 0x00007ffff44a8134 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#35 0x00007ffff45287dc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) quit
A debugging session is active.
Inferior 1 [process 4502] will be killed.
Quit anyway? (y or n) y
Bug report
Describe the bug
Recently libnfs URL arguments support is added. commit: https://github.com/MusicPlayerDaemon/MPD/commit/9384bff6f912e2388afa1674f0def66487e776ab feature request: https://github.com/MusicPlayerDaemon/MPD/issues/2039
The basics works (tested all scenarios here: https://github.com/MusicPlayerDaemon/MPD/issues/2039#issuecomment-2101279965). But the combination of a NFSv3 server and "version=4" argument in the config will crash.
Expected Behavior
The combination is still invalid but the application should not crash.
It would be even nicer to validate the NFS server protocols and warn the user about the mismatch:
Should i create a ticket for this? Because this can lead to confusion with users (and thus bug reports: "i see my songs but they will not play")
Actual Behavior
Crash.
Version
Configuration
Log
Rebuilt with
--buildtype=debug -Db_ndebug=false
flags.