View Issue Details

IDProjectCategoryView StatusLast Update
0000835XdebugUncategorizedpublic2012-06-11 16:03
ReporterHawk Assigned Toderick  
PriorityimmediateSeveritycrashReproducibilityalways
Status closedResolutionfixed 
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
Description

xDebug don't work with PHP 5.4.1
xDebug crashes after debug started

TagsNo tags attached.
Attached Files
xdebug.log (7,516 bytes)
VotesWidget.php (5,124 bytes)
Operating System
PHP Version5.4.1

Activities

derick

2012-05-16 08:52

administrator   ~0002158

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

Hawk

2012-05-16 20:10

reporter   ~0002161

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...

Hawk

2012-05-17 05:41

reporter   ~0002165

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

Hawk

2012-05-17 05:43

reporter   ~0002166

Last edited: 2012-05-17 05:43

I use PHPStorm to debug

derick

2012-05-17 07:38

administrator   ~0002170

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

rulatir

2012-05-17 08:27

reporter   ~0002171

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.

derick

2012-05-17 08:32

administrator   ~0002172

Once you've set it up, could you provide me with access to it? I have no clue about how Wordpress works :-)

rulatir

2012-05-17 11:59

reporter   ~0002175

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.

rulatir

2012-05-17 13:21

reporter   ~0002176

Last edited: 2012-05-17 13: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! ;)

Hawk

2012-05-21 08:57

reporter   ~0002181

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.

projekter

2012-05-22 13:38

reporter   ~0002185

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.

rulatir

2012-05-27 15:23

reporter   ~0002191

Any progress on this?

derick

2012-05-28 08:27

administrator   ~0002203

I think I've just pushed a fix to github for this issue. Could you please try it?

dotbrat

2012-06-08 07:52

reporter   ~0002239

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 05:28 Hawk New Issue
2012-05-16 08:52 derick Note Added: 0002158
2012-05-16 08:52 derick Assigned To => derick
2012-05-16 08:52 derick Status new => feedback
2012-05-16 08:53 derick Target Version => 2.2.1
2012-05-16 20:03 Hawk File Added: xdebug.log
2012-05-16 20:05 Hawk File Added: VotesWidget.php
2012-05-16 20:10 Hawk Note Added: 0002161
2012-05-16 20:10 Hawk Status feedback => assigned
2012-05-17 05:41 Hawk Note Added: 0002165
2012-05-17 05:43 Hawk Note Added: 0002166
2012-05-17 05:43 Hawk Note Edited: 0002166
2012-05-17 07:38 derick Note Added: 0002170
2012-05-17 07:38 derick Status assigned => feedback
2012-05-17 08:27 rulatir Note Added: 0002171
2012-05-17 08:32 derick Note Added: 0002172
2012-05-17 11:59 rulatir Note Added: 0002175
2012-05-17 13:21 rulatir Note Added: 0002176
2012-05-17 13:22 rulatir Note Edited: 0002176
2012-05-17 13:24 rulatir Note Edited: 0002176
2012-05-21 08:57 Hawk Note Added: 0002181
2012-05-21 08:57 Hawk Status feedback => assigned
2012-05-22 13:38 projekter Note Added: 0002185
2012-05-27 15:23 rulatir Note Added: 0002191
2012-05-28 08:27 derick Note Added: 0002203
2012-05-28 08:27 derick Status assigned => feedback
2012-06-08 07:52 dotbrat Note Added: 0002239
2012-06-11 16:03 derick Status feedback => closed
2012-06-11 16:03 derick Resolution open => fixed
2012-06-11 16:03 derick Fixed in Version => 2.2.1
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized