After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 305464 - gnome apps abort if trying to play a OOo wav file
gnome apps abort if trying to play a OOo wav file
Status: RESOLVED FIXED
Product: libgnome
Classification: Deprecated
Component: general
unspecified
Other All
: High critical
: ---
Assigned To: libgnome maintainer
libgnome maintainer
: 160172 163728 170617 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-05-25 18:57 UTC by Jeffrey Stedfast
Modified: 2005-08-04 12:27 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
a possible fix (1.77 KB, patch)
2005-05-25 19:02 UTC, Jeffrey Stedfast
none Details | Review

Description Jeffrey Stedfast 2005-05-25 18:57:15 UTC
Steps to reproduce:
If you select an OOo wav file such as $(prefix)/share/gallery/sounds/untie.wav
as a sound events file, when that event occurs, the application will "crash"
(it's actually an abort)

Stack trace:
(backtrace from evolution)

Thread 1 (Thread 1092944640 (LWP 5107))

  • #0 ??
  • #1 ??
  • #2 ??
  • #3 ??
  • #4 raise
    from /lib/tls/libc.so.6
  • #5 abort
    from /lib/tls/libc.so.6
  • #6 g_logv
    from /opt/gnome/lib/libglib-2.0.so.0
  • #7 g_log
    from /opt/gnome/lib/libglib-2.0.so.0
  • #8 g_malloc
    from /opt/gnome/lib/libglib-2.0.so.0
  • #9 gnome_sound_sample_load
    from /opt/gnome/lib/libgnome-2.so.0
  • #10 gnome_sound_play
    from /opt/gnome/lib/libgnome-2.so.0
  • #11 notify_idle_cb
    from /opt/gnome/lib/evolution/2.0/components/libevolution-mail.so
  • #12 g_idle_dispatch
    from /opt/gnome/lib/libglib-2.0.so.0
  • #13 g_main_context_dispatch
    from /opt/gnome/lib/libglib-2.0.so.0
  • #14 g_main_context_iterate
    from /opt/gnome/lib/libglib-2.0.so.0
  • #15 g_main_loop_run
    from /opt/gnome/lib/libglib-2.0.so.0
  • #16 bonobo_main
    from /opt/gnome/lib/libbonobo-2.so.0
  • #17 main

Other information:
the abort() is in gnome-sound.c:gnome_sound_sample_load_wav()

  for (;;)
    {
      if (fread (buf, 1, 4, f) &&
	  fread (&len, 4, 1, f))
	{
#ifdef WORDS_BIGENDIAN
	  SWAP_LONG (len);
#endif

	  if ((buf[0] != 'd') ||
	      (buf[1] != 'a') ||
	      (buf[2] != 't') ||
	      (buf[3] != 'a'))
	    fseek (f, len, SEEK_CUR);
	  else
	    {
	      s->data = g_malloc (len);

right here ----^

the problem is that 'len' is a massive value

the reason for this is because the value read from the file is corrupt
(presumably?), as also
seen from the error messages printed from esdplay:

esdplay /usr/lib/ooo-2.0/share/gallery/sounds/untie.wav 
Audio File Library: file missing data -- read 95442 frames, should be 1414285638
[error 5]
Audio File Library: file missing data -- read 95442 frames, should be 1414285638
[error 5]

it should be noted that I don't get this problem with ANY other wav files
downloaded from the net (did a google search for new email sound wav files) and
also tested against all the wav files included with GNOME (e.g. email.wav)
Comment 1 Jeffrey Stedfast 2005-05-25 18:58:07 UTC
while the backtrace is against Evolution, I tested the wav file against the
sound events picker window and hit the Play button and also got a crash
Comment 2 Jeffrey Stedfast 2005-05-25 19:02:21 UTC
Created attachment 46884 [details] [review]
a possible fix
Comment 3 Jeffrey Stedfast 2005-05-25 19:06:56 UTC
*** Bug 163728 has been marked as a duplicate of this bug. ***
Comment 4 Jeffrey Stedfast 2005-05-25 19:07:32 UTC
*** Bug 163728 has been marked as a duplicate of this bug. ***
Comment 5 Kjartan Maraas 2005-05-30 09:54:55 UTC
Commited this to both branches. Thanks Jeff.
Comment 6 Sebastien Bacher 2005-07-21 13:27:22 UTC
*** Bug 160172 has been marked as a duplicate of this bug. ***
Comment 7 Sebastien Bacher 2005-07-21 13:27:40 UTC
*** Bug 170617 has been marked as a duplicate of this bug. ***
Comment 8 Sebastien Bacher 2005-07-21 13:32:00 UTC
the current 2.11 versions seem to fix this crash but no sound is played
Comment 9 Kjartan Maraas 2005-08-04 11:58:34 UTC
Jeff, any idea why it could break sound output?
Comment 10 Jeffrey Stedfast 2005-08-04 12:27:30 UTC
yea, it's not playing any sound because g_try_malloc() failed and returned NULL
which makes the code hit the error case which makes no sound get played.

the only solution this this is to incrementally stream sound files to the sound
device rather than loading it completely into memory like the way the code works
now - unfortunately this is a non-trivial change and I *think* would require API
changes...