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.
Summary: | Output truncated during debug session in C++ | ||
---|---|---|---|
Product: | cnd | Reporter: | aschwarz1309 <aschwarz1309> |
Component: | Debugger | Assignee: | henk89 |
Status: | RESOLVED INCOMPLETE | ||
Severity: | normal | Keywords: | USABILITY |
Priority: | P3 | ||
Version: | 7.2.1 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | An example test case showing the issue |
Description
aschwarz1309
2012-11-15 21:35:43 UTC
Could you give me more information about how to reproduce the issue? Well I have a large amount of output(cout << data) in a single-threaded application. After return from the output function, I exit. If I exit prior to completion of the output, the output is truncated unless a sleep(1) is inserted. This happens during a debug session. I haven't looked at the Netbeans or other code but I think(?) that what is happening is that the output is deferred to an output thread, allowing output to proceed independently from execution. At termination from the main thread the runtime kernel (or Netbeans) does not check to see if the output thread is still active, viz., is processing a job. Instead, when the main thread terminates the debugger (Netbeans?) causes the output thread to terminate. Putting in a delay allows the output thread to complete before an automatic thread termination is executed. But, this is just a guess. If my guess is correct then the problem can be duplicated by having a C++ function output (about) 20,000 characters and then exit immediately on return while in a debug session. If the 'bug' occurs then the output should be truncated. Thanks for looking into this; art I'm still not able to reproduce the problem. Could you try using GDB from a terminal? As we stop GDB using a special GDB/MI command and GDB manages all the debugging process by itself, there seems to be no problem with a GDB termination. I'll try to generate a test case. Sorry about the delay, I was given a good case of bronchitis and forced to celebrate Thanksgiving (in the US). I'll try to be more diligent in my responses. art Created attachment 129428 [details]
An example test case showing the issue
cygwin gcc 4.5.3
gdb 7.5.50.20120815-cvs (cygwin-special)
The attachment has a test case. When the code is executed in the debugger without a breakpoint, the last 4 functions calls are not output and the first func2() generates a header line and some text. When the 'sleep(1)' statement is uncommented all lines are output.
Forgive the code. This is a test case.
Please, attach the gdb log from the session. http://wiki.netbeans.org/GdbLog I tried the both scenarios. The output was absolutely the same. http://stackoverflow.com/questions/16733148/it-seems-that-stdflush-doesnt-work-with-stdcout Reproduces also on Linux environment. |