php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62100 AMQPQueue::get() blocks apache server
Submitted: 2012-05-21 21:55 UTC Modified: 2012-08-27 12:58 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: soichih at gmail dot com Assigned: pdezwart (profile)
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.13 OS: CentOS 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: soichih at gmail dot com
New email:
PHP Version: OS:

 

 [2012-05-21 21:55 UTC] soichih at gmail dot com
Description:
------------
When I call AMQPQueue::get() immediately after calling AMQPExchange::publish() 
using the same AMQPChannel object, get() will block indefinitely, and this also 
causes the entire Apache server to block if it is run inside apache.

Following is the gdb stack during the lockup.

(gdb) where
#0  0x0000003d066e6a32 in recv () from /lib64/libc.so.6
#1  0x00007fd272eca9cb in ?? () from /usr/lib64/librabbitmq.so.0
#2  0x00007fd2730de663 in read_message_from_channel (connection=0x195f5f0, 
envelopeZval=<value optimized out>) at /home/hayashis/dev/amqp-
1.0.3/amqp_queue.c:163
#3  0x00007fd2730df687 in zim_amqp_queue_class_get (ht=<value optimized out>, 
return_value=0x193ab98, return_value_ptr=<value optimized out>, this_ptr=<value 
optimized out>, return_value_used=<value optimized out>)
    at /home/hayashis/dev/amqp-1.0.3/amqp_queue.c:849
#4  0x00000000005f5368 in ?? ()
#5  0x00000000005cc6a0 in execute ()
#6  0x00000000005a6ddd in zend_execute_scripts ()
#7  0x0000000000555078 in php_execute_script ()
#8  0x0000000000630b15 in ?? ()
#9  0x0000003d0661ecdd in __libc_start_main () from /lib64/libc.so.6
#10 0x0000000000421ea9 in _start ()


Test script:
---------------
<?php

//connect
$connection = new AMQPConnection();
$connection->connect();
$channel = new AMQPChannel($connection);

$reply_queue = new AMQPQueue($channel);
$reply_queue->declare();//create default queue

//send request
$ex = new AMQPExchange($channel);
$input = "hello";
$queue = "somewhere";
$ex->publish("somemessage", "some exchange");

$message = $reply_queue->get(AMQP_AUTOACK);
echo "you will never see this";

Expected result:
----------------
I should see "you will never see this"

Actual result:
--------------
The script will not display "you will never see this"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-24 20:38 UTC] soichih at gmail dot com
I found that the I had my AMQP server's ACL misconfigured so that decleration of 
default queue (amqp.default) was silently failing on the server. I fixed the ACL 
and now I can publish & get without crashing the php. 

I believe this issue is caused by some kind of unhandled error condition issue 
withih php-amqp.
 [2012-08-26 03:56 UTC] pdezwart@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

This has been fixed in another bug. Thanks for the report.
 [2012-08-26 03:56 UTC] pdezwart@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pdezwart
 [2012-08-27 12:58 UTC] soichih at gmail dot com
When will this new version released to EPEL? Currently I have following (latest) 
version installed on our machine.


Installed Packages
Name        : php-pecl-amqp
Arch        : x86_64
Version     : 1.0.1
Release     : 3.el6
Size        : 94 k
Repo        : installed
From repo   : epel
Summary     : Communicate with any AMQP compliant server
URL         : http://pecl.php.net/package/amqp
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 16:01:27 2021 UTC