11-21-2012 12:48 AM
Hi All,
I have a project where I need to link my static libraries built seperately (but using the toolchain/compiler inside BBNDK) to a sample QML BB10 application. I am relatively new to BB10 and its environment.
Although the application compiles and linkes successfully, on running the application it is segmenting under line
AbstractPane *root = qml->createRootObject<AbstractPane>();
My other static libraries have a lot of references to Standard C++ Library such as strings, streams etc. and these are found inside libstdc++.a/.so. Also some references to Expat and sockets. So I provided these library to my compilation path as following
qcc -Vgcc_ntox86 -lang-c++ -Wl,-rpath-link,/opt/bbndk/target_10_0_9_386/qnx6/x86/lib -Wl,-rpath-link,/opt/bbndk/target_10_0_9_386/qnx6/ x86/usr/lib -o o-g/MyApp o-g/.obj/main.o o-g/.obj/MyApp.o o-g/.obj/moc_MyApp.o -L/opt/bbndk/target_10_0_9_386/qnx6/x86/lib -L/opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib -L/opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/qt 4/lib -L/opt/bbndk/lib ./myStaticLib.a /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/gcc/4.6. 3/libstdc++.a /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libe xpat.so.2 /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libsocke t.so -lm -lbps -lbb -lbbcascades -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtXml -lQtGui -lQtNetwork -lQtCore
With this application compiles/links successfully however as said earlier it crashes inside createRootObject.
If i don't specify my static library (myStaticLib.a), take out any references for myStaticLib.a in the code and remove the stdc++ library, application goes ahead and the screen is displayed properly.
NOTE: myStaticLib.a is not related to the QT code in anyway. I am calling method inside myStaticLib after I have successfully initialized QT and after showing the first screen in the code.
I was able to pull out the core file from the simulator and also use it with gdb present on my build machine. Here is the output from the gdb.
root@server:/opt/bbndk#host_10_0_9_52/linux/x86/usr/bin/ntox86-gdb /home/puneet_narsapur/webrtc/ip/psl_p2pwebrtc_r283 5_x86_bb10/trunk/third_party/libjingle/source/talk /examples/BBTalk/x86/o-g/PeerConnection /home/puneet_narsapur/webrtc/ip/psl_p2pwebrtc_r283 5_x86_bb10/trunk/PeerConnection.core GNU gdb (GDB) 7.4 qnx (rev. 691) Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=i486-pc-nto-qnx6.5.0". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/puneet_narsapur/webrtc/ip/psl_p2pwebrtc_r283 5_x86_bb10/trunk/third_party/libjingle/source/talk /examples/BBTalk/x86/o-g/PeerConnection...done. [New pid 8880242 tid 1] [New pid 8880242 tid 2] [New pid 8880242 tid 3] [New pid 8880242 tid 4] [New pid 8880242 tid 5] [New pid 8880242 tid 6] [New pid 8880242 tid 7] [New pid 8880242 tid 8] [New pid 8880242 tid 9] [New pid 8880242 tid 10] [New pid 8880242 tid 11] [New pid 8880242 tid 12] [New pid 8880242 tid 13] warning: Corrupted shared library list: 0x0 != 0x86f8000 warning: Could not load shared library symbols for 15 libraries, e.g. libQtDeclarative.so.4. Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysroot"? Program terminated with signal 11, Segmentation fault. #0 0xb086709e in __free () from /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libc.so. 3 Traceback (most recent call last): File "/opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libstdc ++.so.6.0.16-gdb.py", line 59, in <module> from libstdcxx.v6.printers import register_libstdcxx_printers ImportError: No module named libstdcxx.v6.printers (gdb) bt #0 0xb086709e in __free () from /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libc.so. 3 #1 0xb0866c6b in free () from /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libc.so. 3 #2 0x08325e80 in operator delete(void*) () #3 0x08325ecc in operator delete[](void*) () #4 0x0832a69e in std::ios_base::~ios_base() () #5 0xb962fa8f in ?? () from /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb bcascades.so.1 #6 0xb963074c in ?? () from /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb bcascades.so.1 #7 0xb952d3c8 in bb::cascades::AbstractTextControl::setText(QString const&) () from /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb bcascades.so.1 #8 0xb94df30c in bb::cascades::AbstractTextControl::qt_metacall(QMe taObject::Call, int, void**) () from /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb bcascades.so.1 #9 0xb94e7762 in bb::cascades::Label::qt_metacall(QMetaObject::Call , int, void**) () from /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb bcascades.so.1 #10 0xb9e9686d in ?? () #11 0x089b6598 in ?? () #12 0x00000002 in ?? () #13 0x0000002f in ?? () #14 0x07b9a14c in ?? () Cannot access memory at address 0x89e24cc (gdb) info sharedlibrary warning: Corrupted shared library list: 0x0 != 0x86f8000 From To Syms Read Shared Object Library 0xb8638000 0xb86500ac Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libe xpat.so.2 0xb82dd000 0xb8314824 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libsocke t.so.3 0xb8203000 0xb823b8d4 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libm.so. 2 0xb825f000 0xb82bf56c Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb ps.so.3 0xb8450000 0xb848c780 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb b.so.1 0xb9400000 0xb9c5a200 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb bcascades.so.1 No libQtDeclarative.so.4 No libQtScript.so.4 No libQtSvg.so.4 No libQtSql.so.4 No libQtXmlPatterns.so.4 No libQtXml.so.4 No libQtGui.so.4 No libQtNetwork.so.4 No libQtCore.so.4 0xb8665000 0xb86d7a88 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libcpp.s o.4 0xb0837000 0xb08d7cc0 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libc.so. 3 0xb8247000 0xb825c118 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libs creen.so.1 0xb823c000 0xb824210c Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libpps.s o.1 0xb82c9000 0xb82cd0c4 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libslog2 .so.1 0xb8b44000 0xb8be11e4 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb bsystem.so.1 0xb82c2000 0xb82c7160 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb bsystemlocale.so.1 0xb82cf000 0xb82dabac Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libE GL.so.1 0xb831d000 0xb832707c Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libG LESv2.so.1 0xb8419000 0xb8425248 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libgestu res.so.1 0xb8436000 0xb844a1a0 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libimg.s o.1 0xb8aef000 0xb8b2447c Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libs trpattern.so.1 0xbacf9000 0xbae94cd0 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libw ebview.so.2 0xb8427000 0xb842f48c Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/liblgmon .so.1 0xb8493000 0xb84aa124 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libz .so.2 0xb8ab4000 0xb8adf400 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libp ng14.so.0 0xb904c000 0xb912a0c0 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libi conv.so.1 0xb8316000 0xb831b504 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libclipb oard.so.1 0xb84ab000 0xb84b2190 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libc ontext.so.1 0xb93a9000 0xb93d9774 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libn fc.so.1 0xb8243000 0xb82460d0 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libn fc_bps.so.1 0xbab17000 0xbacdcb74 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libi cui18n.so.49 0xbb800000 0xbd5c1258 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libw ebkit.so.0 0xbb01f000 0xbb498150 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libw ebkitplatform.so.0 0xbaeb5000 0xbb015644 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libi cuuc.so.49 0xbb56f000 0xbb6e57c0 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libg rskia.so.1 0xb8629000 0xb8634280 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libimfcl ient.so.1 0xb935c000 0xb939c26c Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libg oogleurl.so.0 0xb8657000 0xb8663254 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libi ntl.so.1 0xb9c6a000 0xb9cd99c8 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libcpp-n e.so.4 0xb8430000 0xb8435128 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libcount ers.so.1 0xbe800000 0xbf952988 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libi cudata.so.49 0xbaa99000 0xbaaf5bec Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libc url.so.2 0xbb526000 0xbb557960 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libf ontconfig.so.1 0xbb4e6000 0xbb51c2b4 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libjpeg. so.4 0xbb6fc000 0xbb78e4fc Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libs qlite3.so.1 0xbda11000 0xbdb342dc Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libx ml2.so.1 0xbb4a1000 0xbb4db768 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libx slt.so.2 0xbd6ae000 0xbd7273c8 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libf reetype.so.1 0xbb79b000 0xbb7d14f8 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libh arfbuzz.so.0 0xb8a99000 0xb8aa8168 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libs kia-qnx.so.0 0xb8aab000 0xb8ab1120 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libp pscache.so.1 0xb8ae7000 0xb8aed150 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libmmrnd client.so.1 0xb8ae0000 0xb8ae61bc Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libm d.so.1 0xb848d000 0xb8492120 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/liba oi.so.1 0xbb7d5000 0xbb7fb7f4 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libinput _client.so.1 0xbd628000 0xbd668138 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libhuapi .so.5 0xb8b25000 0xb8b43838 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libc amapi.so.1 0xbd5cf000 0xbd617450 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libi Type.so.1 0xbd8b1000 0xbd9179dc Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libW TLE.so.1 0xbd81e000 0xbd883b50 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libinput _utilities.so.1 0xb8be8000 0xb8bfa260 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libc ares.so.1 0xbd783000 0xbd7df6f8 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libs sl.so.2 0xbd670000 0xbd6aa5d8 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libg ssapi.so.1 0xb8328000 0xb832c084 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libs trm.so.1 0xbd954000 0xbda060a4 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libsbgse 56.so.0 0xb93de000 0xb93eb1f4 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libm media.so.1 0xb93ec000 0xb93fcaec Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libm mfilter.so.1 0xb9c5b000 0xb9c68d00 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libb z2.so.1 0xb939e000 0xb93a626c Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libhiddi .so.1 0xbdd07000 0xbdeb7764 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libc rypto.so.2 0xb9ce8000 0xb9cf13ec Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libn butil.so.1 0xbdc23000 0xbdc98498 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libk rb5.so.1 0xb9cde000 0xb9ce6310 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libh eimntlm.so.1 0xbdb37000 0xbdbca0e8 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/liba sn1.so.1 0xb8200000 0xb8202110 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libc om_err.so.1 0xbd736000 0xbd77c91c Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libh x509.so.1 0xbaa7f000 0xbaa8f5f0 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libr oken.so.1 0xbd7ec000 0xbd8140fc Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libw ind.so.1 0xb8414000 0xb84185c0 Yes (*) /opt/bbndk/target_10_0_9_386/qnx6/x86/usr/lib/libh eimbase.so.1 No libHwEGL.so No libegl_gallium.so No libHwglapi.so No libpipe_vmwgfx_drv.so 0xbdf18000 0xbe00a9b8 Yes /opt/bbndk/target_10_0_9_386/qnx6/x86/lib/libstdc+ +.so.6 No libllvmpipe_drv.so No libHwGLESv2.so (*): Shared library is missing debugging information. (gdb) q root@server:/opt/bbndk#
It seems to be crashing inside libc.so while trying to free something. There isn't any change in the QML code at all.
Even though everything seems to be compiling/linking properly, i am not able to find the reason for this crash.
I don't change the QML code at all but if I include my library and stdc++ it crashes. If i don't include my library and stdc++ it doesn't crash and everything is fine.
Can somebody please help me how to debug this issue? Am stuck in this for more than two days ![]()
Solved! Go to Solution.
11-21-2012 09:29 AM
>I don't change the QML code at all but if I include my library and stdc++ it crashes.
Do you change *any* code in your project? like calling a function from your lib or anything else?
11-23-2012 12:08 AM
Found the issue. For the other library that I was building with the BB10 NDK toolchain, I wasn't using "qcc -Vgcc_ntox86 -lang-c++". I was instead using the ntox86-g++ under the host directory. And it was missing the required compiler flags that were internally used by qcc.
After changing the compiler, application got compiled, I did not have to provide libstdc++.a for it as well, and the application ran successfully.
11-23-2012 12:09 AM
Hi,
No i did not change any code. It was a problem in the way i was using the toolchain to compile my library.
Thanks.