You are not logged in.

#26 2017-08-27 10:04:07

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

mpc invokes /etc/nsswitch.conf, /etc/host.conf, /etc/resolv.conf, /usr/lib/libnss_files.so.2 and /etc/hosts - but since the status query works, that's hardly the problem.
The most relevant question is the output of the daemon when calling "mpc update" (which leads to the closed connection - and hopefull provides more insight on the cause)

Offline

#27 2017-08-28 10:29:44

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

After further search, I isolated the problem to a segmentation fault that occurs whenever I do an update of the database from the client side

I first kill all mpd instances.

Then I run mpd with mpd --verbose --no-daemon:

Aug 28 11:13 : exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
Aug 28 11:13 : libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
Aug 28 11:13 : vorbis: Xiph.Org libVorbis 1.3.5
Aug 28 11:13 : opus: libopus 1.2.1
Aug 28 11:13 : sndfile: libsndfile-1.0.28
Aug 28 11:13 : simple_db: reading DB
Aug 28 11:13 : curl: version 7.55.1
Aug 28 11:13 : curl: with OpenSSL/1.1.0f

In another window, I run ncmpcpp with the u command. It starts a database update and then flags a 'Connection refused' message.

Now my mpd flags a segmentation error:

Aug 28 11:13 : exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
Aug 28 11:13 : libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
Aug 28 11:13 : vorbis: Xiph.Org libVorbis 1.3.5
Aug 28 11:13 : opus: libopus 1.2.1
Aug 28 11:13 : sndfile: libsndfile-1.0.28
Aug 28 11:13 : simple_db: reading DB
Aug 28 11:13 : curl: version 7.55.1
Aug 28 11:13 : curl: with OpenSSL/1.1.0f
Segmentation fault (core dumped)

And coredumpctl list does list the dump:

Mon 2017-08-28 10:36:23 BST   21921  1000  1000  11 present   /usr/bin/mpd
Mon 2017-08-28 10:44:22 BST   29308  1000  1000  11 present   /usr/bin/mpd
Mon 2017-08-28 11:15:43 BST   15787  1000  1000  11 present   /usr/bin/mpd

In fact, examining the coredump list, the first segmentation fault with mpd happened on the Friday:

Fri 2017-08-25 17:42:03 BST    4853  1000  1000  11 present   /usr/bin/mpd

exactly the time I started having the database update problem as I described in my earlier posts.

Also for some reason, avahi is not running with mpd any longer.

Any thoughts on how to evaluate the seg fault/coredumps?

Last edited by d_fajardo (2017-08-28 10:30:50)

Offline

#28 2017-08-28 11:16:15

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

If this is any help, I used strace to analyze the seg fault.

This is the strace output using strace -eopen mpd --no-daemon --verbose, and after triggering the seg fault as before:

Aug 28 12:08 : curl: version 7.55.1
Aug 28 12:08 : curl: with OpenSSL/1.1.0f
open("/home/dipswitch/.smb/smb.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/samba/smb.conf", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("/home/dipswitch/.config/mpd/pid", O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC|O_CLOEXEC, 0666) = 12
open("/home/dipswitch/.config/mpd/state", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 13
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

It seems to be looking for an smb file or an smb.conf file. Is this samba? Why this?

Offline

#29 2017-08-28 14:37:45

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

coredumpctl gdb

Offline

#30 2017-08-30 07:29:01

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

I decided to try and reinstall everything. I backed-up my old mpd directory and started a new clean directory. Reinstalled mpd.

After running my initial configuration mpd --no-daemon --verbose ~/.config/mpd/mpd.conf, I get this

Aug 30 08:24 : libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
Aug 30 08:24 : vorbis: Xiph.Org libVorbis 1.3.5
Aug 30 08:24 : opus: libopus 1.2.1
Aug 30 08:24 : sndfile: libsndfile-1.0.28
Aug 30 08:24 : exception: Failed to open /home/dipswitch/.config/mpd/database: No such file or directory
Aug 30 08:24 : curl: version 7.55.1
Aug 30 08:24 : curl: with OpenSSL/1.1.0f
Segmentation fault (core dumped)

It doesn't create a database as it did before and that is what I believe creates the seg fault. Anyway I can track the root of this problem?

This is my new mpd.conf:

# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This 
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory		"~/Music"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use 
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory		"~/.config/mpd/playlists"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the 
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file			"~/.config/mpd/database"
# 
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog, otherwise logging is disabled.
#
log_file			"~/.config/mpd/log"
#
# This setting sets the location of the file which stores the process ID
# for use of mpd --kill and some init scripts. This setting is disabled by
# default and the pid file will not be stored.
#
pid_file			"~/.config/mpd/pid"
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
# it was brought down. This setting is disabled by default and the server 
# state will be reset on server start up.
#
state_file			"~/.config/mpd/state"
#
# The location of the sticker database.  This is a database which
# manages dynamic information attached to songs.
#
sticker_file			"~/.config/mpd/sticker.sql"
#
###############################################################################


# General music daemon options ################################################
#
# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
#user				"nobody"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
#group				"nogroup"
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon. Not effective if
# systemd socket activiation is in use.
#
# For network
bind_to_address		"127.0.0.1"
#
# And for Unix Socket
#bind_to_address		"~/.mpd/socket"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
port				"6600"
#
# This setting controls the type of information which is logged. Available 
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
# argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage.
#
#log_level			"default"
#
# If you have a problem with your MP3s ending abruptly it is recommended that 
# you set this argument to "no" to attempt to fix the problem. If this solves
# the problem, it is highly recommended to fix the MP3 files with vbrfix
# (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
# point gapless MP3 playback can be enabled.
#
#gapless_mp3_playback			"yes"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
#
#restore_paused "no"
#
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
#save_absolute_paths_in_playlists	"no"
#
# This setting defines a list of tag types that will be extracted during the
# audio file discovery process. The complete list of possible values can be
# found in the user manual.
#metadata_to_use	"artist,album,title,track,name,genre,date,composer,performer,disc"
#
# This setting enables automatic update of MPD's database when files in 
# music_directory are changed.
#
#auto_update	"yes"
#
# Limit the depth of the directories being watched, 0 means only watch
# the music directory itself.  There is no limit by default.
#
#auto_update_depth "3"
#
###############################################################################


# Symbolic link behavior ######################################################
#
# If this setting is set to "yes", MPD will discover audio files by following 
# symbolic links outside of the configured music_directory.
#
follow_outside_symlinks	"yes"
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links inside of the configured music_directory.
#
follow_inside_symlinks		"yes"
#
###############################################################################


# Zeroconf / Avahi Service Discovery ##########################################
#
# If this setting is set to "yes", service information will be published with
# Zeroconf / Avahi.
#
#zeroconf_enabled		"yes"
#
# The argument to this setting will be the Zeroconf / Avahi unique name for
# this MPD server on the network.
#
#zeroconf_name			"Music Player"
#
###############################################################################


# Permissions #################################################################
#
# If this setting is set, MPD will require password authorization. The password
# setting can be specified multiple times for different password profiles.
#
#password                        "password@read,add,control,admin"
#
# This setting specifies the permissions a user has who has not yet logged in. 
#
#default_permissions             "read,add,control,admin"
#
###############################################################################


# Database #######################################################################
#

#database {
#       plugin "proxy"
#       host "other.mpd.host"
#       port "6600"
#}

# Input #######################################################################
#

input {
        plugin "curl"
#       proxy "proxy.isp.com:8080"
#       proxy_user "user"
#       proxy_password "password"
}

#
###############################################################################

# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple 
# audio outputs at the same time, through multiple audio_output settings 
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# An example of an ALSA output:
#
audio_output {
	type		     "alsa"
	name		     "MPD Jack Output"
	device		     "jackplugmpd"	# optional
	mixer_type       "software"	# optional
#	mixer_device	 "default"	# optional
#	mixer_control	 "PCM"		# optional
##	mixer_index	"0"		# optional
}
audio_output {
    type             "fifo"
    name             "my_fifo"
    path             "/tmp/mpd.fifo"
    format           "44100:16:2"
}

Offline

#31 2017-08-30 10:42:24

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

Yes, inspect the coredump. That's what it's good for.

Offline

#32 2017-08-31 09:45:27

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

So to debug, I called mpd --no-daemon --verbose and on another prompt I call mpc update --wait which triggers a seg fault:

config_file: loading file /home/dipswitch/.config/mpd/mpd.conf
Aug 31 10:29 : libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
Aug 31 10:29 : vorbis: Xiph.Org libVorbis 1.3.5
Aug 31 10:29 : opus: libopus 1.2.1
Aug 31 10:29 : sndfile: libsndfile-1.0.28
Aug 31 10:29 : simple_db: reading DB
Aug 31 10:29 : curl: version 7.55.1
Aug 31 10:29 : curl: with OpenSSL/1.1.0f
Segmentation fault (core dumped)

Then I check the PID of the core dump with coredumpctl list and it is listed as the latest dump:

Thu 2017-08-31 10:30:16 BST    6186  1000  1000  11 present   /usr/bin/mpd

Next I ran coredumpctl gdb 6186 to see what's causing the PID seg fault:

          PID: 6186 (mpd)
           UID: 1000 (dipswitch)
           GID: 1000 (dipswitch)
        Signal: 11 (SEGV)
     Timestamp: Thu 2017-08-31 10:30:16 BST (3min 49s ago)
  Command Line: mpd --no-daemon --verbose
    Executable: /usr/bin/mpd
 Control Group: /user.slice/user-1000.slice/session-c2.scope
          Unit: session-c2.scope
         Slice: user-1000.slice
       Session: c2
     Owner UID: 1000 (dipswitch)
       Boot ID: 0be17baf224d4ea1bb80b62ab024ec86
    Machine ID: b8a23d3a1e7c4317851edccf6171aac6
      Hostname: TUF-Z270
       Storage: /var/lib/systemd/coredump/core.mpd.1000.0be17baf224d4ea1bb80b62ab024ec86.6186.1504171816000000.lz4
       Message: Process 6186 (mpd) of user 1000 dumped core.                                                                                                                        
                                                                                                                                                                                    
                Stack trace of thread 6443:                                                                                                                                         
                #0  0x00007f9cf368cc43 __GI_strchr (libc.so.6)                                                                                                                      
                #1  0x0000559908741a46 n/a (mpd)                                                                                                                                    
                #2  0x000055990870c723 n/a (mpd)
                #3  0x000055990870c9a8 n/a (mpd)
                #4  0x000055990870cb1e n/a (mpd)
                #5  0x00005599087083cf n/a (mpd)
                #6  0x00005599086c53d2 n/a (mpd)
                #7  0x00005599086c5599 n/a (mpd)
                #8  0x00005599086c3b99 n/a (mpd)
                #9  0x00005599086c3ca3 n/a (mpd)
                #10 0x00005599086ce84a n/a (mpd)
                #11 0x00005599086ce13a n/a (mpd)
                #12 0x00005599086cdda1 n/a (mpd)
                #13 0x00005599086ce0eb n/a (mpd)
                #14 0x00005599086cdda1 n/a (mpd)
                #15 0x00005599086ce0eb n/a (mpd)
                #16 0x00005599086cdda1 n/a (mpd)
                #17 0x00005599086ce470 n/a (mpd)
                #18 0x00005599086cc768 n/a (mpd)
                #19 0x000055990873afde n/a (mpd)
                #20 0x00007f9cf5db2049 start_thread (libpthread.so.0)
                #21 0x00007f9cf36f9f0f __clone (libc.so.6)
                
                Stack trace of thread 6189:
                #0  0x00007f9cf5db81ad pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00005599086d94be n/a (mpd)
                #2  0x000055990873afde n/a (mpd)
                #3  0x00007f9cf5db2049 start_thread (libpthread.so.0)
                #4  0x00007f9cf36f9f0f __clone (libc.so.6)
                
                Stack trace of thread 6186:
                #0  0x00007f9cf36fa473 epoll_wait (libc.so.6)
                #1  0x000055990873ab8e n/a (mpd)
                #2  0x00005599086aef77 n/a (mpd)
                #3  0x00007f9cf362c4ca __libc_start_main (libc.so.6)
                #4  0x00005599086ae5ba n/a (mpd)
                
                Stack trace of thread 6187:
                #0  0x00007f9cf36fa473 epoll_wait (libc.so.6)
                #1  0x000055990873ab8e n/a (mpd)
                #2  0x000055990873afde n/a (mpd)
                #3  0x00007f9cf5db2049 start_thread (libpthread.so.0)
                #4  0x00007f9cf36f9f0f __clone (libc.so.6)
                
                Stack trace of thread 6190:
                #0  0x00007f9cf5db81ad pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00005599086d67aa n/a (mpd)
                #2  0x000055990873afde n/a (mpd)
                #3  0x00007f9cf5db2049 start_thread (libpthread.so.0)
                #4  0x00007f9cf36f9f0f __clone (libc.so.6)
                
                Stack trace of thread 6188:
                #0  0x00007f9cf5db81ad pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00005599086bc85c n/a (mpd)
                #2  0x000055990873afde n/a (mpd)
                #3  0x00007f9cf5db2049 start_thread (libpthread.so.0)
                #4  0x00007f9cf36f9f0f __clone (libc.so.6)

GNU gdb (GDB) 8.0
Copyright (C) 2017 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-pc-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 /usr/bin/mpd...(no debugging symbols found)...done.
[New LWP 6443]
[New LWP 6189]
[New LWP 6186]
[New LWP 6187]
[New LWP 6190]
[New LWP 6188]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `mpd --no-daemon --verbose'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f9cf368cc43 in __strchr_sse2 () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7f9cd8f20700 (LWP 6443))]
(gdb) 

It seems libc.so is causing the trip. I have no idea how to proceed from here. Am I right in thinking this is a module? I modprobed it but it doesn't exist.

Offline

#33 2017-08-31 11:26:11

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

mpd makes a bad strchr call - probably a bug in mpd which might expose either a bad filename or locale.

localectl
locale
locale -a

For more detailed info, you'll have to build mpd with debug enabled (and w/o stripping all debug symbols) to get a meaningful stack trace including the mpd symbols.
I'm not sure what you mean by "module", but it's no kernel module problem for sure.

Offline

#34 2017-09-03 06:50:14

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

Could this be an issue with libwrap as discussed here?

When I run 'ldd `which mpd`|grep wrap' as described on the page, I get:

        libdbwrap-samba4.so => /usr/lib/samba/libdbwrap-samba4.so (0x00007fd4f3cbc000)
        libtdb-wrap-samba4.so => /usr/lib/samba/libtdb-wrap-samba4.so (0x00007fd4f0dec000)

And I checked the PKGBUILD of mpd here and libwrap is not disabled.

Offline

#35 2017-09-03 14:31:13

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

Do you have any entries in hosts.allow/deny or the smb.conf that would impede the connection?
Do you have any mpd - smb relation (remote database or files) or at least an smb daemon running?

Offline

#36 2017-09-04 07:45:58

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

The answer to your questions is no. My whole mpd setup now doesn't register avahi. Could it be that avahi was replaced by smb upon update? Is it possible to bind mpd to avahi again?
Thanks to you it was your initial intuition regarding avahi that led to this, and finding at least the source of the problem the seg fault.

Offline

#37 2017-09-04 12:18:31

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

I'm not sure this relates to smb or avahi atm.
https://bbs.archlinux.org/viewtopic.php … 2#p1733542

And ideally build a debug enabled mpd to get a better coredump (telling you what actually calls strchr here)

Offline

#38 2017-09-04 12:23:55

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

This is where my inexperience becomes obvious. How do you build debug mpd? I have downloaded the source files but I have no idea how to build with debug. Any links you can point me to to tutor me?

Offline

#39 2017-09-04 17:41:04

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

Download https://www.musicpd.org/download/mpd/0. … .10.tar.xz
untar and enter it and run

./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--enable-cdio-paranoia \
		--enable-iso9660 \
		--enable-jack \
		--enable-libmpdclient \
		--enable-pipe-output \
		--enable-pulse \
		--enable-soundcloud \
		--enable-zzip \
		--disable-sidplay \
		--with-systemduserunitdir=/usr/lib/systemd/user \
		--with-systemdsystemunitdir=/usr/lib/systemd/system \
		--enable-debug

make && sudo make install

(notice --enable-debug)

This will simply override your package binaries.
If you want to build a package, download all plain files from https://git.archlinux.org/svntogit/pack … ckages/mpd into a directory, edit the PKGFILE to include --enable-debug and run "makepkg", then "pacman -U <your generated package>"

Offline

#40 2017-09-05 06:35:07

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

Thanks so much. I'll try that but I think I'm going via the package route. It's more useful for me to learn the package way.

Offline

#41 2017-09-05 08:08:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: [SOLVED] Cannot update mpd database after upgrade

You will also want to make sure to disable the debug symbol stripping in the PKGBUILD itself should you go that route https://wiki.archlinux.org/index.php/De … s#PKGBUILD

Offline

#42 2017-09-05 08:17:09

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

So I built mpd with debug-enabled. I deleted all my files in my mpd directory except for the playlist folder and my mpd.conf to see if it will auto-generate a new DB file.

So running mpd --verbose --no-daemon 'path/to/config/' I get:

 config_file: loading file /home/dipswitch/.config/mpd/mpd.conf
Sep 05 09:11 : libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
Sep 05 09:11 : vorbis: Xiph.Org libVorbis 1.3.5
Sep 05 09:11 : opus: libopus 1.2.1
Sep 05 09:11 : sndfile: libsndfile-1.0.28
Sep 05 09:11 : wildmidi: configuration file does not exist: /etc/timidity/timidity.cfg
Sep 05 09:11 : exception: Failed to open /home/dipswitch/.config/mpd/database: No such file or directory
Sep 05 09:11 : curl: version 7.55.1
Sep 05 09:11 : curl: with OpenSSL/1.1.0f
Segmentation fault (core dumped)

DB is not generated and there's a new mention of a missing configuration for wildmidi that wasn't there before.

Running the coredumptl gdb, this is what I get:

Reading symbols from /usr/bin/mpd...(no debugging symbols found)...done.
[New LWP 31758]
[New LWP 31755]
[New LWP 31756]
[New LWP 31760]
[New LWP 31757]
[New LWP 31759]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `mpd --verbose --no-daemon /home/dipswitch/.config/mpd/mpd.conf'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f711e98ec43 in __strchr_sse2 () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7f7104f73700 (LWP 31758))]
(gdb) 

It looks like there's a debugging library at work libthread_db. What and how do I look for more?

Offline

#43 2017-09-05 08:41:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: [SOLVED] Cannot update mpd database after upgrade

At that point write

bt full

see also: https://wiki.archlinux.org/index.php/St … _guide#Gdb Also note that gdb still mentions it doesn't find debug symbols, you might have to rebuild mpd again, taking my other post into account

Last edited by V1del (2017-09-05 08:44:02)

Offline

#44 2017-09-05 10:09:06

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

I rebuilt mpd as suggested with debug symbols.

Here is what I get in the coredump running gdb bt full:

(gdb) bt full
#0  0x00007f1086cafc43 in __strchr_sse2 () from /usr/lib/libc.so.6
No symbol table info available.
#1  0x0000562d91a443f6 in strchr (__c=<optimized out>, __s=0x0) at /usr/include/string.h:226
No locals.
#2  DivideString::DivideString (this=0x7f106d293490, s=0x0, separator=<optimized out>, strip=<optimized out>) at src/util/DivideString.cxx:28
        length = <optimized out>
#3  0x0000562d91a054b3 in flac_scan_comment (entry=0x7f106007fa00, handler=..., handler_ctx=handler_ctx@entry=0x7f106d2936b0) at src/decoder/plugins/FlacMetadata.cxx:99
        comment = <optimized out>
        split = {first = 0x0, second = 0x7f10600632b6 "Lotus Feet"}
#4  0x0000562d91a05778 in flac_scan_comments (comment=<optimized out>, comment=<optimized out>, handler_ctx=<optimized out>, handler=...)
    at src/decoder/plugins/FlacMetadata.cxx:123
        i = 2
#5  flac_scan_metadata (block=0x7f1060062aa0, handler=..., handler_ctx=0x7f106d2936b0) at src/decoder/plugins/FlacMetadata.cxx:143
No locals.
#6  0x0000562d91a058ee in FlacMetadataChain::Scan (this=0x7f106d293540, handler=..., handler_ctx=0x7f106d2936b0) at src/decoder/plugins/FlacMetadata.cxx:176
        iterator = {iterator = 0x7f106001cf70}
#7  0x0000562d91a0011f in flac_scan_file (path_fs=..., handler=..., handler_ctx=0x7f106d2936b0) at src/decoder/plugins/FlacDecoderPlugin.cxx:83
        chain = {chain = 0x7f1060061a50}
#8  0x0000562d919b3c62 in DecoderPlugin::ScanFile<Path> (this=<optimized out>, handler_ctx=<optimized out>, handler=..., path_fs=...) at src/decoder/DecoderPlugin.hxx:145
No locals.
#9  TagFileScan::ScanFile (plugin=..., this=0x7f106d2935c0) at src/TagFile.cxx:55
No locals.
#10 TagFileScan::Scan (plugin=..., this=0x7f106d2935c0) at src/TagFile.cxx:83
        this = 0x7f106d2935c0
#11 <lambda(const DecoderPlugin&)>::operator() (plugin=..., __closure=<synthetic pointer>) at src/TagFile.cxx:103
No locals.
#12 decoder_plugins_try<tag_file_scan(Path, const TagHandler&, void*)::<lambda(const DecoderPlugin&)> > (f=...) at src/decoder/DecoderList.hxx:60
        i = 4
#13 tag_file_scan (path_fs=..., handler=..., handler_ctx=handler_ctx@entry=0x7f106d2936b0) at src/TagFile.cxx:103
        __PRETTY_FUNCTION__ = "bool tag_file_scan(Path, const TagHandler&, void*)"
        suffix = <optimized out>
        suffix_utf8 = "flac"
        tfs = {path_fs = {<StringPointer<char>> = {static SENTINEL = <optimized out>, 
              value = 0x7f1060061f40 "/home/DataPool/Music/Shakti/Shakti with John McLaughlin/Disc 1 - 02 - Lotus Feet.flac"}, <No data fields>}, 
          suffix = 0x7f106d2935b0 "flac", handler = @0x562d91c9dc00, handler_ctx = 0x7f106d2936b0, mutex = {<PosixMutex> = {mutex = {__data = {__lock = 0, __count = 0, 
                  __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, 
                __align = 0}}, <No data fields>}, cond = {<PosixCond> = {cond = {__data = {{__wseq = 0, __wseq32 = {__low = 0, __high = 0}}, {__g1_start = 0, __g1_start32 = {
                      __low = 0, __high = 0}}, __g_refs = {0, 0}, __g_size = {0, 0}, __g1_orig_size = 0, __wrefs = 0, __g_signals = {0, 0}}, 
                __size = '\000' <repeats 47 times>, __align = 0}}, <No data fields>}, is = std::unique_ptr<InputStream> containing 0x0}
#14 0x0000562d919b3e49 in tag_file_scan (path=..., builder=...) at src/TagFile.cxx:109
No locals.
#15 0x0000562d919b21d9 in Song::UpdateFile (this=this@entry=0x7f1060062090, storage=...) at src/SongUpdate.cxx:87
        relative_uri = "Shakti/Shakti with John McLaughlin/Disc 1 - 02 - Lotus Feet.flac"
        info = {type = StorageFileInfo::Type::REGULAR, size = 19263536, mtime = 1503678958, device = 47, inode = 147817}
---Type <return> to continue, or q <return> to quit---
        tag_builder = {duration = {<std::chrono::duration<int, std::ratio<1, 1000> >> = {__r = 286466}, <No data fields>}, has_playlist = false, 
          items = std::vector of length 1, capacity 1 = {0x7f1060062109}}
        path_fs = {value = "/home/DataPool/Music/Shakti/Shakti with John McLaughlin/Disc 1 - 02 - Lotus Feet.flac"}
#16 0x0000562d919b2307 in Song::LoadFile (storage=..., path_utf8=path_utf8@entry=0x7f1060061d20 "Disc 1 - 02 - Lotus Feet.flac", parent=...) at src/SongUpdate.cxx:51
        __PRETTY_FUNCTION__ = "static Song* Song::LoadFile(Storage&, const char*, Directory&)"
        song = 0x7f1060062090
#17 0x0000562d919bdff3 in UpdateWalk::UpdateSongFile2 (info=..., suffix=0x7f1060061d39 "flac", name=0x7f1060061d20 "Disc 1 - 02 - Lotus Feet.flac", directory=..., 
    this=0x562d9342ba50) at src/db/update/UpdateSong.cxx:66
        song = <optimized out>
#18 UpdateWalk::UpdateSongFile (this=this@entry=0x562d9342ba50, directory=..., name=name@entry=0x7f1060061d20 "Disc 1 - 02 - Lotus Feet.flac", 
    suffix=suffix@entry=0x7f1060061d39 "flac", info=...) at src/db/update/UpdateSong.cxx:104
No locals.
#19 0x0000562d919bd5a2 in UpdateWalk::UpdateRegularFile (info=..., name=0x7f1060061d20 "Disc 1 - 02 - Lotus Feet.flac", directory=..., this=0x562d9342ba50)
    at src/db/update/Walk.cxx:211
        suffix = 0x7f1060061d39 "flac"
#20 UpdateWalk::UpdateDirectoryChild (this=this@entry=0x562d9342ba50, directory=..., exclude_list=..., name=name@entry=0x7f1060061d20 "Disc 1 - 02 - Lotus Feet.flac", 
    info=...) at src/db/update/Walk.cxx:224
        __PRETTY_FUNCTION__ = "void UpdateWalk::UpdateDirectoryChild(Directory&, const ExcludeList&, const char*, const StorageFileInfo&)"
#21 0x0000562d919bd0bc in UpdateWalk::UpdateDirectory (this=this@entry=0x562d9342ba50, directory=..., exclude_list=..., info=...) at src/db/update/Walk.cxx:382
        info2 = {type = StorageFileInfo::Type::REGULAR, size = 19263536, mtime = 1503678958, device = 47, inode = 147817}
        __PRETTY_FUNCTION__ = "bool UpdateWalk::UpdateDirectory(Directory&, const ExcludeList&, const StorageFileInfo&)"
        reader = std::unique_ptr<StorageDirectoryReader> containing 0x7f1060061110
        child_exclude_list = {parent = 0x7f106d293aa0, patterns = empty std::forward_list}
        name_utf8 = 0x7f1060061d20 "Disc 1 - 02 - Lotus Feet.flac"
#22 0x0000562d919bd557 in UpdateWalk::UpdateDirectoryChild (this=this@entry=0x562d9342ba50, directory=..., exclude_list=..., 
    name=name@entry=0x7f1060062150 "Shakti with John McLaughlin", info=...) at src/db/update/Walk.cxx:238
        __PRETTY_FUNCTION__ = "void UpdateWalk::UpdateDirectoryChild(Directory&, const ExcludeList&, const char*, const StorageFileInfo&)"
#23 0x0000562d919bd0bc in UpdateWalk::UpdateDirectory (this=this@entry=0x562d9342ba50, directory=..., exclude_list=..., info=...) at src/db/update/Walk.cxx:382
        info2 = {type = StorageFileInfo::Type::DIRECTORY, size = 5, mtime = 1503679271, device = 47, inode = 148298}
        __PRETTY_FUNCTION__ = "bool UpdateWalk::UpdateDirectory(Directory&, const ExcludeList&, const StorageFileInfo&)"
        reader = std::unique_ptr<StorageDirectoryReader> containing 0x7f10600631f0
        child_exclude_list = {parent = 0x7f106d293c40, patterns = empty std::forward_list}
        name_utf8 = 0x7f1060062150 "Shakti with John McLaughlin"
#24 0x0000562d919bd557 in UpdateWalk::UpdateDirectoryChild (this=this@entry=0x562d9342ba50, directory=..., exclude_list=..., name=name@entry=0x7f106001bb00 "Shakti", 
    info=...) at src/db/update/Walk.cxx:238
        __PRETTY_FUNCTION__ = "void UpdateWalk::UpdateDirectoryChild(Directory&, const ExcludeList&, const char*, const StorageFileInfo&)"
#25 0x0000562d919bd0bc in UpdateWalk::UpdateDirectory (this=this@entry=0x562d9342ba50, directory=..., exclude_list=..., info=...) at src/db/update/Walk.cxx:382
        info2 = {type = StorageFileInfo::Type::DIRECTORY, size = 4, mtime = 1503679315, device = 47, inode = 147566}
        __PRETTY_FUNCTION__ = "bool UpdateWalk::UpdateDirectory(Directory&, const ExcludeList&, const StorageFileInfo&)"
        reader = std::unique_ptr<StorageDirectoryReader> containing 0x7f10600008e0
        child_exclude_list = {parent = 0x7f106d293d30, patterns = empty std::forward_list}
        name_utf8 = 0x7f106001bb00 "Shakti"
#26 0x0000562d919bda50 in UpdateWalk::Walk (this=0x562d9342ba50, root=..., path=<optimized out>, discard=<optimized out>) at src/db/update/Walk.cxx:499
        info = {type = StorageFileInfo::Type::DIRECTORY, size = 109, mtime = 1504280730, device = 47, inode = 69636}
---Type <return> to continue, or q <return> to quit---
        exclude_list = {parent = 0x0, patterns = empty std::forward_list}
#27 0x0000562d919bb5f8 in UpdateService::Task (this=0x562d933ad670) at src/db/update/Service.cxx:123
No locals.
#28 UpdateService::Task (ctx=0x562d933ad670) at src/db/update/Service.cxx:147
        service = @0x562d933ad670: {<DeferredMonitor> = {_vptr.DeferredMonitor = 0x562d91c9af48 <vtable for UpdateService+16>, loop = @0x562d933acc88, pending = false}, db = 
    @0x562d933ad1b0, storage = @0x562d933ad2d0, listener = @0x562d933acc80, modified = false, update_thread = {handle = 139708527625984, defined = true, creating = false, 
            f = 0x562d919bb590 <UpdateService::Task(void*)>, ctx = 0x562d933ad670}, static update_task_id_max = 32768, update_task_id = 1, queue = {
            static MAX_UPDATE_QUEUE_SIZE = 32, Python Exception <class 'ValueError'> Cannot find type std::__cxx11::list<UpdateQueueItem, std::allocator<UpdateQueueItem> >::_Node: 
update_queue = empty std::__cxx11::list}, next = {db = 0x562d933ad1b0, storage = 0x562d933ae2c0, path_utf8 = "", id = 1, 
            discard = true}, walk = 0x562d9342ba50}
#29 0x0000562d91a3c012 in Thread::ThreadProc (ctx=<optimized out>) at src/thread/Thread.cxx:105
        thread = <optimized out>
#30 0x00007f1086fdc049 in start_thread () from /usr/lib/libpthread.so.0
No symbol table info available.
#31 0x00007f1086d1cf0f in clone () from /usr/lib/libc.so.6
No symbol table info available.
(gdb) 

No locals  - What could be causing it?

Offline

#45 2017-09-05 10:25:42

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

I traced the fault! The problem was with an album CD I ripped. It seems there is a problem with that particular album (Shakti with John McLaughlin if anybody is interested). I suspect the album was corrupted while ripping (I use flac) and prevents database update. I removed that album from the music directory and everything is now working again.

All that fuss for such a simple problem but thanks to all who stayed with me on this thread. I learned a lot. I wish we can all share a beer together!

Offline

#46 2017-09-05 10:29:03

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

You should report this upstream (ie. to mpd) because a null string is passed to strchr. That's clearly a bug (regardless of what the read data looks like. It's "input" and needs to be secured)

Offline

#47 2017-09-05 10:46:33

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

Sorry but I don't know how to report upstream. Never done it before.

Offline

#48 2017-09-05 10:58:21

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Cannot update mpd database after upgrade

https://github.com/MusicPlayerDaemon/MPD/issues

Just open a new issue, name it like "segfault for passing a null string to strchr" and copy the backtrace there.

Offline

#49 2017-09-05 11:00:04

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] Cannot update mpd database after upgrade

MPD tracks bugs on github: https://github.com/MusicPlayerDaemon/MPD/issues/

Create a new ticket describing the crash (e.g. crash on database update/creation when malformed FLAC metadata is present). Then mention you are running arch linux, add the mpd version, the crash output and the output of "bt full", and reference this thread. Since this occurs with a malformed FLAC file, you could offer to send it on request per mail. Don't add a copyright protected music file directly to the bug.

Edit: Too slow, and what Seth proposed is shorter and should suffice. Keep my steps in mind if you want to report another bug somewhere.

Last edited by progandy (2017-09-05 11:02:41)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#50 2017-09-19 17:20:41

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,567

Re: [SOLVED] Cannot update mpd database after upgrade

Reported upstream.

Offline

Board footer

Powered by FluxBB