GNOME Bugzilla – Bug 337415
esd hangs when pausing a gstreamer-0.10 based sound
Last modified: 2007-04-23 08:50:06 UTC
1.- run esd 2.- open totem or muine 3.- play a song 4.- stop it 5.- play it again (sam) then daemon hang on:
+ Trace 67493
and this make all player hang.
Created attachment 62815 [details] [review] Patch fixing esd when client send a packet lower than buffer size
Comment on attachment 62815 [details] [review] Patch fixing esd when client send a packet lower than buffer size >+ if (bytes_read < player->buffer_length - player->actual_length) >+ break; Well, maybe this check should be after the checking for the end of stream or just returning, I haven't read corde beyond than the obvious read hand.
*** Bug 335116 has been marked as a duplicate of this bug. ***
Looks good. Applied.
reopening, this patch is causing 100% cpu usage, as explained on http://qa.mandriva.com/show_bug.cgi?id=24365 To duplicate : -start mozilla-thunderbird -go to Edit/Preferences/General/When a new message arrive / Advanced - choose a wav file -press preview several times => esd will take 100% cpu
YEs, that is as comment #2 says, because the added check should be after checking the EOF: diff -u -u -r1.48 players.c --- players.c 8 Aug 2006 02:03:18 -0000 1.48 +++ players.c 22 Aug 2006 14:47:22 -0000 @@ -310,9 +310,6 @@ player->data_buffer + player->actual_length, player->buffer_length - player->actual_length, actual, "str rd" ); - if (bytes_read < player->buffer_length - player->actual_length) - break; - /* check for end of stream */ if ( actual == 0 || ( actual < 0 && errno != EAGAIN && errno != EINTR ) ) @@ -320,6 +317,9 @@ /* more data, save how much we got */ if ( actual > 0 ) player->actual_length += actual; + + if (bytes_read < player->buffer_length - player->actual_length) + break; } while (player->actual_length < player->buffer_length); /* endian swap multi-byte data if we need to */
Well, not I'm 100% lost. Looking at the reading loop code: do { bytes_read = ESD_READ_BIN( player->source_id, player->data_buffer + player->actual_length, player->buffer_length - player->actual_length, actual, "str rd" ); if (bytes_read < player->buffer_length - player->actual_length) break; /* check for end of stream */ if ( actual == 0 || ( actual < 0 && errno != EAGAIN && errno != EINTR ) ) return -1; /* more data, save how much we got */ if ( actual > 0 ) player->actual_length += actual; } while (player->actual_length < player->buffer_length); actual is used everywhere, but ESD_READ_BIN is defined as: #define ESD_READ_BIN(s,a,l,r,d) r = read( s, a, l ) so this actual value is never filled!. I wonder how can this works.
ok, r = read please forget my last comment, should be my backpain.
Any news on this Fernando?
Yeah, same patch as comment #6 was applied after bug #412951, closing as fixed.