MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000835XdebugUsage problems (Wrong Results)public2012-05-16 06:282012-06-11 17:03
ReporterHawk 
Assigned Toderick 
PriorityimmediateSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformintelOSUbuntuOS Version11.10
Product Version2.2.0 
Target Version2.2.1Fixed in Version2.2.1 
Summary0000835: xDebug don't work with PHP 5.4.1
DescriptionxDebug don't work with PHP 5.4.1
xDebug crashes after debug started
TagsNo tags attached.
Operating System
PHP Version5.4.1
Attached Fileslog file icon xdebug.log [^] (7,516 bytes) 2012-05-16 21:03
? file icon VotesWidget.php [^] (5,124 bytes) 2012-05-16 21:05

- Relationships

-  Notes
(0002158)
derick (administrator)
2012-05-16 09:52

Hi,

In order to reproduce and fix this, I'd need the following information:

- A *short* and *self-contained* script that reproduces the issue while debugging
- A debugging log, which you can make with setting xdebug.remote_log=/tmp/xdebug.log

cheers,
Derick
(0002161)
Hawk (reporter)
2012-05-16 21:10

I upload VotesWidget.php - xdebug crashes when i set up breakpoint at line 19. Breakpoint at any line involves the same result.
Earlier, with PHP 5.4.0 it works...
(0002165)
Hawk (reporter)
2012-05-17 06:41

Some additional info:

During execute line:

  $widget=new $className($owner);

we go to "__construct" method:

  public function __construct($owner=null)
  {
     $this->_owner=$owner===null?Yii::app()->getController():$owner;
  }

and in the first line of "__construct" xDebug crashes
(0002166)
Hawk (reporter)
2012-05-17 06:43
edited on: 2012-05-17 06:43

I use PHPStorm to debug

(0002170)
derick (administrator)
2012-05-17 08:38

Hawk, I would really need a *self-contained* script that I would be able to run myself. Little snippets is not something that helps me unfortunately. I'd be greatly appreciated if you could spend some time on creating just that.

cheers,
Derick
(0002171)
rulatir (reporter)
2012-05-17 09:27

Derick, it appears that this is the case where a small, self-contained script that reproduces the problem is extremely difficult to produce. There's that theorem the author of which I forgot (and yes, it's a rigorous theorem not just a Murphy's law) which states that the simplest input that triggers a bug in a program can be arbitrarily complex. Please do consider debugging strategies that don't rely on this holy grail, as they might prove fruitful sooner than than we manage to provide a small, self-contained test case. One such strategy could be to drop the requirements of "small", "self-contained", or both. Towards that, since I hit the bug while developing a Wordpress plugin (and the breakpoint was set in Wordpress code, not in my plugin), I will now set up a virtual server with a fresh Wordpress installation, and try stepping through it. If I can reproduce the bug this way, so can you. Stay tuned.
(0002172)
derick (administrator)
2012-05-17 09:32

Once you've set it up, could you provide me with access to it? I have no clue about how Wordpress works :-)
(0002175)
rulatir (reporter)
2012-05-17 12:59

I'm sorry, I over-promised! I simply forgot that I had downgraded to 5.3/2.1 to be able to continue my work, which means that I don't actually have the bug in my system now. In order to test it, I'd have to upgrade again, setup vhost and Wordpress, test, and downgrade again - too much hassle. But but but, there's no magic to how Wordpress works :) - it is just a PHP webapp, and you can set it up in minutes on your local machine running Apache: setup vhost, extract archive to docroot, navigate to http://your-host[/your-prefix]/wp-admin/install.php, [^] complete the quiz ;).

The information you *will* need from me is where to set the breakpoint in the Wordpress code. I'll provide it later today.
(0002176)
rulatir (reporter)
2012-05-17 14:21
edited on: 2012-05-17 14:24

OK, I went through with the upgrade/downgrade anyway. Here is a "small, Wordpress-contained" example:

- setup Wordpress,
- disable all plugins
- create plugin file {docroot}/wp-content/plugins/bugger/bugger.php with this content:

---BEGIN bugger.php---
<?php
/*
Plugin Name: XDebug bugger
Description: Reproduce a bug in XDebug
Version: 1.0
Author: Szczepan Ho?yszewski
*/

function bugger_admin_enqueue_scripts($hook) {
    
    global $current_user;
    //set breakpoint here
    $a=0;
}
add_action('admin_enqueue_scripts','bugger_admin_enqueue_scripts');
---END bugger.php---

Enable the "XDebug bugger" plugin in Wordpress. Setup remote XDebug debugging. Set breakpoint where the comment says. Visit http://{your_host}/wp-admin/index.html [^] using Firefox extension http://www.elime.be/easyxdebug.htm [^] . That should do it.

Edit: this mantis thingy can't cope with national characters! Bad mantis! ;)

(0002181)
Hawk (reporter)
2012-05-21 09:57

The same problem in PHP 5.4.3. I can't provide a *self-contained* script because i don't know what exact combination of php statements involve to crash. You can reproduce the crash if you install Yii framework and set up breakpoint in any class inherited from CWidget.
(0002185)
projekter (reporter)
2012-05-22 14:38

I have the same problem using PHP 5.4.3 with NetBeans.
I found quite a small example: Download smarty from http://www.smarty.net/files/Smarty-3.1.8.tar.gz. [^] Then you only have run this little script:
<?php
   include 'Smarty.class.php';
   $smarty = new Smarty();
?>
If you step into the __construct function, the error raises at the first line:
$this->smarty = $this;
If you do not step into, the error will happen right after execution of the line.

But if you try to create a simple class that assignes $this to a variable, xdebug does not crash.
(0002191)
rulatir (reporter)
2012-05-27 16:23

Any progress on this?
(0002203)
derick (administrator)
2012-05-28 09:27

I think I've just pushed a fix to github for this issue. Could you please try it?
(0002239)
dotbrat (reporter)
2012-06-08 08:52

Tested last build, now it's works! I've not checked all functionality, but this bug is fixed.

- Issue History
Date Modified Username Field Change
2012-05-16 06:28 Hawk New Issue
2012-05-16 09:52 derick Note Added: 0002158
2012-05-16 09:52 derick Assigned To => derick
2012-05-16 09:52 derick Status new => feedback
2012-05-16 09:53 derick Target Version => 2.2.1
2012-05-16 21:03 Hawk File Added: xdebug.log
2012-05-16 21:05 Hawk File Added: VotesWidget.php
2012-05-16 21:10 Hawk Note Added: 0002161
2012-05-16 21:10 Hawk Status feedback => assigned
2012-05-17 06:41 Hawk Note Added: 0002165
2012-05-17 06:43 Hawk Note Added: 0002166
2012-05-17 06:43 Hawk Note Edited: 0002166 View Revisions
2012-05-17 08:38 derick Note Added: 0002170
2012-05-17 08:38 derick Status assigned => feedback
2012-05-17 09:27 rulatir Note Added: 0002171
2012-05-17 09:32 derick Note Added: 0002172
2012-05-17 12:59 rulatir Note Added: 0002175
2012-05-17 14:21 rulatir Note Added: 0002176
2012-05-17 14:22 rulatir Note Edited: 0002176 View Revisions
2012-05-17 14:24 rulatir Note Edited: 0002176 View Revisions
2012-05-21 09:57 Hawk Note Added: 0002181
2012-05-21 09:57 Hawk Status feedback => assigned
2012-05-22 14:38 projekter Note Added: 0002185
2012-05-27 16:23 rulatir Note Added: 0002191
2012-05-28 09:27 derick Note Added: 0002203
2012-05-28 09:27 derick Status assigned => feedback
2012-06-08 08:52 dotbrat Note Added: 0002239
2012-06-11 17:03 derick Status feedback => closed
2012-06-11 17:03 derick Resolution open => fixed
2012-06-11 17:03 derick Fixed in Version => 2.2.1
2016-07-31 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker