[jira] [Commented] (PROTON-560) Failing to transfer messages more than 4kB via AMQPS
[ https://issues.apache.org/jira/browse/PROTON-560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13968291#comment-13968291 ] Ken Giusti commented on PROTON-560: --- Reproducer (unit test update): diff --git a/tests/python/proton_tests/ssl.py b/tests/python/proton_tests/ssl.py index db19e6f..ed2e25d 100644 --- a/tests/python/proton_tests/ssl.py +++ b/tests/python/proton_tests/ssl.py @@ -18,7 +18,10 @@ # import os, common +import random +import string import subprocess + from proton import * from common import Skipped, pump @@ -877,7 +880,9 @@ class MessengerSSLTests(common.Test): msg = Message() msg.address = amqps://127.0.0.1:12345 -msg.body = Hello World! +# make sure a large, uncompressible message body works! +msg.body = .join(random.choice(string.ascii_letters) + for x in range(10099)) trk = self.client.put(msg) self.client.send() Failing to transfer messages more than 4kB via AMQPS Key: PROTON-560 URL: https://issues.apache.org/jira/browse/PROTON-560 Project: Qpid Proton Issue Type: Bug Components: proton-c Affects Versions: 0.6 Environment: Fedora 64bit Reporter: Margarita Assignee: Ken Giusti We are using qpid-proton to transfer messages via SSL (AMQPS). While creating messages larger than 4 kB we get error SSL Failure[-2]: Unknown Error. Does qpid-proton handle large message? -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (PROTON-554) pn_data_put_long call fails on 64x Linux 2.6.32-5-amd64
[ https://issues.apache.org/jira/browse/PROTON-554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13968308#comment-13968308 ] Denis Savrukov commented on PROTON-554: --- Rafael? :) Is there something about the problem? Thanks! pn_data_put_long call fails on 64x Linux 2.6.32-5-amd64 --- Key: PROTON-554 URL: https://issues.apache.org/jira/browse/PROTON-554 Project: Qpid Proton Issue Type: Bug Components: php-binding Affects Versions: 0.6 Environment: Linux 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux PHP 5.4.26-1~dotdeb.0 (cli) (built: Mar 7 2014 08:58:03) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans with Suhosin v0.9.34-dev, Copyright (c) 2007-2012, by SektionEins GmbH Reporter: Denis Savrukov Attachments: qpid-proton-0.6-build-swig20.log, qpid-proton-0.6-build.log Fatal error: Type error in argument 2 of pn_data_put_long. Expected SWIGTYPE_p_long_long -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (PROTON-560) Failing to transfer messages more than 4kB via AMQPS
[ https://issues.apache.org/jira/browse/PROTON-560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13968373#comment-13968373 ] Margarita commented on PROTON-560: -- The problem is in openssl.c:805 function process_input_ssl While decoding and collecting large data stream from different frame one of the helper pointers is not reinitialized and points to invalid memory region. Despite that memmove operation is done on it (see comments with prefix // PROTON-560): if (!ssl-app_input_closed) { char *data = ssl-inbuf; // PROTON-560: data points if (ssl-in_count 0 || ssl-ssl_closed) { /* if ssl_closed, send 0 count */ pn_io_layer_t *io_next = ssl-io_layer-next; ssize_t consumed = io_next-process_input( io_next, data, ssl-in_count); if (consumed 0) { ssl-in_count -= consumed; data += consumed; work_pending = true; _log( ssl, Application consumed %d bytes from peer\n, (int) consumed ); } else if (consumed 0) { _log(ssl, Application layer closed its input, error=%d (discarding %d bytes)\n, (int) consumed, (int)ssl-in_count); ssl-in_count = 0;// discard any pending input ssl-app_input_closed = consumed; if (ssl-app_output_closed ssl-out_count == 0) { // both sides of app closed, and no more app output pending: start_ssl_shutdown(ssl); } } else { // app did not consume any bytes, must be waiting for a full frame if (ssl-in_count == ssl-in_size) { // but the buffer is full, not enough room for a full frame. // can we grow the buffer? uint32_t max_frame = pn_transport_get_max_frame(ssl-transport); if (!max_frame) max_frame = ssl-in_size * 2; // no limit if (ssl-in_size max_frame) { // no max frame limit - grow it. char *newbuf = (char *)malloc( max_frame ); // PROTON-560: extending buffer here if (newbuf) { ssl-in_size *= max_frame; memmove( newbuf, ssl-inbuf, ssl-in_count ); free( ssl-inbuf ); ssl-inbuf = newbuf; // PROTON-560: 'data' ptr becomes invalid } work_pending = true; // can we get more input? } else { // can't gather any more input, but app needs more? // This is a bug - since SSL can buffer up to max-frame, // the application _must_ have enough data to process. If // this is an oversized frame, the app _must_ handle it // by returning an error code to SSL. _log_error(Error: application unable to consume input.\n); } } } } if (ssl-in_count 0 data != ssl-inbuf) memmove( ssl-inbuf, data, ssl-in_count ); // PROTON-560: 'data' ptr is used ! } The changes to fix bug: char *newbuf = (char *)malloc( max_frame ); if (newbuf) { ssl-in_size = max_frame; // instead of ssl-in_size *= max_frame; memmove( newbuf, ssl-inbuf, ssl-in_count ); free( ssl-inbuf ); ssl-inbuf = newbuf; data = ssl-inbuf; //added } Failing to transfer messages more than 4kB via AMQPS Key: PROTON-560 URL: https://issues.apache.org/jira/browse/PROTON-560 Project: Qpid Proton Issue Type: Bug Components: proton-c Affects Versions: 0.6 Environment: Fedora 64bit Reporter: Margarita Assignee: Ken Giusti We are using qpid-proton to transfer messages via SSL (AMQPS). While creating messages larger than 4 kB we get error SSL Failure[-2]: Unknown Error. Does qpid-proton handle large message? -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Resolved] (PROTON-560) Failing to transfer messages more than 4kB via AMQPS
[ https://issues.apache.org/jira/browse/PROTON-560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ken Giusti resolved PROTON-560. --- Resolution: Fixed Fix Version/s: 0.7 Thanks for the patch, Margarita! The next 0.7 release candidate will contain this fix. Failing to transfer messages more than 4kB via AMQPS Key: PROTON-560 URL: https://issues.apache.org/jira/browse/PROTON-560 Project: Qpid Proton Issue Type: Bug Components: proton-c Affects Versions: 0.6 Environment: Fedora 64bit Reporter: Margarita Assignee: Ken Giusti Fix For: 0.7 We are using qpid-proton to transfer messages via SSL (AMQPS). While creating messages larger than 4 kB we get error SSL Failure[-2]: Unknown Error. Does qpid-proton handle large message? -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (PROTON-554) pn_data_put_long call fails on 64x Linux 2.6.32-5-amd64
[ https://issues.apache.org/jira/browse/PROTON-554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13968667#comment-13968667 ] Rafael H. Schloming commented on PROTON-554: I managed to find a debian 6 environment and I can confirm seeing the same behaviour. I was able to work around it by backporting the following macros from swig 2.0: Index: proton-c/bindings/php/php.i === --- proton-c/bindings/php/php.i (revision 1587223) +++ proton-c/bindings/php/php.i (working copy) @@ -22,7 +22,38 @@ // provided by SWIG development libraries %include php.swg +%define CONVERT_LONG_LONG_IN(lvar,t,invar) + switch ((*(invar))-type) { + case IS_DOUBLE: + lvar = (t) (*(invar))-value.dval; + break; + case IS_STRING: { + char * endptr; + errno = 0; + lvar = (t) strtoll((*(invar))-value.str.val, endptr, 10); + if (*endptr !errno) break; + /* FALL THRU */ + } + default: + convert_to_long_ex(invar); + lvar = (t) (*(invar))-value.lval; + } +%enddef +%pass_by_val(long long, CONVERT_LONG_LONG_IN); + +%typemap(out) long long +%{ + if ((long long)LONG_MIN = $1 $1 = (long long)LONG_MAX) { +return_value-value.lval = (long)($1); +return_value-type = IS_LONG; + } else { +char temp[256]; +sprintf(temp, %lld, (long long)$1); +ZVAL_STRING(return_value, temp, 1); + } +%} + %header %{ /* Include the headers needed by the code in this wrapper file */ #include proton/types.h pn_data_put_long call fails on 64x Linux 2.6.32-5-amd64 --- Key: PROTON-554 URL: https://issues.apache.org/jira/browse/PROTON-554 Project: Qpid Proton Issue Type: Bug Components: php-binding Affects Versions: 0.6 Environment: Linux 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux PHP 5.4.26-1~dotdeb.0 (cli) (built: Mar 7 2014 08:58:03) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans with Suhosin v0.9.34-dev, Copyright (c) 2007-2012, by SektionEins GmbH Reporter: Denis Savrukov Attachments: qpid-proton-0.6-build-swig20.log, qpid-proton-0.6-build.log Fatal error: Type error in argument 2 of pn_data_put_long. Expected SWIGTYPE_p_long_long -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (PROTON-554) pn_data_put_long call fails on 64x Linux 2.6.32-5-amd64
[ https://issues.apache.org/jira/browse/PROTON-554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rafael H. Schloming updated PROTON-554: --- Attachment: workaround.patch pn_data_put_long call fails on 64x Linux 2.6.32-5-amd64 --- Key: PROTON-554 URL: https://issues.apache.org/jira/browse/PROTON-554 Project: Qpid Proton Issue Type: Bug Components: php-binding Affects Versions: 0.6 Environment: Linux 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux PHP 5.4.26-1~dotdeb.0 (cli) (built: Mar 7 2014 08:58:03) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans with Suhosin v0.9.34-dev, Copyright (c) 2007-2012, by SektionEins GmbH Reporter: Denis Savrukov Attachments: qpid-proton-0.6-build-swig20.log, qpid-proton-0.6-build.log, workaround.patch Fatal error: Type error in argument 2 of pn_data_put_long. Expected SWIGTYPE_p_long_long -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (PROTON-554) pn_data_put_long call fails on 64x Linux 2.6.32-5-amd64
[ https://issues.apache.org/jira/browse/PROTON-554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13968672#comment-13968672 ] Rafael H. Schloming commented on PROTON-554: I've attached the workaround as a patch file for convenience. I'm not sure why the swig 2.0 based isn't working for you. The php support in swig 2.0 appears to be a good bit more complete, so ideally it would be nice to be able to use swig 2.0 directly rather than manually back porting the bits and pieces that are needed. pn_data_put_long call fails on 64x Linux 2.6.32-5-amd64 --- Key: PROTON-554 URL: https://issues.apache.org/jira/browse/PROTON-554 Project: Qpid Proton Issue Type: Bug Components: php-binding Affects Versions: 0.6 Environment: Linux 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux PHP 5.4.26-1~dotdeb.0 (cli) (built: Mar 7 2014 08:58:03) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans with Suhosin v0.9.34-dev, Copyright (c) 2007-2012, by SektionEins GmbH Reporter: Denis Savrukov Attachments: qpid-proton-0.6-build-swig20.log, qpid-proton-0.6-build.log, workaround.patch Fatal error: Type error in argument 2 of pn_data_put_long. Expected SWIGTYPE_p_long_long -- This message was sent by Atlassian JIRA (v6.2#6252)