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 238391 - Netbeans C++ Watcher not working and debugging freezes
Summary: Netbeans C++ Watcher not working and debugging freezes
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: henk89
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-14 20:47 UTC by faa77
Modified: 2014-01-13 13:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description faa77 2013-11-14 20:47:26 UTC
I have the following code which memory-maps a 350MB file in to a char array using the boost interprocess library:

#include <boost/interprocess/file_mapping.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <boost/shared_ptr.hpp>

using namespace std;
using namespace boost::interprocess;
using namespace boost;


int main(){
	const char* FilePath = "350MB file path";
	boost::shared_ptr<file_mapping> fm(new file_mapping(FilePath,read_only));
	boost::shared_ptr<mapped_region> region(new mapped_region(*fm,read_only));
	boost::shared_ptr<char> rawbytes(static_cast<char*>(region->get_address()));
int c = 0;  //I put a break point here
}

-When I start debugging I reach the break-point (above) and then I add rawbytes to the Watcher. I then "expand" the Watcher node for rawbytes to try and view the "value" of the array. At this point my laptop CPU goes crazy but nothing is displayed. I have waited for ages and my CPU fan just carries on going mad.

(Initially I was hoping I could hover-over the variable name and preview the contents via a tool-tip like Visual Studio- when this didnt seem to work I then tried the Watch window).

-Once I realised the above was not working I tried to cancel my debugging session by clicking either on the red square at the top, or by clicking on the "x" in the bottom-right (to the left of the line number indicator). The debugging session does not stop and I always have to cancel the debugging session by closing the whole of Netbeans.
Comment 1 faa77 2013-11-14 20:50:13 UTC
When I say "view the "value" of the array" I mean to see the content of the first X bytes in the array.
Comment 2 faa77 2013-11-14 20:53:59 UTC
I am on Ubuntu 13.10, gcc 4.8 and g++ 4.8. I am using the gdb debugger v7.6.1.
Comment 3 faa77 2013-12-09 17:00:51 UTC
Has there been any development on this? Would really like to use netbeans but this problem has made it impossible.
Comment 4 henk89 2013-12-11 16:05:45 UTC
Unfortunately I'm unable to reproduce the issue. Clicking to the watch just shows some fields of rawbytes.

Could you please try your scenario in command-line mode?
And could you please provide me with the GDB log (http://wiki.netbeans.org/GdbLog) from the session?
Comment 5 faa77 2013-12-11 16:52:13 UTC
Ok to address your questions- I werent sure what you meant by running it in command-line mode (and still getting it to break on the correct line in the IDE)? Could you give an example and I will do that.

Regarding GDB log- I could not find such a log on my system. However....

With the bad news out the way- I have some (kinda) good news. It seems that the problem IS being caused by the fact that my file is 350MB in size. When I try with a much smaller file (100 bytes) the watcher window shows the contents of the file no problems. I can also stop the debug session no problems- i.e Netbeans doesn't freeze.

So, it would seem that the 350MB text file is causing the debugger session (and the CPU) to go crazy. I am using an i7 3520M 2.9-3.6GHz Ivy Bridge with 16GB of RAM, so my machine is certainly capable of using this file.

How should we proceed?
Comment 6 henk89 2013-12-11 17:07:43 UTC
Try using gdb itself w/o the IDE for testing. In case it crashes we are unlikely to help you. If you need some help with GDB syntax I can give you instructions.
Comment 7 faa77 2013-12-11 17:23:13 UTC
Yes please- if you could. I don't usually run Netbeans (or C++) apps from the command line, but if you could instruct me how to, assuming the project path is <whatever> then I will do that.

I should also say- after I closed Netbeans it seemed like my whole Ubuntu session was a lot slower- as if the CPU was still going mad and causing some sort of throttling in the OS.

I assume from your last comment that your Netbeans debugger session works perfectly well with a 350MB file and that this file size shouldnt cause the problem?
Comment 8 henk89 2013-12-11 20:19:56 UTC
I'll prepare and provide you with some instructions.

You're right, my debugger could operate even on my laptop.
Comment 9 henk89 2013-12-11 20:31:42 UTC
But at first find out where you GDB log is located.

1. Open Debugger Console (windows/debugging/debugger console)
2. Start debugging session
3. Full path to a log is shown on the first line in the console

Then you may try your scenario and provide me with the log. In case the IDE ruins the log during the abnormal closing try copying the log before closing the IDE.
Comment 10 faa77 2013-12-13 01:13:50 UTC
Will try the above- but thought I'd just update you on this:

I just installed Ubuntu 13.10 on a completely different laptop, installed Netbeans    (cant remember the version- the C++ one currently on the website), installed latest boost libraries, gcc 4.8.1, g++ 4.8.1 and I got the exact same problem. I then tried with a small file- worked fine.

I'll try your steps soon (its not on this laptop)
Comment 11 faa77 2013-12-13 01:15:54 UTC
If you download this file and un-zip it, its the exact same 350MB file I was using:

ftp://ftp.cmegroup.com/datamine_sample_data/md/mdff_cme_20130714-20130715_7817_0.zip
Comment 12 henk89 2014-01-13 13:17:33 UTC
This is a GDB bug but I can suggest you a workaround:
as your file is represented like an array you can set the gdb.print.elements property for the suitable value in order to avoid freezes. This property tells NB how much element should be printed.