You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by serega <se...@sap.com> on 2014/01/27 21:43:49 UTC

Qpid Proton messenger on 32 bit linux

Does the messenger work on 32 bit linux? I build the 32 bit messenger by
setting the variable 
export CFLAGS=-m32

The same code that works on 64 bit linux crates on 32.  It always crashes in
pn_encoder_writef8
Here is the crash stack trace from a core dump

Core was generated by `./testconsumer 10.250.0.126 10.250.0.127 10000000'.
Program terminated with signal 11, Segmentation fault.
#0  0x00d89877 in pn_encoder_writef8 () from
/usr/local/lib/libqpid-proton.so.2
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.80.el6_3.7.i686 libuuid-2.17.2-12.7.el6_3.i686
(gdb) bt
#0  0x00d89877 in pn_encoder_writef8 () from
/usr/local/lib/libqpid-proton.so.2
#1  0x00d89d4c in pni_encoder_enter () from
/usr/local/lib/libqpid-proton.so.2
#2  0x00d85d66 in pni_data_traverse () from
/usr/local/lib/libqpid-proton.so.2
#3  0x00d8a6e5 in pn_encoder_encode () from
/usr/local/lib/libqpid-proton.so.2
#4  0x00d863ec in pn_data_encode () from /usr/local/lib/libqpid-proton.so.2
#5  0x00d8af95 in pn_post_frame () from /usr/local/lib/libqpid-proton.so.2
#6  0x00d930f7 in pn_flush_disp () from /usr/local/lib/libqpid-proton.so.2
#7  0x00d93971 in pn_process_flush_disp () from
/usr/local/lib/libqpid-proton.so.2
#8  0x00d93f94 in pn_phase () from /usr/local/lib/libqpid-proton.so.2
#9  0x00d940c0 in pn_process () from /usr/local/lib/libqpid-proton.so.2
#10 0x00d942e2 in pn_output_write_amqp () from
/usr/local/lib/libqpid-proton.so.2
#11 0x00d94a28 in pn_io_layer_output_passthru () from
/usr/local/lib/libqpid-proton.so.2
#12 0x00d94a28 in pn_io_layer_output_passthru () from
/usr/local/lib/libqpid-proton.so.2
#13 0x00d944cd in transport_produce () from
/usr/local/lib/libqpid-proton.so.2
#14 0x00d94de7 in pn_transport_pending () from
/usr/local/lib/libqpid-proton.so.2
#15 0x00da0726 in pn_connector_process () from
/usr/local/lib/libqpid-proton.so.2
#16 0x00d9b1bf in pn_messenger_tsync () from
/usr/local/lib/libqpid-proton.so.2
#17 0x00d9b503 in pn_messenger_sync () from
/usr/local/lib/libqpid-proton.so.2
#18 0x00d9d279 in pn_messenger_recv () from
/usr/local/lib/libqpid-proton.so.2
#19 0x0065f10c in run_consumer (args=0x8dc7198) at messageconsumer.c:104
#20 0x0050fa49 in start_thread () from /lib/libpthread.so.0
#21 0x0035863e in clone () from /lib/libc.so.6
(gdb) 




--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Re: Qpid Proton messenger on 32 bit linux

Posted by serega <se...@sap.com>.
Do I need to pass any special arguments to cmake or change CMakeLists.txt
that may affect Messanger?



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7603477.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Re: Qpid Proton messenger on 32 bit linux

Posted by serega <se...@sap.com>.
I tried that option and it still crashes.

Sergey



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7603614.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Re: Qpid Proton messenger on 32 bit linux

Posted by Ted Ross <tr...@redhat.com>.
I haven't had a change to try it yet.

I think we typically use "-m32 -march=i686"

-Ted

On 01/29/2014 09:56 AM, serega wrote:
> The attached example is a  send.c
> <http://qpid.2158936.n2.nabble.com/file/n7603555/send.c>   slightly modified
> send.c example. It works in 64 bit environment, but crashes when proton is
> build with export CFLAGS=-m32  . Can you execute it on 32 bit linux?
>
> Thanks,
> Sergey.
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7603555.html
> Sent from the Apache Qpid Proton mailing list archive at Nabble.com.


Re: Qpid Proton messenger on 32 bit linux

Posted by serega <se...@sap.com>.
The attached example is a  send.c
<http://qpid.2158936.n2.nabble.com/file/n7603555/send.c>   slightly modified
send.c example. It works in 64 bit environment, but crashes when proton is
build with export CFLAGS=-m32  . Can you execute it on 32 bit linux? 

Thanks,
Sergey.



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7603555.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Re: Qpid Proton messenger on 32 bit linux

Posted by serega <se...@sap.com>.
I am building on 64 bit RedHat 6.3 that has required 32 bit libraries. It
happens when initiated from both pn_messenger_recv() and
pn_messenger_send().



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7603475.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Re: Qpid Proton messenger on 32 bit linux

Posted by Ted Ross <tr...@redhat.com>.
I routinely run tests using Messenger in a 32-bit Linux environment and 
I've never had a problem with it.  Are you building on a 64-bit machine 
or in a complete 32-bit environment?

-Ted

On 01/27/2014 03:43 PM, serega wrote:
> Does the messenger work on 32 bit linux? I build the 32 bit messenger by
> setting the variable
> export CFLAGS=-m32
>
> The same code that works on 64 bit linux crates on 32.  It always crashes in
> pn_encoder_writef8
> Here is the crash stack trace from a core dump
>
> Core was generated by `./testconsumer 10.250.0.126 10.250.0.127 10000000'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x00d89877 in pn_encoder_writef8 () from
> /usr/local/lib/libqpid-proton.so.2
> Missing separate debuginfos, use: debuginfo-install
> glibc-2.12-1.80.el6_3.7.i686 libuuid-2.17.2-12.7.el6_3.i686
> (gdb) bt
> #0  0x00d89877 in pn_encoder_writef8 () from
> /usr/local/lib/libqpid-proton.so.2
> #1  0x00d89d4c in pni_encoder_enter () from
> /usr/local/lib/libqpid-proton.so.2
> #2  0x00d85d66 in pni_data_traverse () from
> /usr/local/lib/libqpid-proton.so.2
> #3  0x00d8a6e5 in pn_encoder_encode () from
> /usr/local/lib/libqpid-proton.so.2
> #4  0x00d863ec in pn_data_encode () from /usr/local/lib/libqpid-proton.so.2
> #5  0x00d8af95 in pn_post_frame () from /usr/local/lib/libqpid-proton.so.2
> #6  0x00d930f7 in pn_flush_disp () from /usr/local/lib/libqpid-proton.so.2
> #7  0x00d93971 in pn_process_flush_disp () from
> /usr/local/lib/libqpid-proton.so.2
> #8  0x00d93f94 in pn_phase () from /usr/local/lib/libqpid-proton.so.2
> #9  0x00d940c0 in pn_process () from /usr/local/lib/libqpid-proton.so.2
> #10 0x00d942e2 in pn_output_write_amqp () from
> /usr/local/lib/libqpid-proton.so.2
> #11 0x00d94a28 in pn_io_layer_output_passthru () from
> /usr/local/lib/libqpid-proton.so.2
> #12 0x00d94a28 in pn_io_layer_output_passthru () from
> /usr/local/lib/libqpid-proton.so.2
> #13 0x00d944cd in transport_produce () from
> /usr/local/lib/libqpid-proton.so.2
> #14 0x00d94de7 in pn_transport_pending () from
> /usr/local/lib/libqpid-proton.so.2
> #15 0x00da0726 in pn_connector_process () from
> /usr/local/lib/libqpid-proton.so.2
> #16 0x00d9b1bf in pn_messenger_tsync () from
> /usr/local/lib/libqpid-proton.so.2
> #17 0x00d9b503 in pn_messenger_sync () from
> /usr/local/lib/libqpid-proton.so.2
> #18 0x00d9d279 in pn_messenger_recv () from
> /usr/local/lib/libqpid-proton.so.2
> #19 0x0065f10c in run_consumer (args=0x8dc7198) at messageconsumer.c:104
> #20 0x0050fa49 in start_thread () from /lib/libpthread.so.0
> #21 0x0035863e in clone () from /lib/libc.so.6
> (gdb)
>
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445.html
> Sent from the Apache Qpid Proton mailing list archive at Nabble.com.


Re: Qpid Proton messenger on 32 bit linux

Posted by Ken Giusti <kg...@redhat.com>.
This behavior is a bug.  I've opened a Jira:

https://issues.apache.org/jira/browse/PROTON-516



----- Original Message -----
> From: "serega" <se...@sap.com>
> To: proton@qpid.apache.org
> Sent: Monday, February 10, 2014 4:29:25 AM
> Subject: Re: Qpid Proton messenger on 32 bit linux
> 
> I use Proton with SwiftMQ broker which by default advertises
> max-frame-size=2147483647. Then realloc fails to allocate a memory region
> inside  pn_buffer_ensure( disp->frame, disp->remote_max_frame) followed by a
> crash when disp->frame is used. Fortunately max-frame-size is configurable
> in SwiftMQ. I changed it to "65536" and Proton works now.
> 
> 
> 
> 
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7604255.html
> Sent from the Apache Qpid Proton mailing list archive at Nabble.com.
> 

-- 
-K

Re: Qpid Proton messenger on 32 bit linux

Posted by serega <se...@sap.com>.
I use Proton with SwiftMQ broker which by default advertises
max-frame-size=2147483647. Then realloc fails to allocate a memory region
inside  pn_buffer_ensure( disp->frame, disp->remote_max_frame) followed by a
crash when disp->frame is used. Fortunately max-frame-size is configurable
in SwiftMQ. I changed it to "65536" and Proton works now. 




--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7604255.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Re: Qpid Proton messenger on 32 bit linux

Posted by serega <se...@sap.com>.
LD_DEBUG output is attached
ld_debug.txt <http://qpid.2158936.n2.nabble.com/file/n7603830/ld_debug.txt>  

Thanks,
Sergey



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7603830.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Re: Qpid Proton messenger on 32 bit linux

Posted by "Darryl L. Pierce" <dp...@redhat.com>.
On Mon, Jan 27, 2014 at 12:43:49PM -0800, serega wrote:
> Does the messenger work on 32 bit linux? I build the 32 bit messenger by
> setting the variable 
> export CFLAGS=-m32

It most definitely works on 32-bit systems when built on such; i.e., I
have 32-bit test systems where I've built/run the code and it's worked
fine.

What I haven't done is build 32-bit on a 64-bit platform and then run on
64-bit as well.

Can you provide more details? For example, capture the output of:

LD_DEBUG=all [your executable cmdline]

and pastebin that somewhere so we can see what's going on with your
environment?

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/


Re: Qpid Proton messenger on 32 bit linux

Posted by serega <se...@sap.com>.
I create pthreads, and each thread uses its own messenger, so there is no
sharing and no mutexes. The program works however when there is only 1
thread, but crashes immediately when there is mo than one thread.  It works
in 64 bit mode no matter how many threads I create, but I have to use it in
32 bit environment. 


Debug build shows that encoder->position is NULL.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xf7feeb70 (LWP 4661)]
0x0012f877 in pn_encoder_writef8 (encoder=0xf6a0b278, value=0 '\000') at
/var/home/smeldris/qpid-proton-0.6/proton-c/src/codec/encoder.c:149
149	    encoder->position[0] = value;
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.80.el6_3.7.i686 libuuid-2.17.2-12.7.el6_3.i686
(gdb) p encoder->position
$1 = 0x0
(gdb) p encoder
$2 = (pn_encoder_t *) 0xf6a0b278
(gdb) p encoder->size
$3 = 2147483648
(gdb) p encoder->output
$4 = 0x0






--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Proton-messenger-on-32-bit-linux-tp7603445p7603468.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.