Discussion:
[Gnash-commit] [bug #27952] --disable-media doesn't disable sound, but results in assertion failures
Nutchanon Wetchasit
2016-04-27 05:27:03 UTC
Permalink
Follow-up Comment #3, bug #27952 (project gnash):

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)
_______________________________________________________

Additional Item Attachment:

File name: configure-disable-media.484ca4c.zip Size:21 KB


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-02 03:12:14 UTC
Permalink
Follow-up Comment #4, bug #27952 (project gnash):

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):

* 7617e40d1b6f8266667cb72920a4fc1bd60b6d61 add CROSS_CXXFLAGS and
CROSS_LDFLAGS, add defines for when sound or media is disabled.
<http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=7617e40d1b6f8266667cb72920a4fc1bd60b6d61>
* b74f2bf8dad36977e27b4711192754d94cdac752 use CROSS_* flags, make libmedia
and libsound optional.
<http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=b74f2bf8dad36977e27b4711192754d94cdac752>
* 5185de95b6d2226b8aeaec27968f5565dc9fe052 make using libsound and libmedia
optonal.
<http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=5185de95b6d2226b8aeaec27968f5565dc9fe052>
* 5d86eec7b74a5c6710b6e1f886a857478ee402eb make linking libsound and libmedia
optional, add CROSS_* flags.
<http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=5d86eec7b74a5c6710b6e1f886a857478ee402eb>
* 2a8924cb515ba415190522d336eea1c8792c00f4 make building NetStream and Sounds
classes optional, so Gnash builds when there is no libsound or libmedia.
<http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=2a8924cb515ba415190522d336eea1c8792c00f4>

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


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-03 06:35:23 UTC
Permalink
Follow-up Comment #5, bug #27952 (project gnash):

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


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-03 07:49:19 UTC
Permalink
Follow-up Comment #6, bug #27952 (project gnash):

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()`
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libsound/LiveSound.cpp?id=0.8.10#n50>
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)
_______________________________________________________

Additional Item Attachment:

File name: pcmplay_gnash0.8.10.disable-media.gdb.log Size:111 KB


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Sandro Santilli
2016-05-03 08:10:40 UTC
Permalink
Follow-up Comment #7, bug #27952 (project gnash):

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

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-03 14:39:45 UTC
Permalink
Follow-up Comment #8, bug #27952 (project gnash):

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
<http://git.savannah.gnu.org/cgit/gnash.git/tree/gui/gnash.cpp?id=release_0_8_9_final#n377>,
as well as _the default media handler_ to be used
<http://git.savannah.gnu.org/cgit/gnash.git/tree/gui/gnash.cpp?id=release_0_8_9_final#n378>.
As there are no media handler configured, `front()` method of the handler list
(which is `std::vector`
<http://git.savannah.gnu.org/cgit/gnash.git/tree/gui/gnash.cpp?id=release_0_8_9_final#n303>)
returned `NULL`, causing null pointer dereference inside libboost code, and
crashed Gnash.

Newer Gnash 0.8.10 has a provision for this
<http://git.savannah.gnu.org/cgit/gnash.git/tree/gui/gnash.cpp?id=0.8.10#n389>;
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)
_______________________________________________________

Additional Item Attachment:

File name: pcmplay_gnash0.8.9.disable-media.gdb.log Size:19 KB


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-03 14:46:13 UTC
Permalink
Follow-up Comment #9, bug #27952 (project gnash):

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

* Gnash 0.8.8: `--disable-media` worked correctly.
<https://savannah.gnu.org/bugs/?27952#comment5>
* Gnash 0.8.9: `--disable-media` caused Gnash to crash at the start.
<https://savannah.gnu.org/bugs/?27952#comment8>
* Gnash 0.8.10: `--disable-media` caused Gnash to crash when trying to play
sound. <https://savannah.gnu.org/bugs/?27952#comment6>
* Gnash 0.8.11dev (git 484ca4c 29-Mar-2016): `--disable-media` caused Gnash
build process to fail. <https://savannah.gnu.org/bugs/?27952#comment3>


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-03 17:29:07 UTC
Permalink
Follow-up Comment #10, bug #27952 (project gnash):

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
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libsound/Makefile.am?id=484ca4cd2fecb73c3308fd451004f6cc2e976fbe#n77>.
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
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libcore/asobj/NetStream_as.cpp?id=484ca4cd2fecb73c3308fd451004f6cc2e976fbe#n716>.
* ActionScript class `NetStream` and `Sound`
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libcore/asobj/Sound_as.cpp?id=484ca4cd2fecb73c3308fd451004f6cc2e976fbe>
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`
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libcore/swf/SoundStreamHeadTag.cpp?id=484ca4cd2fecb73c3308fd451004f6cc2e976fbe>
and `tag_loaders`
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libcore/swf/tag_loaders.cpp?id=484ca4cd2fecb73c3308fd451004f6cc2e976fbe>
module _somehow_ uses libmedia's overloaded `ostream << audioCodecType`
operator
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libmedia/MediaParser.h?id=484ca4cd2fecb73c3308fd451004f6cc2e976fbe#n193>;
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


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-09 03:09:41 UTC
Permalink
Follow-up Comment #12, bug #27952 (project gnash):

Patch for Gnash 0.8.10 is now available too. See patch #8993 comment 3
<http://savannah.gnu.org/patch/?8993#comment2>.

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


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-09 03:11:58 UTC
Permalink
Follow-up Comment #13, bug #27952 (project gnash):

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).


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Nutchanon Wetchasit
2016-05-11 16:16:09 UTC
Permalink
Follow-up Comment #14, bug #27952 (project gnash):

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


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Sandro Santilli
2016-05-11 18:24:50 UTC
Permalink
Update of bug #27952 (project gnash):

Category: None => build
Release: None => master
Status: None => Fixed
Assigned to: None => strk
Open/Closed: Open => Closed


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?27952>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/

Loading...