shinvdu / php-amqp

Automatically exported from code.google.com/p/php-amqp
0 stars 0 forks source link

amqp_basic_publish() raises segmentation fault #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use example.php as base, replacing information for my server
2. Run
3. Segfault

What is the expected output? What do you see instead?
Should see it run to completion.  Segfaults instead.

What version of the product are you using? On what operating system?
Extension Version => 0.0.7
librabbitmq version => 0.0.1
Linux marzen 2.6.23-hardened-r7 #2 SMP Tue Feb 19 13:14:05 EST 2008 x86_64
Intel(R) Xeon(R) CPU E5310 @ 1.60GHz GenuineIntel GNU/Linux

Please provide any additional information below.

Commenting out the publish line results in no segfault.

Original issue reported on code.google.com by madco...@gmail.com on 24 Nov 2009 at 5:03

GoogleCodeExporter commented 8 years ago
It looks like the segfault happens at this line:

518:    FOREACH_KEYVAL(pos, opts, key, opt) {

The publish was called with:

amqp_basic_publish( $conn, $channel_id, $exchange, $routing_key, $body, false, 
false )

Which means opts is NULL.  Adding an empty array for opts fixes the segfault, 
but the
code should be able to detect that an array was not passed, and either raise a
warning or use default options.

Original comment by madco...@gmail.com on 24 Nov 2009 at 11:33

GoogleCodeExporter commented 8 years ago
Ended up fixing this as well as issue #5, with the attached patch against r15

Original comment by madco...@gmail.com on 5 Feb 2010 at 2:21

Attachments: