php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62354 Activate get_debug_info object handlers
Submitted: 2012-06-18 16:37 UTC Modified: 2012-09-10 05:35 UTC
From: jpauli@php.net Assigned: pdezwart (profile)
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.14 OS: *
Private report: No CVE-ID: None
 [2012-06-18 16:37 UTC] jpauli@php.net
Description:
------------
get_debug_info object handlers are #if 0'ed so they are not activated.
They should be for a better var_dump() debugging

Test script:
---------------
var_dump(new AMQPEnvelope)

Expected result:
----------------
object(AMQPEnvelope)#1 (18) {
  ["body"]=>
  string(0) ""
  ["content_type"]=>
  string(0) ""
  ["routing_key"]=>
  string(0) ""
  ["delivery_tag"]=>
  int(0)
  ["delivery_mode"]=>
  int(0)
  ["exchange_name"]=>
  string(0) ""
  ["is_redelivery"]=>
  int(0)
  ["content_encoding"]=>
  string(0) ""
  ["type"]=>
  string(0) ""
  ["timestamp"]=>
  int(0)
  ["priority"]=>
  int(0)
  ["expiration"]=>
  string(0) ""
  ["user_id"]=>
  string(0) ""
  ["app_id"]=>
  string(0) ""
  ["message_id"]=>
  string(0) ""
  ["reply_to"]=>
  string(0) ""
  ["correlation_id"]=>
  string(0) ""
  ["headers"]=>
  array(0) {
  }
}


Actual result:
--------------
object(AMQPEnvelope)#1 (0) {
}

Patches

get_degug_info-handlers (last revision 2012-06-18 16:37 UTC by jpauli@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-18 16:37 UTC] jpauli@php.net
The following patch has been added/updated:

Patch Name: get_degug_info-handlers
Revision:   1340037468
URL:        https://bugs.php.net/patch-display.php?bug=62354&patch=get_degug_info-handlers&revision=1340037468
 [2012-07-16 15:25 UTC] jpauli@php.net
Pieter: I tested those handlers as-is on 5.3.14 and have not seen any bug nor 
leak. Could you retry please, and if OK for you, patch and commit ?

Thx,

Julien
 [2012-07-18 09:14 UTC] pdezwart@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pdezwart
 [2012-07-18 09:14 UTC] pdezwart@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

Fixed in 1.0.4. Thanks for the help!
 [2012-08-26 09:22 UTC] bkw at codingforce dot com
This still segfaults with php-5.3.15 when an AMQP*-object is a property
of another object:


<?php
class Amqptest {};
$o = new Amqptest();
$o->conn = new AMQPConnection();
print_r($o);


Crash-report on OSX:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_c.dylib             	0x00007fff90f494f0 strlen + 16
1   amqp.so                       	0x000000010102b8d6 
amqp_connection_object_get_debug_info + 118 (amqp_connection.c:60)
2   php                           	0x000000010078e4d8 zend_print_zval_r_ex + 
248
3   php                           	0x00000001006be86c zif_print_r + 92
4   php                           	0x00000001007f37f9 
zend_do_fcall_common_helper_SPEC + 1081
5   php                           	0x00000001007f3ef1 execute + 609
6   php                           	0x000000010078c968 zend_execute_scripts + 
440
7   php                           	0x0000000100738872 php_execute_script + 
722
8   php                           	0x000000010080af01 main + 4529
9   php                           	0x00000001005c57d4 start + 52
 [2012-09-05 15:05 UTC] bkw at codingforce dot com
I vote for reopening this bug. Using print_r on AMQP-Objects contained
in other objects clearly dereferences something else than it should be.

More evidence: https://gist.github.com/3637907
 [2012-09-05 21:01 UTC] bkw at codingforce dot com
I think I finally tracked it down. Also see #62953.

Fix:
https://github.com/bkw/pecl-amqp/commit/738f413ade12070441cb227f86d7e7f0bcf154f4
 [2012-09-06 08:43 UTC] jpauli@php.net
Yep, I tracked it yesterday as well, very weird bug leading to strange behavior 
lol.

Your patch seems to fix it, nice job.
Waiting for pdezwart to merge that as I got no karma for
 [2012-09-06 08:44 UTC] jpauli@php.net
-Status: Closed +Status: Re-Opened -Type: Feature/Change Request +Type: Bug
 [2012-09-06 10:01 UTC] bkw at codingforce dot com
Thanks. This module really needs some love.
The version we use internally has some more fixes:

https://github.com/bkw/pecl-amqp/compare/master...ri
 [2012-09-10 05:35 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.

Fixed in git (https://github.com/pdezwart/php-amqp)

Thanks!
 [2012-09-10 05:35 UTC] pdezwart@php.net
-Status: Re-Opened +Status: Closed
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jul 25 11:01:24 2021 UTC