This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 182721 - local variables are auto-watched without $ prefix so they all are unassigned
Summary: local variables are auto-watched without $ prefix so they all are unassigned
Status: REOPENED
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: PC Linux
: P4 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-25 00:52 UTC by nof8
Modified: 2012-04-04 14:17 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
march build of netbeans, ide log (55.51 KB, text/x-log)
2010-04-19 22:00 UTC, nof8
Details
march build of netbeans, ide log (55.51 KB, text/plain)
2010-04-19 22:12 UTC, nof8
Details
march build of netbeans, xdebug log (12.85 KB, text/plain)
2010-04-19 22:14 UTC, nof8
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nof8 2010-03-25 00:52:21 UTC
Ubuntu 10.04 beta1
Product Version: NetBeans IDE 6.8 (Build 100204-unknown-revn)
Java: 1.6.0_18; OpenJDK Client VM 16.0-b13
System: Linux version 2.6.32-16-generic running on i386; UTF-8; ru_RU (nb)

PHP 5.3.1-5ubuntu2 with Suhosin-Patch (cli) (built: Mar 22 2010 13:47:21) 
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
    with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

PHP is run as fastcgi

When I start debugging, all local variables in Watch panel appear without $ prefix. So they all are uninitialized (and not shown by default until I check "uninitialized" checkbox in Filters context menu)

If I manually add any local variable with $ prefix, it's shown as it should.

Bug is reproduced each time I start debugging.
Comment 1 Filip Zamboj 2010-03-25 11:01:52 UTC
can you reproduce in newer build, please? 
http://bertram.netbeans.org/hudson/job/PHP-Build/?

if yes then provide code snippet we could use for testing. thanks.
Comment 2 nof8 2010-03-25 12:26:01 UTC
Just tested on NetBeans-dev-2010-03-25_12-23-45 -php.zip

Issue still exists.

I run php as fastcgi  with nginx.

If you have installed nginx and configured php-fastcgi, here is info on how to reproduce:

1.Create this php-script as /tmp/test-site/index.php:
<?php
$var = 'test';
echo $var;

2. Add this string to /etc/hosts (to isolate site for debugging)
127.0.0.1 test-site.local

3.Create this config file as /etc/nginx/sites-enabled/test-site.conf:
server {
    server_name test-site.local;
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME  /tmp/test-site/$fastcgi_script_name;
        include        fastcgi_params;
    }
}

and restart nginx

4. Add new PHP project to netbeans located in /tmp/test-site and set Project Properties/Run Configuration/Project URL to http://test-site.local/

5. Set breakpoint to "echo $var" string of index.php

6. Run debug -  debugger will stop on breakpoint.

7. Nothing but Superglobals is seen in Variables panel until you check 'uninitialized' checkbox. And when you check it, you will see 'var', not '$var' - obviously as 'unititalized'. If you manually add '$var' - you will see it as string with value 'test'


BTW, when I debug same script as command-line script, it works fine. Nginx/fastcgi bug?
Comment 3 Filip Zamboj 2010-03-25 14:05:52 UTC
Thanks a lot for detailed steps. I'll try tomorrow then. 

so far I can say I can't reproduce if php installed as module. I'd like to point out here that using watches is not very safe and xdebug is known to be unstable when using this feature. see bug 180252.
Comment 4 Filip Zamboj 2010-04-19 14:28:29 UTC
@reporter: 
firstly I am sorry I didn't have time to try to reproduce yet. 

On the other hand, I think you would save me significant amount of time trying to setup php-cgi and nginx on virtual box .. Would you be able to submit messages log and xdebug log? see information on http://wiki.netbeans.org/HowToConfigureXDebug#Enable_Xdebug_logging. We will need both, xdebug and log from NB so we can see communication on both sides and try to resolve what's missing. 

thanks a lot.
Comment 5 nof8 2010-04-19 22:00:11 UTC
Created attachment 97669 [details]
march build of netbeans, ide log
Comment 6 nof8 2010-04-19 22:12:39 UTC
Created attachment 97670 [details]
march build of netbeans, ide log
Comment 7 nof8 2010-04-19 22:14:05 UTC
Created attachment 97671 [details]
march build of netbeans, xdebug log
Comment 8 nof8 2010-04-19 22:18:15 UTC
I've attached logs from build of Netbeans 6.9, bug occurs there also.
First two logs are equal (uploaded two times by mistake)

After running IDE I've set breakpoint to "echo $var;" line and have started debugging.
When debugger has stopped on that line, I've made a copy of the logs.
Comment 9 Filip Zamboj 2010-09-15 12:31:07 UTC
batch reassigning
Comment 10 OndrejBrejla 2011-03-29 12:28:09 UTC
Can you check if the bug still appears in NB 7.0RC1 or greater? Thanks.
Comment 11 Tomas Mysik 2011-06-03 10:18:37 UTC
Batch reassigning.
Comment 12 Tomas Mysik 2011-06-09 13:20:41 UTC
Reassigning to the module owner.
Comment 13 Ondrej Brejla 2012-04-04 14:17:23 UTC
2 years old issue and no response from reporter -> P4 as a reminder.