bugGnash - The GNU Flash player - Bugs: bug #27952, --disable-media doesn't disable...

 
 

bug #27952: --disable-media doesn't disable sound, but results in assertion failures

Submitter:  Sandro Santilli <strk>
Submitted:  Thu 05 Nov 2009 09:31:25 PM UTC
   
 
Category:  build Severity:  3 - Normal
Release:  master Status:  Fixed
Privacy:  Public Assigned to:  strk
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 11 May 2016 04:16:08 PM UTC, comment #14: 

On current development version of Gnash, configuring with `--disable-media` does not result in build error, and attempts to play sounds and videos with the build now show a correct error message without any crash.

This was tested with following SWFs:

  • SWF with embeded event sound (PCM 44100 Hz 16-bit Mono, 1.0 sec)
  • SWF with embeded frame-synchronized stream sound (MP3 22050 Hz Stereo 64kbps, 10.0 sec)
  • SWF playing external event MP3 sound via `Sound.loadSound()` (MP3 44100 Hz Mono 32kbps CBR, 4.8 sec)
  • SWF playing external streaming MP3 sound loaded via `Sound.loadSound()` (MP3 44100 Hz Mono 32kbps CBR, 4.8 sec)
  • SWF with embeded frame-synchronized video (640x480 24fps FLV1 video, 22050 Hz Mono 32kbps MP3 audio, 10.0 sec)
  • SWF playing external streaming video via `NetStream.play()` (640x480 24fps 128kbps FLV1 video, 44100 Hz Mono 32kbps CBR MP3 audio, FLV container, 10.0 sec)


This bug could now be considered as fixed.

Gnash: 0.8.11dev (git c6da486 10-May-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Mon 09 May 2016 03:11:58 AM UTC, comment #13: 

Patch for 0.8.10 is available at http://savannah.gnu.org/patch/?8993#comment3
The last post has a typo in the URL (wrong comment number).

Nutchanon Wetchasit <nachanon>
Mon 09 May 2016 03:09:41 AM UTC, comment #12: 

Patch for Gnash 0.8.10 is now available too. See patch #8993 comment 3.

Gnash: 0.8.10 (patched against git)
System: Debian GNU/Linux 5.0 Lenny i386

Nutchanon Wetchasit <nachanon>
Sat 07 May 2016 03:14:10 AM UTC, comment #11: 

Patches included, see patch #8993.

After applied the patch, configuring Gnash with `--disable-media` wouldn't result in build failure. And resulting build would't crash on playing sound; proper error messages will be displayed instead.

Gnash: 0.8.11dev (patched against git 484ca4c 29-Mar-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Tue 03 May 2016 05:29:07 PM UTC, comment #10: 

I have tinkered around compilation problem on current Gnash git version, and found multiple issues that prevents Gnash from being successfully build with `--disable-media` configuration:

  • libsound's build script lacks provision to skip linking with libmedia. So it bails when there's no libmedia to link with.
  • ActionScript class `NetStream` does not exclude code correctly in absence of `USE_MEDIA` macro; causing compilation failure.
  • ActionScript class `NetStream` and `Sound` does not exclude all libmedia-related code in absence of `USE_MEDIA` macro; causing link failure in `libcore/.libs/libgnashcore.so` when there's no libmedia to link with.
  • libcore's `SoundStreamHeadTag` and `tag_loaders` module somehow uses libmedia's overloaded `ostream << audioCodecType` operator; causing link failure in `libcore/.libs/libgnashcore.so` when there's no libmedia to link with.

 
Gnash: 0.8.11dev (git 484ca4c 29-Mar-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Tue 03 May 2016 02:46:13 PM UTC, comment #9: 

This is a timeline summary of this issue as far as I have tested (in forward chronological order):


Nutchanon Wetchasit <nachanon>
Tue 03 May 2016 02:39:45 PM UTC, comment #8: 

On Gnash 0.8.9, the build process went on without error too. But as soon as Gnash run, it crashed without any output. (Tested by running `gui/gnash -vv -t 10 pcmplay.swf` from build tree)

GDB backtrace gathered from core dump:

#0  0xb6882445 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string () from /usr/lib/libstdc++.so.6
#1  0x0806f652 in boost::program_options::typed_value<std::string, char>::default_value (this=0x9c05460, v=@0x0) at /usr/include/boost/any.hpp:110
#2  0x08062937 in getSupportedOptions (p=@0xbffeec80) at gnash.cpp:441
#3  0x080653e8 in main (argc=5, argv=0xbffeef24) at gnash.cpp:98


Backtrace shows that in command line switches enumeration process, Gnash tries to tell libboost all available media handlers, as well as the default media handler to be used. As there are no media handler configured, `front()` method of the handler list (which is `std::vector`) returned `NULL`, causing null pointer dereference inside libboost code, and crashed Gnash.

Newer Gnash 0.8.10 has a provision for this; it's not crashing on this spot anymore.

Full GDB backtrace is attached as `pcmplay_gnash0.8.9.disable-media.gdb.log`. Configure options and test SWF file used is the same as previous post.

Gnash: 0.8.9 (git)
System: Debian GNU/Linux 5.0 Lenny i386


(file #37057)

Nutchanon Wetchasit <nachanon>
Tue 03 May 2016 08:10:40 AM UTC, comment #7: 

See if you can find a good spot to add the USE_MEDIA conditional.
Probably from the caller of LiveSound.

Sandro Santilli <strk>
Group Member
Tue 03 May 2016 07:49:19 AM UTC, comment #6: 

On Gnash 0.8.10, the build process went on without error, but as soon as `pcmplay.swf` issued `Sound.start()` action, Gnash crashed.

Running `gui/gnash -vv -t 10 pcmplay.swf` from build tree:

8679:1] 125 ERROR: Couldn't find pixmap file: GnashG.png

** (lt-gtk-gnash:8679): WARNING **: Couldn't find pixmap file: GnashG.png
8679:1] 126 DEBUG: gnash::GtkAggGlue::GtkAggGlue() enter
8679:1] 126 DEBUG: gnash::GtkAggGlue::GtkAggGlue() returning
8679:1] 126 DEBUG: virtual bool gnash::GtkAggGlue::init(int, char***) enter
8679:1] 126 DEBUG: virtual bool gnash::GtkAggGlue::init(int, char***) returning
8679:1] 224 DEBUG: gnash_canvas_size_allocate 219 1
8679:1] 224 DEBUG: virtual void gnash::GtkAggGlue::prepDrawingArea(GtkWidget*) enter
8679:1] 224 DEBUG: virtual void gnash::GtkAggGlue::prepDrawingArea(GtkWidget*) returning
8679:1] 224 DEBUG: virtual gnash::Renderer* gnash::GtkAggGlue::createRenderHandler() enter
8679:1] 227 DEBUG: Framebuffer pixel format is BGRA32 (little-endian host)
8679:1] 227 DEBUG: virtual gnash::Renderer* gnash::GtkAggGlue::createRenderHandler() returning
8679:1] 227 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) enter
8679:1] 227 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) returning
8679:1] 228 DEBUG: /home/window/build/gnashgit/ appended to local sandboxes
8679:1] 228 DEBUG: /home/window/build/gnashgit/pcmplay.swf appended to local sandboxes
8679:1] 228 SECURITY: Checking security of URL 'file:///home/window/build/gnashgit/pcmplay.swf'
8679:1] 228 SECURITY: Load of file /home/window/build/gnashgit/pcmplay.swf granted (under local sandbox /home/window/build/gnashgit/)
8679:1] 229 DEBUG: Movie file:///home/window/build/gnashgit/pcmplay.swf (SWF8) added to library
8679:1] 286 DEBUG: Invalid SOL safe dir /home/window/.gnash/SharedObjects: No such file or directory. Will try to create on flush/exit.
8679:1] 288 SECURITY: Extensions disabled
8679:1] 304 DEBUG: Advance interval timer set to 10 ms (~ 100 FPS)
8679:1] 305 DEBUG: Loading native class MovieClip
8679:1] 306 DEBUG: Loading native class Sound
8679:1] 312 DEBUG: Sound.start: secOff:0
Segmentation fault (core dumped)


Exerpt from GDB backtrace gathered from core dump:

Core was generated by `/home/window/build/gnashgit/gui/.libs/lt-gtk-gnash -vv -t 10 pcmplay.swf'.
Program terminated with signal 11, Segmentation fault.
[New process 8679]
#0  gnash::sound::LiveSound::createDecoder (this=0xb5123d80, mh=@0x0,
    si=@0xb5123dc0) at LiveSound.cpp:50
50            _decoder.reset(mh.createAudioDecoder(info).release());


Backtrace shows NULL pointer dereference in libsound's `LiveSound::CreateDecoder()` as it tries to call `mh.createAudioDecoder()` but the `MediaHandler mh` argument given to the function is `NULL`. My guess is because there's no media handler configured, and both `LiveSound` and its invoker (`EmbedSound`) didn't check for this possibility.

Full GDB backtrace is attached as `pcmplay_gnash0.8.10.disable-media.gdb.log`.

Configure options and test SWF file used is the same as previous post.

Gnash: 0.8.10 (git)
System: Debian GNU/Linux 5.0 Lenny i386


(file #37055)

Nutchanon Wetchasit <nachanon>
Tue 03 May 2016 06:35:23 AM UTC, comment #5: 

From additional testing, I found that the old Gnash 0.8.8 release worked
correctly when trying to play sound on the build that is configured with
`--disable-media`.

`gnash -vv -t 10 pcmplay.swf`:

Warning: unrecognized directive "showMouse" in rcfile /home/window/.gnashrc line 4
Warning: unrecognized directive "scriptsTimeout" in rcfile /home/window/.gnashrc line 34
Warning: unrecognized directive "scriptsRecursionLimit" in rcfile /home/window/.gnashrc line 35
Warning: unrecognized directive "lockScriptLimits" in rcfile /home/window/.gnashrc line 36
21751:1] 13:24:04 DEBUG: Verbose output turned on
21751:1] 13:24:04 DEBUG: No rendering flags specified, using rcfile
21751:1] 13:24:04 DEBUG: Created top level window
21751:1] 13:24:04 ERROR: Couldn't find pixmap file: GnashG.png

** (lt-gtk-gnash:21751): WARNING **: Couldn't find pixmap file: GnashG.png
21751:1] 13:24:04 DEBUG: gnash_canvas_size_allocate 219 1
21751:1] 13:24:04 DEBUG: Framebuffer pixel format is BGRA32 (little-endian host)
21751:1] 13:24:04 DEBUG: Initialized AGG buffer <0xb5c48000>, 876 bytes, 219x1, rowsize is 876 bytes
21751:1] 13:24:04 DEBUG: /home/window/build/gnashgit/ appended to local sandboxes
21751:1] 13:24:04 DEBUG: /home/window/build/gnashgit/pcmplay.swf appended to local sandboxes
21751:1] 13:24:04 SECURITY: Checking security of URL 'file:///home/window/build/gnashgit/pcmplay.swf'
21751:1] 13:24:04 SECURITY: Load of file /home/window/build/gnashgit/pcmplay.swf granted (under local sandbox /home/window/build/gnashgit/)
21751:1] 13:24:04 UNIMPLEMENTED: SWF8 is not fully supported, trying anyway but don't expect it to work
21751:1] 13:24:04 DEBUG: Movie file:///home/window/build/gnashgit/pcmplay.swf (SWF8) added to library
21751:1] 13:24:05 DEBUG: Plugins path: /usr/local/lib/gnash/plugins
21751:1] 13:24:05 SECURITY: Extensions disabled
21751:1] 13:24:05 DEBUG: Player Host FD #-1, Player Control FD #-1
21751:1] 13:24:05 DEBUG: Advance interval timer set to 10 ms (~ 100 FPS)
21751:1] 13:24:05 DEBUG: Loading native class MovieClip
21751:1] 13:24:05 DEBUG: Loading native class Sound
21751:1] 13:24:05 DEBUG: Sound.start: secOff:0
21751:1] 13:24:05 ERROR: AudioDecoder initialization failed: MediaHandlerGst::createAudioDecoder: AudioDecoderGst: cannot handle codec 3 (Uncompressed) -- MediaHandler::createFlashAudioDecoder: no available FLASH decoders for codec 3 (Uncompressed)
21751:1] 13:24:05 DEBUG: Global instance list grew to 1 entries
21751:1] 13:24:05 DEBUG: Starting virtual clock
21751:1] 13:24:05 DEBUG: gnash_canvas_size_allocate 320 240
21751:1] 13:24:05 DEBUG: Initialized AGG buffer <0xb4ab8000>, 307200 bytes, 320x240, rowsize is 1280 bytes
21751:1] 13:24:06 DEBUG: Loading native class Mouse
21751:1] 13:24:06 DEBUG: Loading native class AsBroadcaster
21751:1] 13:24:15 DEBUG: void gnash::Gui::quit()
21751:1] 13:24:15 DEBUG: Main loop ended, cleaning up
21751:1] 13:24:15 DEBUG: Any segfault past this message is likely due to improper threads cleanup.
21751:1] 13:24:15 DEBUG: ~Player - _movieDef refcount: 2 (1 will be dropped now)
21751:1] 13:24:15 DEBUG: ~Gui - _movieDef refcount: 1


You'd see from above output that there is a message indicating
that corresponding media handler is not available:

ERROR: AudioDecoder initialization failed: MediaHandlerGst::createAudioDecoder: AudioDecoderGst: cannot handle codec 3 (Uncompressed) -- MediaHandler::createFlashAudioDecoder: no available FLASH decoders for codec 3 (Uncompressed)


Note:

  • Test SWF I used is `pcmplay.swf` (ActionScript playing 1.0-sec PCM 44100 Hz 16-bit Mono event sound) from file #34599 (bug #45722).
  • Configure command I used is `./configure --disable-testsuite --enable-gui=gtk --enable-renderer=agg --disable-media`


Gnash: 0.8.8 (git)
System: Debian GNU/Linux 5.0 Lenny i386

Nutchanon Wetchasit <nachanon>
Mon 02 May 2016 03:12:13 AM UTC, comment #4: 

It turned out that old Gnash 0.8.10 does not have the compilation problem.
(But it crashes if it tries to play audio)

I have done git bisect test on `--disable-media` compilation failure problem
(484ca4c bad -> 0.8.10 good), and it got quite messy as there were several
different compilation and autogen error around that time.

The bisect test narrows the cause of compilation failure to these
five consecutive commits (from last to first):


I'm not sure how to narrow them further, since all of them seems to be
closely related, and they all failed in autogen script (except the top one).

System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Wed 27 Apr 2016 05:27:03 AM UTC, comment #3: 

On current git version, configuring Gnash with `--disable-media` option
causes the build process to fail.


.
.
.
make[2]: Leaving directory `/home/window/prog/gnash.git/libbase'
Making all in libsound
make[2]: Entering directory `/home/window/prog/gnash.git/libsound'
  CXX    libgnashsound_la-EmbedSound.lo
  CXX    libgnashsound_la-StreamingSoundData.lo
  CXX    libgnashsound_la-StreamingSound.lo
  CXX    libgnashsound_la-LiveSound.lo
  CXX    libgnashsound_la-EmbedSoundInst.lo
  CXX    libgnashsound_la-sound_handler.lo
  CXX    libgnashsound_la-WAVWriter.lo
  CXX    libgnashsound_la-sound_handler_sdl.lo
make[2]: *** No rule to make target `../libmedia/libgnashmedia.la', needed by `libgnashsound.la'.  Stop.
make[2]: Leaving directory `/home/window/prog/gnash.git/libsound'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/window/prog/gnash.git'
make: *** [all] Error 2


The configure command I used was a plain `./configure --disable-media`.
Configuration and build logs are attached as `configure-disable-media.484ca4c.zip`.

Gnash: 0.8.11dev (git 484ca4c 29-Mar-2016)
System: Debian GNU/Linux 7.0 Wheezy i386


(file #37002)

Nutchanon Wetchasit <nachanon>
Mon 08 Nov 2010 07:23:23 PM UTC, comment #2: 

It's a configure switch

Sandro Santilli <strk>
Group Member
Mon 08 Nov 2010 06:17:01 PM UTC, comment #1: 

that is an option for Gnash or when compiling?

-X- <maximi89>
Thu 05 Nov 2009 09:31:25 PM UTC, original submission:  

When media are disabled but sound is not there's an assertion
failure whenever sound is attempted to be used.


Sandro Santilli <strk>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #37057:  pcmplay_gnash0.8.9.disable-media.gdb.log added by nachanon (19KiB - text/x-log - GDB backtrace from Gnash 0.8.9 (with `--disable-media` build flag) playing `pcmplay.swf`)
file #37055:  pcmplay_gnash0.8.10.disable-media.gdb.log added by nachanon (111KiB - application/octet-stream - GDB backtrace from Gnash 0.8.10 (with `--disable-media` build flag) playing `pcmplay.swf`)
file #37002:  configure-disable-media.484ca4c.zip added by nachanon (22KiB - application/x-zip-compressed - Configuration an build logs from Gnash 0.8.11dev git 484ca4c with `--disable-media`)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nachanon (Updated the item)
  • -email is unavailable- added by maximi89 (Posted a comment)
  • -email is unavailable- added by strk (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-11 strk CategoryNone build
        ReleaseNone master
        StatusNone Fixed
        Assigned toNone strk
        Open/ClosedOpen Closed
    2016-05-03 nachanon Attached File- Added pcmplay_gnash0.8.9.disable-media.gdb.log, #37057
    2016-05-03 nachanon Attached File- Added pcmplay_gnash0.8.10.disable-media.gdb.log, #37055
    2016-04-27 nachanon Attached File- Added configure-disable-media.484ca4c.zip, #37002

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code