Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - libstdc++ and qt with Qnx 6.5.0 tools (gcc 4.4.2): (2 Items)
   
libstdc++ and qt with Qnx 6.5.0 tools (gcc 4.4.2)  
Hiya,

I'm trying to do some dev for the playbook using ndk 2.0.1 that rim released awhile ago. It provides libstdc++ along 
with gcc 4.4.2 based tools. I'm also using qt for my application. The problem I'm having is that qt and libstdc++ seem 
to work fine independently, but when I link to both of them in the same application, I get a segmentation fault. Note 
that I don't need to actually use any Qt code, just linking it in is enough to cause a crash.

Here's a sample application:

#include <iostream>
#include <sstream>
int main(int argc, char *argv[])
{
    std::cout << "This doesn't work\n";
    return 0;   // i think it crashes here when the os tries to do cleanup
}

Here's the stack trace from the crash:

#0  0xb8b5e329 in __gnu_cxx::__exchange_and_add (__mem=0x0, __val=-1)
    at atomicity.cc:36
36	atomicity.cc: No such file or directory.
	in atomicity.cc

(gdb) backtrace

#0  0xb8b5e329 in __gnu_cxx::__exchange_and_add (__mem=0x0, __val=-1)
    at atomicity.cc:36

#1  0xb8b03471 in __exchange_and_add_dispatch (__val=<optimized out>, 
    __mem=<optimized out>)
    at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/ext/
atomicity.h:79

#2  _M_remove_reference (this=<optimized out>)
    at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/bits/
locale_classes.h:505

#3  std::locale::~locale (this=0xb837d5fc, __in_chrg=<optimized out>)
    at ../../../../../libstdc++-v3/src/locale.cc:89

#4  0xb8b0faa9 in ~basic_streambuf (this=<optimized out>, 
    __in_chrg=<optimized out>)
    at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/streambuf:
193

#5  std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf (
    this=0xb837d5e0, __in_chrg=<optimized out>)
    at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/fstream:215


#6  0xb0bbd205 in __cxa_finalize ()
   from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3

#7  0xb832de67 in _btext ()
   from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libcpp.so.4

#8  0xb836a265 in _fini ()
   from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libcpp.so.4

#9  0xb0bd46d3 in ?? ()
   from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3

#10 0xb0bd5d38 in ?? ()
   from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3

#11 0xb0bbd052 in _cleanup ()
   from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3

#12 0xb0bbd337 in exit ()
   from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3

#13 0x080487b0 in _start ()

I'd appreciate any feedback or advice.
Re: libstdc++ and qt with Qnx 6.5.0 tools (gcc 4.4.2)  
This is a known bug. We are working on a fix, and I would be more than glad to keep you posted on the progress. Stay 
tuned here, or feel free to join us at #qt-qnx on freenode.

Cheers,
Rafael