Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001611MPDpublic2007-11-15 21:332007-11-28 15:23
ReporterAvuton Olrich 
Assigned Toshank 
PriorityhighSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001611: Reproducable hang in MPD when waiting for a stream and changing playlist
DescriptionThis is a completely reproducible crash, the best way for reproduction is to open a stream (may only reproduce with ogg, I'm not sure) from jamendo.com, while waiting for it to start streaming (picking one that takes a while is optimal) now clear the playlist, add another song, then play (or replace as this grouped action is called in gmpc).

MPD will not be able to connect again (tried again 20 minutes later).

top says (this was after the ps auxf, the Ts turned to Ss):
29372 mpd 1 0 76904 8120 1160 S 0 0.4 0:00.02 mpd
29368 mpd 1 0 72708 7552 612 S 0 0.4 0:00.05 mpd
29367 mpd 1 0 76864 10m 1024 S 0 0.5 0:00.09 mpd

ps auxf says:
mpd 29367 0.0 0.5 76864 10460 ? S 19:19 0:00 mpd /etc/mpd-6600.conf
mpd 29368 0.0 0.3 72708 7552 ? T 19:19 0:00 \_ mpd /etc/mpd-6600.conf
mpd 29372 0.0 0.3 76904 8120 ? T 19:19 0:00 \_ mpd /etc/mpd-6600.conf

Process 29367:
ltrace says:
--- SIGSTOP (Stopped (signal)) ---

strace says (not a typo):
futex(0x2b90cfb96980, FUTEX_WAIT_PRIVATE, 2, NULL

gdb says:
#0 0x00002b90cf923cfe in __lll_lock_wait_private () from /lib/libc.so.6
#1 0x00002b90cf8c8a16 in _L_lock_4880 () from /lib/libc.so.6
#2 0x00002b90cf8c5aeb in *__GI___libc_free (mem=0xc922b0) at malloc.c:3624
#3 0x00002b90cf8dda3d in tzset_internal (always=<value optimized out>,
    explicit=<value optimized out>) at tzset.c:418
#4 0x00002b90cf8ddad7 in __tz_convert (timer=0x7fffde925838, use_localtime=1, tp=0x2b90cfb99d00)
    at tzset.c:610
#5 0x00000000004212e7 in log_date () at log.c:64
#6 0x00000000004213c9 in do_log (fp=0x2b90cfb95760, fmt=0x43a59f "main process got SIGCHLD\n",
    args=0x7fffde925890) at log.c:90
#7 0x0000000000421acc in DEBUG (fmt=0x43a59f "main process got SIGCHLD\n") at log.c:197
#8 0x000000000042b99f in chldSigHandler (signal=17) at sig_handlers.c:65
#9 <signal handler called>
#10 0x00002b90cf8c5459 in _int_free (av=0x2b90cfb96980, mem=0xc96c90) at malloc.c:4531
#11 0x00002b90cf8c5af6 in *__GI___libc_free (mem=0xc96c90) at malloc.c:3626
#12 0x000000000042c28f in freeJustSong (song=0xc96c90) at song.c:96
#13 0x0000000000428138 in clearPlaylist (fd=8) at playlist.c:211
0000014 0x0000000000411d41 in handleClear (fd=8, permission=0x2b90d05cc01c, argc=1,
    argv=0x7fffde925ec0) at command.c:380
0000015 0x0000000000413f9f in processCommandInternal (fd=8, permission=0x2b90d05cc01c,
    commandString=0x2b90d05c2270 "clear", cmdnode=0x0) at command.c:1238
#16 0x00000000004140fe in processCommand (fd=8, permission=0x2b90d05cc01c,
    commandString=0x2b90d05c2270 "clear") at command.c:1277
#17 0x000000000041df68 in processLineOfInput (interface=0x2b90d05c2010) at interface.c:358
0000018 0x000000000041e079 in processBytesRead (interface=0x2b90d05c2010, bytesRead=0)
    at interface.c:390
0000019 0x000000000041e1f5 in interfaceReadInput (interface=0x2b90d05c2010) at interface.c:428
0000020 0x000000000041e9bb in doIOForInterfaces () at interface.c:557
#21 0x00000000004235a7 in main (argc=2, argv=0x7fffde926418) at main.c:447


Process 29368:
ltrace says lots of:
select(0, 0, 0, 0, 0x7fffde923fc0) = 0

strace says lots of:
select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)

gdb says:
#0 0x00002b90cf9128e3 in __select_nocancel () from /lib/libc.so.6
#1 0x00000000004304d2 in my_usleep (usec=10000) at utils.c:71
#2 0x0000000000426bdc in playerInit () at player.c:167
#3 0x0000000000426d40 in playerPlay (fd=2, song=0xc92b90) at player.c:224
#4 0x0000000000429c4a in playPlaylistOrderNumber (fd=2, orderNum=0) at playlist.c:855
#5 0x0000000000429dd7 in playPlaylist (fd=2, song=0, stopOnError=0) at playlist.c:906
#6 0x0000000000428469 in loadPlaylistFromStateFile (fp=0xc96860, buffer=0x7fffde924230 "0",
    state=1, current=0, time=0) at playlist.c:286
#7 0x00000000004289b3 in readPlaylistState (fp=0xc96860) at playlist.c:373
#8 0x000000000042cf40 in read_state_file () at state_file.c:99
#9 0x0000000000423587 in main (argc=2, argv=0x7fffde926418) at main.c:445

This is process 29372
ltrace says lots of:
select(0, 0, 0, 0, 0x7fffde923f50) = 0

strace says lots of:
select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)

gdb says:
#0 0x00002b90cf9128e3 in __select_nocancel () from /lib/libc.so.6
#1 0x00000000004304d2 in my_usleep (usec=10000) at utils.c:71
#2 0x00000000004166c7 in decoderInit (pc=0x2b90d03b8658, cb=0x2b90d03b2000, dc=0x2b90d03bbec0)
    at decode.c:445
#3 0x0000000000417b48 in decode () at decode.c:720
#4 0x0000000000426ae1 in playerInit () at player.c:146
#5 0x0000000000426d40 in playerPlay (fd=2, song=0xc92b90) at player.c:224
#6 0x0000000000429c4a in playPlaylistOrderNumber (fd=2, orderNum=0) at playlist.c:855
#7 0x0000000000429dd7 in playPlaylist (fd=2, song=0, stopOnError=0) at playlist.c:906
#8 0x0000000000428469 in loadPlaylistFromStateFile (fp=0xc96860, buffer=0x7fffde924230 "0",
    state=1, current=0, time=0) at playlist.c:286
#9 0x00000000004289b3 in readPlaylistState (fp=0xc96860) at playlist.c:373
#10 0x000000000042cf40 in read_state_file () at state_file.c:99
#11 0x0000000000423587 in main (argc=2, argv=0x7fffde926418) at main.c:445
TagsNo tags attached.
Attached Files

- Relationships
related to 0001607closedcirrus MPD mpd crashes while trying to play stream without netconnection 
related to 0001609closedqball gmpc gmpc crashes on mpd crash due to avahi profiles. 

-  Notes
(0001756)
Avuton Olrich (administrator)
2007-11-15 21:36

To clear up my prior statements, by 'crash' I mean MPD no longer responds to clients, does not play music.
(0001761)
Avuton Olrich (administrator)
2007-11-17 19:58

Whatever's causing this bug, I suspect it has something to do with why the ogg streaming starts /so/ slowly. Any stream from jamendo that takes a while to start with MPD starts in msec in ogg123.
(0001764)
qball (administrator)
2007-11-18 11:47

reproducing this bug, I get this the same timeout (my_usleep) for 2 processes, but If I trace the 3rd I see this:

recvfrom(4, "^n\201\200\0\1\0\1\0\0\0\0\tstream1-4\7jamendo\3c"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("195.121.1.34")}, [16]) = 55
close(4) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(4, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("88.191.47.114")}, 16) = -1 EINPROGRESS (Operation now in progress)
select(5, NULL, [4], [4], {0, 0}) = 0 (Timeout)
select(5, NULL, [4], [4], {0, 0}) = 0 (Timeout)
close(4) = 0
socket(PF_NETLINK, SOCK_RAW, 0) = 4
bind(4, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(4, {sa_family=AF_NETLINK, pid=4569, groups=00000000}, [12]) = 0
time(NULL) = 1195406522
sendto(4, "\0\0\0\24\0\26\3\1G@t\272\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\0\0\0000\0\24\0\2G@t\272\0\0\21\331\2\10\200\376\0\0\0\1\0\10\0\1\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 108
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\0\0\0@\0\24\0\2G@t\272\0\0\21\331\n\200\200\376\0\0\0\1\0\24\0\1\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\0\0\0\24\0\3\0\2G@t\272\0\0\21\331\0\0\0\0\0\0\0\1\0\24\0\1\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(4) = 0
open("/etc/hosts", O_RDONLY|0x80000 /* O_??? */) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=197, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30006000
read(4, "# Do not remove the following li"..., 4096) = 197
read(4, "", 4096) = 0
close(4) = 0
munmap(0x30006000, 4096) = 0
open("/etc/hosts", O_RDONLY|0x80000 /* O_??? */) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=197, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30007000
read(4, "# Do not remove the following li"..., 4096) = 197
read(4, "", 4096) = 0
close(4) = 0
munmap(0x30007000, 4096) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("195.121.1.34")}, 28) = 0
fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
poll([{fd=4, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(4, "oW\1\0\0\1\0\0\0\0\0\0\tstream1-4\7jamendo\3c"..., 39, MSG_NOSIGNAL) = 39


This suggests that mpd is still trying to chat up jamendo.
(0001765)
qball (administrator)
2007-11-18 11:54

Further investigation shows that initHTTPConnection gets called over and over again.
think several thousand times a minute (checked!).
if you do a killall mpd, it will nicely shutdown.
(0001766)
qball (administrator)
2007-11-18 12:01

the initHTTPConnection gets called from inputStream_httpbuffer
More investigation after dinner.
(0001767)
qball (administrator)
2007-11-18 13:03

More investigations leads that the calls to the http buffer are caused by a seek request. (from inputStream_httpSeek)
(0001768)
qball (administrator)
2007-11-18 13:24

Ok, the problem seems to be that the ogg decoder tries todo a seek on the ogg stream. (It seeks to severall points in the ogg and the end. (I can get more detailed info about this using the mserver plugin of gmpc, I can easily print out the extact seek positions etc, and the retrieved data..))
Streams from f.e. jamendo do not seem to like this seeking, and it will take an awfull lot of time todo so.
If during this time the playing is stopped, the oggvorbis decoder will still try to seek. and hanging mpd.
Why it does not get correctly destroyed I don't know.
(0001769)
qball (administrator)
2007-11-18 14:12

A possible fix here: http://images.qballcow.nl/fix_canceling_ogg_stream.patch [^]
(0001801)
qball (administrator)
2007-11-28 15:23

Should be fixed in svn.

- Issue History
Date Modified Username Field Change
2007-11-15 21:33 Avuton Olrich New Issue
2007-11-15 21:33 Avuton Olrich Status new => assigned
2007-11-15 21:33 Avuton Olrich Assigned To => shank
2007-11-15 21:36 Avuton Olrich Note Added: 0001756
2007-11-15 21:36 Avuton Olrich Summary Reproducable crash in MPD when waiting for a stream and changing playlist => Reproducable hang in MPD when waiting for a stream and changing playlist
2007-11-15 21:53 Avuton Olrich Relationship added related to 0001609
2007-11-15 22:11 Avuton Olrich Relationship added related to 0001607
2007-11-17 19:58 Avuton Olrich Note Added: 0001761
2007-11-18 11:47 qball Note Added: 0001764
2007-11-18 11:47 qball Issue Monitored: qball
2007-11-18 11:54 qball Note Added: 0001765
2007-11-18 12:01 qball Note Added: 0001766
2007-11-18 13:03 qball Note Added: 0001767
2007-11-18 13:24 qball Note Added: 0001768
2007-11-18 14:12 qball Note Added: 0001769
2007-11-28 15:23 qball Status assigned => closed
2007-11-28 15:23 qball Note Added: 0001801
2007-11-28 15:23 qball Resolution open => fixed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker