[zeromq-dev] Port of ZeroMQ to QNX 6.4

Martin Sustrik sustrik at 250bpm.com
Sat Mar 6 20:27:11 CET 2010


Hi Armin,

> OK ... the porting steps are:
> 
> - CC=qcc CXX=QCC configure --with-c --with-perf   .... if only 
> C-bindings are requested
> 
> - then add to platform.hpp:
> 
>                 #define rpl_malloc malloc
>                 #define ZMQ_FORCE_SELECT 1
> 
> That's all.

You can dith the ZMQ_FORCE_SELECT part. I've asked you to add it in just 
for debugging purposes. The macro forces 0MQ to poll using select(2). 
The default for QNX is poll(2) which is much more efficient, so you 
should leave it that way.

As for rpl_malloc, this is what I've found:

http://sources.redhat.com/ml/automake/2003-05/msg00043.html

Others may have suggestions about the issue.

> That's the backtrace for that problem:
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0xb826042f in std::ios_base::~ios_base () from /usr/qnx640/target/qnx6/x86/lib/libcpp.so.4
> (gdb) backtrace
> #0  0xb826042f in std::ios_base::~ios_base () from /usr/qnx640/target/qnx6/x86/lib/libcpp.so.4
> #1  0xb84051e6 in __tcf_3 () from /usr/qnx640/target/qnx6/x86/lib/libecpp.so.4
> #2  0xb0329445 in __cxa_finalize () from /usr/qnx640/target/qnx6/x86/lib/libc.so.3
> #3  0xb83fb624 in _btext () from /usr/qnx640/target/qnx6/x86/lib/libecpp.so.4
> #4  0xb840c149 in _fini () from /usr/qnx640/target/qnx6/x86/lib/libecpp.so.4
> #5  0xb033dae6 in fini () from /usr/qnx640/target/qnx6/x86/lib/libc.so.3
> #6  0xb033dc48 in _do_exit_fini () from /usr/qnx640/target/qnx6/x86/lib/libc.so.3
> #7  0xb03294e1 in _cleanup () from /usr/qnx640/target/qnx6/x86/lib/libc.so.3
> #8  0xb0329bd7 in exit () from /usr/qnx640/target/qnx6/x86/lib/libc.so.3
> #9  0x08048830 in _start ()
> (gdb)         

That's pretty strange. ios_base is not used anywhere in 0MQ, to be 
precise, C++ streams are not used at all.

The code seems to destroy a global instance of ios_base on exit. Maybe 
there's an instance in C++ runtime? If so, there must still remain some 
misinteraction between your libraries.

Martin



More information about the zeromq-dev mailing list