Mon 19 Oct 2009 09:23:47 AM UTC, original submission:
Description:
When gnash is run with any Flash application, gnash seg-faults. But if lirc.so (the only extension in its directory) is renamed in the /mydir/lib/gnash/plugins dir to lirc.so.ok, it works fine.
A few debug prints have been added in the source of extension.cpp (given below).
The verbose output has also been pasted below, alongwith gdb backtrace.
Compilation: Cross (GNU GCC)
CPU: ARM
Build on: Intel Dual Core 2.0 GHz PC
Build OS: Linux - ubuntu 9.04
Target OS: Linux - Debian lenny/sid
Gnash Build options 0.8.6
Target:
Renderer: cairo - GUI: GTK - Media handler: gst
Configured with: --prefix=/mydir --host=arm-linux-gnueabi --build=i686-pc-linux-gnu --target=arm-linux-gnueabi --enable-gui=gtk --enable-extensions=lirc -enable-lirc --with-gif-incl=/usr/arm-linux-gnueabi/include --with-gif-lib=/usr/arm-linux-gnueabi/lib --with-ungif-incl=/usr/arm-linux-gnueabi/include --with-ungif-lib=/usr/arm-linux-gnueabi/lib --enable-renderer=cairo --enable-media=GST -with-gstreamer-incl=/mydir/wtv-gstreamer/build/include/gstreamer-0.10/ --with-gstreamer-lib=/mydir/wtv-gstreamer/build/lib/ --with-png-incl=/usr/arm-linux-gnueabi/include/libpng/ --with-png-lib=/usr/arm-linux-gnueabi/lib/ --with-libxml2-incl=/usr/arm-linux-gnueabi/include/libxml2/ --with-cairo-incl=/usr/arm-linux-gnueabi/include/cairo/ --with-cairo-lib=/usr/arm-linux-gnueabi/lib/ --with-atk-incl=/usr/arm-linux-gnueabi/include/atk-1.0/ --with-atk-lib=/usr/arm-linux-gnueabi/lib/
CXXFLAGS: -I/usr/arm-linux-gnueabi/include/ -O2 -pthread -pthread -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -Wnon-virtual-dtor -Wunused -pthread -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -Wnon-virtual-dtor -Wunused -fvisibility-inlines-hidden
Version: .:
Built against gstreamer version: 0.10.22
Linked against gstreamer version: 0.10.22
--------------------------------------------------------
# gnash --fullscreen -r 1 -vvv file.swf
1653:1] 01:46:24 DEBUG: Verbose output turned on
1653:1] 01:46:24 DEBUG: Verbose output turned on
1653:1] 01:46:24 DEBUG: Created top level window
1653:1] 01:46:24 ERROR: Couldn't find pixmap file: GnashG.png
- (gtk-gnash:1653): WARNING **: Couldn't find pixmap file: GnashG.png
1653:1] 01:46:24 DEBUG: GtkWidget* gnash_canvas_new() enter
1653:1] 01:46:24 DEBUG: void gnash_canvas_class_init(GnashCanvasClass*) enter
1653:1] 01:46:24 DEBUG: void gnash_canvas_class_init(GnashCanvasClass*) returning
1653:1] 01:46:24 DEBUG: void gnash_canvas_init(GnashCanvas*) enter
1653:1] 01:46:24 DEBUG: void gnash_canvas_init(GnashCanvas*) returning
1653:1] 01:46:24 DEBUG: GtkWidget* gnash_canvas_new() returning
1653:1] 01:46:24 DEBUG: void gnash_canvas_setup(GnashCanvas, int, char**) enter
1653:1] 01:46:24 DEBUG: void gnash_canvas_setup(GnashCanvas, int, char**) returning
1653:1] 01:46:24 DEBUG: void gnash::GtkGui::createQualityMenu(GtkWidget*) enter
1653:1] 01:46:24 ERROR: Gui::getQuality called before a movie_root was available
1653:1] 01:46:24 DEBUG: void gnash::GtkGui::createQualityMenu(GtkWidget*) returning
1653:1] 01:46:25 DEBUG: void gnash::GtkGui::createQualityMenu(GtkWidget*) enter
1653:1] 01:46:25 ERROR: Gui::getQuality called before a movie_root was available
1653:1] 01:46:25 DEBUG: void gnash::GtkGui::createQualityMenu(GtkWidget*) returning
1653:1] 01:46:25 DEBUG: void gnash_canvas_size_allocate(GtkWidget, GtkAllocation) enter
1653:1] 01:46:25 DEBUG: gnash_canvas_size_allocate 223 1
1653:1] 01:46:25 DEBUG: void gnash_canvas_size_allocate(GtkWidget, GtkAllocation) returning
1653:1] 01:46:25 DEBUG: void gnash_canvas_realize(GtkWidget*) enter
1653:1] 01:46:25 DEBUG: void gnash_canvas_realize(GtkWidget*) returning
1653:1] 01:46:25 DEBUG: void gnash_canvas_after_realize(GtkWidget*) enter
1653:1] 01:46:25 DEBUG: void gnash_canvas_after_realize(GtkWidget*) returning
1653:1] 01:46:25 DEBUG: socket name /dev/lircd for fd 4
1653:1] 01:46:25 DEBUG: /root/ appended to local sandboxes
1653:1] 01:46:25 DEBUG: /root/file.swf appended to local sandboxes
1653:1] 01:46:25 SECURITY: Checking security of URL 'file:///root/file.swf'
1653:1] 01:46:25 SECURITY: Load of file /root/file.swf granted (under local sandbox /root/)
1653:1] 01:46:25 DEBUG: Movie file:///root/file.swf (SWF4) added to library
1653:1] 01:46:25 DEBUG: gnash::SharedObjectLibrary::SharedObjectLibrary(gnash::VM&) enter
1653:1] 01:46:25 DEBUG: Invalid SOL safe dir /root/.gnash/SharedObjects: No such file or directory. Will try to create on flush/exit.
1653:1] 01:46:25 DEBUG: gnash::SharedObjectLibrary::SharedObjectLibrary(gnash::VM&) returning
1653:1] 01:46:25 DEBUG: Plugins path: /mydir/lib/gnash/plugins
1653:1] 01:46:25 SECURITY: Extensions enabled, scanning plugin dir for load
1653:1] 01:46:25 DEBUG: bool gnash::Extension::scanDir(const std::string&) enter
1653:1] 01:46:25 DEBUG: Scanning directory "/mydir/lib/gnash/plugins" for plugins
1653:1] 01:46:25 DEBUG: Gnash Plugin name: lirc
1653:1] 01:46:25 DEBUG: bool gnash::Extension::scanDir(const std::string&) returning
1653:1] 01:46:25 SECURITY: Loading module: lirc from /mydir/lib/gnash/plugins
1653:1] 01:46:25 DEBUG: .....................1
1653:1] 01:46:25 DEBUG: bool gnash::Extension::initModule(const std::string&, gnash::as_object&) enter
1653:1] 01:46:25 DEBUG: .....................2
1653:1] 01:46:25 DEBUG: .....................3
1653:1] 01:46:25 DEBUG: .....................4
1653:1] 01:46:25 DEBUG: gnash::SharedLib::SharedLib(const std::string&, const std::string&) enter
1653:1] 01:46:25 DEBUG: gnash::SharedLib::SharedLib(const std::string&, const std::string&) returning
1653:1] 01:46:25 DEBUG: .....................5
1653:1] 01:46:25 DEBUG: Opened dynamic library "lirc"
1653:1] 01:46:25 DEBUG: .....................6
1653:1] 01:46:25 DEBUG: .....................7
1653:1] 01:46:25 DEBUG: .....................10
1653:1] 01:46:25 DEBUG: .....................11
1653:1] 01:46:25 DEBUG: void (* gnash::SharedLib::getInitEntry(const std::string&))(gnash::as_object&) enter
1653:1] 01:46:25 DEBUG: Found symbol lirc_class_init @ 0x41d9ad4c
1653:1] 01:46:25 DEBUG: void (* gnash::SharedLib::getInitEntry(const std::string&))(gnash::as_object&) returning
1653:1] 01:46:25 DEBUG: .....................12
1653:1] 01:46:25 DEBUG: .....................13
Segmentation fault
--------------------------------------------------------
=========================================
GDB Backtrace:
=========================================
(gdb) bt
#0 0x4021be08 in gnash::as_value::set_as_object () from /mydir/lib/gnash/libgnashcore-0.8.6.so
#1 0x4021bee8 in gnash::as_value::as_value () from /mydir/lib/gnash/libgnashcore-0.8.6.so
#2 0x41d9ad90 in lirc_class_init () from /mydir/lib/gnash/plugins/lirc.so
#3 0x40673a28 in gnash::Extension::initModule () from /mydir/lib/gnash/libgnashbase-0.8.6.so
#4 0x40675478 in gnash::Extension::scanAndLoad () from /mydir/lib/gnash/libgnashbase-0.8.6.so
#5 0x4032cf20 in gnash::AVM1Global::loadExtensions () from /mydir/lib/gnash/libgnashcore-0.8.6.so
#6 0x4032de70 in gnash::AVM1Global::registerClasses () from /mydir/lib/gnash/libgnashcore-0.8.6.so
#7 0x404b413c in gnash::VM::init () from /mydir/lib/gnash/libgnashcore-0.8.6.so
#8 0x40275c18 in gnash::movie_root::movie_root () from /mydir/lib/gnash/libgnashcore-0.8.6.so
#9 0x00035868 in gnash::Player::run ()
#10 0x0001cd14 in main ()
(gdb)
--------------------------------------------------------
========================================
Changes done in source of extension.cpp:
========================================
bool
Extension::scanAndLoad(as_object& where)
{
// GNASH_REPORT_FUNCTION;
if (_modules.empty()) {
scanDir(_pluginsdir);
}
std::vector<std::string>::iterator it;
for (it = _modules.begin(); it != _modules.end(); it++) {
const std::string& mod = *it;
log_security(_("Loading module: %s from %s"), mod, _pluginsdir);
log_debug(".....................1");
initModule(mod, where);
log_debug(".....................16");
}
return true;
}
bool
Extension::initModule(const std::string& module, as_object &where)
{
GNASH_REPORT_FUNCTION;
log_debug(".....................2");
SharedLib *sl;
std::string symbol(module);
log_debug(".....................3");
///std::cout << "...............symbol: " << symbol << "\n";
///std::cout << "..............._pluginsdir: " << _pluginsdir << "\n";
///log_security(_("Initializing module: \"%s\" from %"), symbol, _pluginsdir);
if (_plugins[module] == 0) {
log_debug(".....................4");
sl = new SharedLib(module, "GNASH_PLUGINS");
log_debug(".....................5");
sl->openLib();
log_debug(".....................6");
_plugins[module] = sl;
log_debug(".....................7");
} else {
log_debug(".....................8");
sl = _plugins[module];
log_debug(".....................9");
}
log_debug(".....................10");
symbol.append("_class_init");
log_debug(".....................11");
SharedLib::initentry *symptr = sl->getInitEntry(symbol);
log_debug(".....................12");
if (symptr) {
log_debug(".....................13");
symptr(where);
log_debug(".....................14");
} else {
log_error(_("Couldn't get class_init symbol"));
}
log_debug(".....................15");
return true;
}
|