FS#41169 - [xulrunner] v30.0-1 core dump systematically at startup
Attached to Project:
Community Packages
Opened by Olivier Langlois (lano1106) - Friday, 11 July 2014, 15:38 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 04 December 2018, 16:49 GMT
Opened by Olivier Langlois (lano1106) - Friday, 11 July 2014, 15:38 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 04 December 2018, 16:49 GMT
|
Details
Description:
First I used to use the independant glue which needs a libxpcom.so file which has disapear from the firefox package which apparently is not possible anymore... As soon as the xulrunner's libxul.so library is loaded (prior to the main function to execute), the process SEGFAULT. Additional info: * package version(s): 30.0-1 * config and/or log files etc. Steps to reproduce: lano1106@hpmini ~/dev/xul_test $ cat main.cpp #include <stdio.h> int main( int argc, char *argv[] ) { printf("hello\n"); return 0; } lano1106@hpmini ~/dev/xul_test $ g++ -o test main.cpp `pkg-config --cflags --libs libxul` lano1106@hpmini ~/dev/xul_test $ ./test Segmentation fault (core dumped) |
This task depends upon
Closed by Doug Newgard (Scimmia)
Tuesday, 04 December 2018, 16:49 GMT
Reason for closing: Won't fix
Additional comments about closing: Dropped to AUR
Tuesday, 04 December 2018, 16:49 GMT
Reason for closing: Won't fix
Additional comments about closing: Dropped to AUR
lano1106@hpmini ~/dev/xul_test :( $ pacman -Ql firefox | grep libxul
firefox /usr/lib/firefox/libxul.so
lano1106@hpmini ~/dev/xul_test $ pacman -Ql xulrunner | grep libxul
xulrunner /usr/lib/pkgconfig/libxul-embedding.pc
xulrunner /usr/lib/pkgconfig/libxul.pc
xulrunner /usr/lib/xulrunner-30.0/libxul.so
xulrunner /usr/lib/xulrunner-devel-30.0/sdk/lib/libxul.so
compiling my xulrunner test, we can see that it is the xulrunner libxul.so file that is causing problem:
lano1106@hpmini ~/dev/xul_test $ ldd -r -v test | grep libxul
libxul.so => /usr/lib/xulrunner-30.0/libxul.so (0xb41d9000)
/usr/lib/xulrunner-30.0/libxul.so:
I used to use the libxul-embedding.pc file
lano1106@hpmini ~/dev/xul_test $ cat /usr/lib/pkgconfig/libxul-embedding.pc
prefix=/usr
sdkdir=/usr/lib/xulrunner-devel-30.0
includedir=/usr/include/xulrunner-30.0
idldir=/usr/share/idl/xulrunner-30.0
Name: libxul-embedding
Description: Static library for version-independent embedding of the Mozilla runtime
Version: 30.0
Requires: nspr >= 4.10.6
Libs: -L${sdkdir}/lib -lxpcomglue -ldl
Cflags: -DXPCOM_GLUE -I${includedir}
which lets your program specify which libxul.so to load dynamically but this involved code like:
const char *lPath = "/usr/lib/firefox/libxpcom.so";
std::string lXulSdkLibrary = lPath;
std::string lXulSdkDirectory = lXulSdkLibrary.substr( 0, lXulSdkLibrary.find_last_of( "/\\" ) );
std::string lApplicationDirectory = APPLICATION_DIRECTORY;
nsresult lResult = NS_OK;
lResult = XPCOMGlueStartup( lXulSdkLibrary.c_str() );
and this is not possible anymore since libxpcom.so disappeared from the firefox package (which I maybe should be opening a bug against that package BTW...)
IMHO, what I am trying to demonstrate is that somehow there seems to be a serious problem with the libxul.so bundled with xulrunner package.
From strace, it looks like libxul is checking "/usr/lib/xulrunner-30.0" instead of "/usr/lib" when trying to dynamically open dependencies like GTK. This makes me think the problem can be fixed with some LD_LIBRARY_PATH or -rpath hackery, but I haven't figured it out yet.
I've been able to reproduce his issue (segmentation fault) and from what I can see, the problem still occur when loading libxul.so from firefox.
I did compile specifying a rpath value:
[cm@arch xul_test]$ gcc -o test main.cpp -L/usr/lib/firefox -lxul -Wl,-rpath,/usr/lib/firefox
Making sure we are loading the libxul.so from firefox:
[cm@arch xul_test]$ ldd test | grep libxul
libxul.so => /usr/lib/firefox/libxul.so (0x00007fbd7be5e000)
Running it still cause the segmentation fault to occur:
[cm@arch xul_test]$ ./test
Segmentation fault
That is, the issue still occur even if I use firefox's libraries.
Any help on this would be appreciated. Maybe there is some compilation flag that must be set or anything else so that a simple application linking with libxul.so should run ?