MantisBT - Xdebug
View Issue Details
0000923Xdebug(No Category)public2013-02-13 07:462013-05-22 04:51
dizyart 
derick 
normalminoralways
closedfixed 
x86_64, Intel i5Windows 7Ultimate SP1
2.2.1 
2.2.32.2.3 
Windows 7
5.4.6
0000923: copy of issue /view.php?id=883, Xdebug + Netbeans + ext/MongoDB crash on MongoCursor instance
Copy of http://bugs.xdebug.org/view.php?id=883. [^]

When running a "Debug Project" in NetBeans, whenever MongoCursor object is instantiated,
NetBeans throws a SocketException after 0000002:0000001.5 seconds. If the instances are unset and the
exception-throwing step is skipped (with a breakpoint), the debugging session continues normally.
1.Setup NetBeans to debug with xdebug.
2.Add mongodb extension to PHP.
3.Instantiate a MongoCursor object in code.
4.Step-over to the code (or after it).
5.NetBeans throws a SocketException.

Alternatively
4.Unset MongoCursor instance
5.Set a breaking point in code AFTER the unset.
6.Skip over the part where the instance is in memory.
7.NetBeans continues
ALL additional information (very exhaustive list) is in the uploaded test file.

Also found on https://gist.github.com/dizyart/4942925 [^]
mongodb, netbeans, socket exception
txt test.php.txt (118,593) 2013-02-13 07:46
https://bugs.xdebug.org/file_download.php?file_id=157&type=bug
? test.php (118,593) 2013-02-13 07:50
https://bugs.xdebug.org/file_download.php?file_id=158&type=bug
Issue History
2013-02-13 07:46dizyartNew Issue
2013-02-13 07:46dizyartFile Added: test.php.txt
2013-02-13 07:49dizyartTag Attached: mongodb
2013-02-13 07:49dizyartTag Attached: netbeans
2013-02-13 07:49dizyartTag Attached: socket exception
2013-02-13 07:50dizyartFile Added: test.php
2013-02-13 07:52dizyartNote Added: 0002427
2013-02-13 08:11dizyartNote Added: 0002428
2013-02-13 08:12dizyartNote Edited: 0002428bug_revision_view_page.php?bugnote_id=2428#r140
2013-05-14 19:11derickNote Added: 0002461
2013-05-14 19:11derickStatusnew => closed
2013-05-14 19:11derickAssigned To => derick
2013-05-14 19:11derickResolutionopen => fixed
2013-05-14 19:12derickFixed in Version => 2.2.3
2013-05-22 04:51derickTarget Version => 2.2.3
2016-07-31 13:35derickCategoryDebug client (console) => debugclient (debugging tool)
2016-07-31 13:35derickCategorydebugclient (debugging tool) => (No Category)

Notes
(0002427)
dizyart   
2013-02-13 07:52   
Copying my versions here, for easier review:


#### Versions ####
PHP 5.4.6
Xdebug 2.2.1
Server version: Apache/2.2.23 (Win32)
NetBeans Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.7.0_13; Java HotSpot(TM) Client VM 23.7-b01
System: Windows 7 version 6.1 running on x86 (64); Cp1250; en_US (nb)
MongoDB PHP extension: 1.3.1
(0002428)
dizyart   
2013-02-13 08:11   
(edited on: 2013-02-13 08:12)
Just checked with Mongo 1.2.12:
extension=php_mongo-1.2.12-5.4-vc9.dll

No change in behavior.

Just change the first line to:

$connection = (class_exists('MongoClient')) ? new MongoClient() : new Mongo();

Makes it compatible with all versions of php_mongo

(0002461)
derick   
2013-05-14 19:11   
Fixed for xdebug 2.2.3