<HTML>
<HEAD>
<TITLE>Re: [rabbitmq-discuss] Rabbitmq-c Help</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>You diagnosis was absolutely correct. I wrongly assumed that the Fedora repository contained the latest RabbitMQ server version, which it did not. I am, however, at another impass. I have tweaked my code a little to work with 0-9-1, but I have run into a segfault in the rabbitmq-c client, which, lets face it, is probably my doing.<BR>
The segfault occurs when I try to consume, with the following code:<BR>
<BR>
</SPAN></FONT><SPAN STYLE='font-size:11pt'><FONT FACE="Consolas, Courier New, Courier"> amqp_basic_consume_t s;<BR>
s.ticket = 0;<BR>
s.queue.len = ctx->name_len;<BR>
s.queue.bytes = ctx->name;<BR>
s.consumer_tag.len = 0;<BR>
s.consumer_tag.bytes = NULL;<BR>
s.no_local = (AMQP_NOLOCAL & parms) ? 1 : 0;<BR>
s.no_ack = (AMQP_NOACK & parms) ? 1 : 0;<BR>
s.exclusive = (AMQP_EXCLUSIVE & parms) ? 1 : 0;<BR>
s.nowait = 0;<BR>
<BR>
amqp_method_number_t method_ok = AMQP_BASIC_CONSUME_OK_METHOD;<BR>
res = (amqp_rpc_reply_t)amqp_simple_rpc(<BR>
cnn->conn,<BR>
AMQP_CHANNEL,<BR>
AMQP_BASIC_CONSUME_METHOD,<BR>
&method_ok,<BR>
&s<BR>
);</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"> <BR>
<BR>
The backtrace is:<BR>
<BR>
</FONT><FONT FACE="Consolas, Courier New, Courier">#0 0x00bbd416 in __kernel_vsyscall ()<BR>
#1 0x00248d71 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64<BR>
#2 0x0024a64a in abort () at abort.c:92<BR>
#3 0x0047ec9e in amqp_encode_field_value (encoded=..., entry=0x8864294, offsetptr=0xbfca3a6c) at amqp_table.c:413<BR>
#4 0x0047f0c4 in amqp_encode_table (encoded=..., input=0xbfca3dcc, offsetptr=0xbfca3ad8) at amqp_table.c:324<BR>
#5 0x004838a2 in amqp_encode_method (methodNumber=3932180, decoded=0xbfca3da8, encoded=...) at amqp_framing.c:1357<BR>
#6 0x0047f98d in inner_send_frame (state=0x8897658, frame=0xbfca3bb4, encoded=0xbfca3b80, payload_len=0xbfca3b88) at amqp_connection.c:367<BR>
#7 0x0047fabd in amqp_send_frame (state=0x8897658, frame=0xbfca3bb4) at amqp_connection.c:427<BR>
#8 0x004806bb in amqp_send_method (state=0x8897658, channel=1, id=3932180, decoded=0xbfca3da8) at amqp_socket.c:268<BR>
#9 0x00480729 in amqp_simple_rpc (state=0x8897658, channel=1, request_id=3932180, expected_reply_ids=0xbfca3e00, decoded_request_method=0xbfca3da8) at amqp_socket.c:291<BR>
#10 0x0014560d in zim_amqp_queue_class_consume (ht=1, return_value=0x8865c44, return_value_ptr=0x0, this_ptr=0x886428c, return_value_used=1) at /home/pdezwart/src/pecl/amqp/trunk/amqp.c:936<BR>
#11 0x0825fd39 in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at /usr/src/debug/php-5.3.3/Zend/zend_vm_execute.h:316<BR>
#12 0x0823676e in execute (op_array=0x8864738) at /usr/src/debug/php-5.3.3/Zend/zend_vm_execute.h:107<BR>
#13 0x0820ef36 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/debug/php-5.3.3/Zend/zend.c:1194<BR>
#14 0x081b5ac6 in php_execute_script (primary_file=0xbfca63c4) at /usr/src/debug/php-5.3.3/main/main.c:2260<BR>
#15 0x0829f358 in main (argc=3, argv=0xbfca6504) at /usr/src/debug/php-5.3.3/sapi/cli/php_cli.c:1192<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
Thoughts on what I am doing wrong? Is there a spec somewhere I can use? =)<BR>
<BR>
Thanks,<BR>
me<BR>
<BR>
<BR>
On 9/21/10 3:10 PM, "David Wragg" <<a href="david@rabbitmq.com">david@rabbitmq.com</a>> wrote:<BR>
<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:11pt'><FONT FACE="Calibri, Verdana, Helvetica, Arial">Hi Pieter,<BR>
<BR>
Sorry for the delay in responding.<BR>
<BR>
Pieter de Zwart <<a href="pdezwart@rubiconproject.com">pdezwart@rubiconproject.com</a>> writes:<BR>
> I need some help with rabbitmq-c. I inherited the PHP extension code base,<BR>
> so I am a little lost. I pulled in RabbitMQ 2.1, along with the tip of<BR>
> rabbitmq-c and rabbitmq-codegen. Everything compiles just fine, but when I<BR>
> try to instantiate a new connection in the PHP extension, I get:<BR>
><BR>
> localhost:~/src/pecl/amqp/trunk$ php -f tests/test.php<BR>
> Expected 0x000A000A method frame on channel 0, got frame on channel 19793<BR>
><BR>
> This is the stacktrace:<BR>
> #0 0x009f4416 in __kernel_vsyscall ()<BR>
> #1 0x00248d71 in raise (sig=6) at<BR>
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64<BR>
> #2 0x0024a64a in abort () at abort.c:92<BR>
> #3 0x00137640 in amqp_simple_wait_method (state=0xa1604c0,<BR>
> expected_channel=0, expected_method=655370, output=0xbfe31b20) at<BR>
> amqp_socket.c:243<BR>
> #4 0x001379fc in amqp_login_inner (state=0xa1604c0, vhost=0xa12d70c "/",<BR>
> channel_max=0, frame_max=131072, heartbeat=0,<BR>
> sasl_method=AMQP_SASL_METHOD_PLAIN) at amqp_socket.c:373<BR>
<BR>
What's happening is that the C client is proposing a version of AMQP,<BR>
and the server is rejecting it. I can't tell more that that, because<BR>
the C client doesn't handle this version mismatch situation well.<BR>
<BR>
But the versions of rabbitmq-c, rabbitmq-codegen and rabbitmq-server you<BR>
describe all implement AMQP 0-9-1, so how that can be happening is a bit<BR>
of a mystery.<BR>
<BR>
My guess is that you are actually pointing the current C client at an<BR>
old (pre-2.0) version of rabbitmq-server somehow. Is that possible?<BR>
Please double check and let me know.<BR>
<BR>
David<BR>
<BR>
--<BR>
David Wragg<BR>
Staff Engineer, RabbitMQ<BR>
SpringSource, a division of VMware<BR>
<BR>
</FONT></SPAN></BLOCKQUOTE><SPAN STYLE='font-size:11pt'><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
-- <BR>
</FONT></SPAN><FONT COLOR="#323232"><FONT SIZE="4"><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:14pt'>the rubicon project<BR>
</SPAN></FONT></FONT></FONT><FONT FACE="Verdana, Helvetica, Arial"><FONT COLOR="#B80020"><FONT SIZE="1"><SPAN STYLE='font-size:9pt'><BR>
</SPAN><SPAN STYLE='font-size:7pt'>PIETER DE ZWART </SPAN></FONT></FONT><FONT SIZE="1"><SPAN STYLE='font-size:7pt'><FONT COLOR="#3E3E3E">| LEAD, </FONT><FONT COLOR="#3F3F3F">INTERFACES TEAM<BR>
</FONT><FONT COLOR="#B9001C">••• P 310 207 0272 | x224<BR>
</FONT><FONT COLOR="#B8001B">••• C 408 666 4443<BR>
</FONT><FONT COLOR="#B9001C">••• F 323 466 7119<BR>
</FONT><BR>
<FONT COLOR="#3A3A3A"><BR>
1925 S. BUNDY DRIVE<BR>
LOS ANGELES, CALIFORNIA 90025<BR>
</FONT><FONT COLOR="#B40D1B"><BR>
</FONT><FONT COLOR="#0000FD">WWW.RUBICONPROJECT.COM</FONT><FONT COLOR="#B40D1B"> <</FONT><FONT COLOR="#0000FF"><U><a href="http://">http://</a>www.rubiconproject.com/</U></FONT><FONT COLOR="#B40D1B">> <BR>
</FONT></SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT COLOR="#2D2D2D"><FONT SIZE="4"><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:13pt'><IMG src="cid:3368003622_5837442" ><BR>
</SPAN></FONT></FONT></FONT><FONT FACE="Verdana, Helvetica, Arial"><FONT COLOR="#767676"><FONT SIZE="1"><SPAN STYLE='font-size:7pt'>“COMPANY OF THE YEAR” ALWAYSON ONMEDIA 2009<BR>
#24 ON FAST COMPANY FAST 50 READER FAVORITES<BR>
2008 ALWAYSON 250 GLOBAL WINNER<BR>
2008 ALWAYSON ONMEDIA 100 WINNER<BR>
TWIISTUP3 BEST IN SHOW<BR>
</SPAN></FONT></FONT><FONT SIZE="1"><SPAN STYLE='font-size:7pt'><FONT COLOR="#757575">PRICEWATERHOUSECOOPERS – ENTRETECH BEST STARTUP<BR>
</FONT><FONT COLOR="#767676">AMERICAN BUSINESS AWARDS - STEVIES ‘08 FINALIST BEST NEW COMPANY<BR>
</FONT><FONT COLOR="#757575">AMERICAN BUSINESS AWARDS - STEVIES ‘08 FINALIST MOST INNOVATIVE COMPANY<BR>
AMERICAN BUSINESS AWARDS - STEVIES ‘08 FINALIST NEW PRODUCT OR SERVICE - SERVICES<BR>
<BR>
</FONT></SPAN></FONT></FONT><FONT COLOR="#177E00"><FONT SIZE="6"><FONT FACE="Webdings"><SPAN STYLE='font-size:24pt'>P</SPAN></FONT></FONT><FONT SIZE="1"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:7pt'> </SPAN></FONT><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:8pt'>Please consider the environment before printing this e-mail<BR>
</SPAN></FONT></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>