|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-07-11 10:17 UTC] metamorfozis at metamorfozis dot hu
[2021-06-10 15:35 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: cmb
[2021-06-10 15:35 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 03:00:02 2025 UTC |
Description: ------------ Hello! Using amqp-1.0.10, on 64bit linux system (tested on different distributions), AMQPExchange->bind() hangs forever if flags given. So it does not exit, it does not proceed, does not print any error, it waits forever. We have found the solution also: The problem is that in the bind-s definition: amqp_exchange.c: PHP_METHOD(amqp_exchange_class, bind) { [...] int flags; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss|l", &id, amqp_exchange_class_entry, &src_name, &src_name_len, &keyname, &keyname_len, &flags) == FAILURE) { return; } [...] The flags should be declared as long, because it is how it is used later in zend_parse_method_parameters. We have tried, and it works if the int is changed to long. The problem only occurs on 64 bit systems, on 32bit the problem doesn't comes up. Test script: --------------- Not works: $connection->connect(); $channel=new AMQPChannel($connection); $ex=new AMQPExchange($channel); $ex->setName('test_exchange'); $ex->setType('topic'); $ex->declare(); print __LINE__."\n"; $ex->bind('amq.direct','test',AMQP_NOWAIT); print __LINE__."\n"; Works: $connection->connect(); $channel=new AMQPChannel($connection); $ex=new AMQPExchange($channel); $ex->setName('test_exchange'); $ex->setType('topic'); $ex->declare(); print __LINE__."\n"; $ex->bind('amq.direct','test'); print __LINE__."\n"; Expected result: ---------------- Using the examples above: $ php -f test_bind_notworks.php 29 31 $ php -f test_bind_notworks.php 29 31 Actual result: -------------- Using the examples above: $ php -f test_bind_notworks.php 29 ^C <--- stalled forewer, needed to press CTRL-C $ php -f test_bind_notworks.php 29 31