the GDB process terminated unexpectedly (exit code3) - debugging

i am coding in Qt 5.7 on win 7. my app is run correctly. but when i use the debugger, a error dialog box showed: the GDB process terminated unexpectedly (exit code3).
last part of debugger log :
>~"../../../../src/gdb-7.10.1/gdb/utils.c:1071: internal-error: virtual memory exhausted.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nCreate a core file of GDB? "
>~"(y or n) [answered Y; input not from terminal]\n"
dUNEXPECTED GDB STDERR:
dThis application has requested the Runtime to terminate it in an unusual way.
dPlease contact the application's support team for more information.
dGDB PROCESS FINISHED, status 0, exit code 3
dNOTE: ENGINE ILL ******
dFORWARDING STATE TO InferiorShutdownFailed
dState changed BY FORCE from InferiorStopOk(14) to InferiorShutdownFailed(17) [master]
dState changed from InferiorShutdownFailed(17) to EngineShutdownRequested(19) [master]
dQUEUE: SHUTDOWN ENGINE
dCALL: SHUTDOWN ENGINE
dPLAIN ADAPTER SHUTDOWN 19
dINITIATE GDBENGINE SHUTDOWN IN STATE 14, PROC: 0
dNOTE: ENGINE SHUTDOWN OK
dState changed from EngineShutdownRequested(19) to EngineShutdownOk(21) [master]
dState changed from EngineShutdownOk(21) to DebuggerFinished(22) [master]
dQUEUE: FINISH DEBUGGER
dNOTE: FINISH DEBUGGER
dHANDLE RUNCONTROL FINISHED
sDebugger finished.
in a part of my code i used QVector:
int logic_points_number=5;
int logic_input_points[16][logic_points_number] ;
QVector<double> x1_1(2*logic_points_number);
QVector<double> y1_1(32*logic_points_number);
x1_position=x1_last_position_logic;//start from last drawn point
for(int logic_channel=0;logic_channel<16;logic_channel++){
for (int i=0;i<logic_points_number ;i++){
if (logic_channel==0)// set x1_1 only for first channel
x1_1[2*i]= x1_position;
y1_1[(2*logic_channel*logic_points_number)+(2*i)]=(16.2-logic_channel)+(0.6*logic_input_points[logic_channel][i]);
if (logic_channel==0){// set x1_1 and x1_position only for first channel
x1_position = x1_position + x1_step_logic;
x1_1[(2*i)+1]= x1_position;
}
y1_1[(2*logic_channel*logic_points_number)+(2*i)+1]=(16.2-logic_channel)+(0.6*logic_input_points[logic_channel][i]);
}
}
x1_last_position_logic= x1_position;//Set new last drawn point
}
in run there is no problem. when i delete the above code, there is no problem in debugger.
there is no helpful answer in google.what i shall to do?
thanks

In my case error code was 'the cdb process terminated unexpectedly (code -805306181)'. Changing debugger from 32 bit app debugger to 64 bit app debugger fixed this issue

Related

Unable to demangle while trying to remote debug C++ with vscode

I am trying to debug remote application with vscode insiders and ssh remote. If I set
"externalConsole": true
in launch.json it doesn't work at all. If I set it to false it works, but breakpoints are impossible. If I set
"stopAtEntry": true
it runs and stops at first line of the program, but if any breakpoint set gdb ends with error
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/cp-support.c:1608: demangler-warning: unable to demangle '...' (demangler failed with signal 11)
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
ERROR: GDB exited unexpectedly. Debugging will now abort.
what can be done?

'Failed to halt - Process 1932 has exited with status 0'

I've only recently started experiencing an issue in Visual Studio Code while running applications in debug mode, I always get this error:
Failed to halt - Process 2152 has exited with status 0
Just after main() function exits, even when I import only fmt package and print "Hello World", or running applications those were previously working.
I pulled same project on another machine and run it (for example "Hello World" project). I'm getting the same error message.
Has anyone else experienced the same? It doesn't seem to occur when I run built applications using cmd (command prompt).

Cygwin, error for make "couldn't get proc lock" when compiling and running a C program

Problem
I have some half-year old c-programs I was working on and had hoped that I could continue working on them now. I did installed windows 10 (64-bit) right after that, so I thought could be a problem but the programs have run on windows 10 since then.
About 2 months ago, I could build with the make-file and run the executables but when I tried again today, it seems to me like the executables are not running. I have now also tried updating cygwin and (I think) all relevant packages.
I have googled if there are any important changes to cygwin but I didn't really find anything.
Details
When I try running any program nothing happens for a long while at the ./executeables/helloworld.exe line and then eventually producing the error:
$ make 1
gcc 1-helloworld.c -o ./executeables/helloworld.exe -lncurses
./executeables/helloworld.exe
0 [sig] make 7332 get_proc_lock: Couldn't acquire sync_proc_subproc for(5, 1), last 7, Win32 error 0
1324 [sig] make 7332 proc_subproc: couldn't get proc lock. what 5, val 1
After this, nothing happens and I cannot even stop the process with ctrl+C so I have to end "make.exe" (which oddly enough consists of 2 processes) with task manager. The terminal then says nothing more than
makefile:2: recipe for target '1' failed
make: *** [1] Error 1
So I'm guessing there is a problem with getting a mutex or a lock from windows for creating a process, but I have no clue why this would happen.
Code
The example in this try uses this code for a hello world program, but it's the same for the more complex programs as well.
#include <ncurses.h>
#include <string.h>
int main() {
char *message="Hello World";
int row,col;
int len = strlen(message);
initscr();
getmaxyx(stdscr, row, col); //screensize
mvprintw(row/2, (col-len)/2, "%s", message); //center of screen
getch();
refresh();
endwin();
return 0;
}
Have anyone seen this problem before?
Avast antivirus was preventing the program from running correctly. Disabling it made everything run perfectly. I finally found the answer in this thread:
Netbeans 8.1 IDE compiles and builds C programs but does not show their output
note:
Since it is not marked as an answer to the question in that thread and because that question is not explicitly focusing the same error (although presents the same error), I will keep my question instead of marking it as a duplicate.
Thank you, Sheshadri Iyengar for providing the solution.

What are the exit status codes for the G-WAN executable?

I'm trying to serve a big number of small files with G-WAN (version 4.3.14, started with sudo on 64-bit Ubuntu 14.04.3). I start hammering it with requests over a single connection using wget to provide base URL and a file with a list of the URL suffixes. At some point, which is different for different runs, the gwan executable silently exits. There's no trace in the gwan log or in the site error log (I did change '_log' to 'log' to enable logging). The exit status code is 139. What does it mean? When I stop it with Ctrl-C the exit code is 130.
Is there a reference for the exit status codes? I cannot find any with Google.
First, Ubuntu 14.04.3 is very recent while G-WAN v4.3.14 is very old. Almost every new OS release introduces cincompatibilities that require patches and this is why we have to issue more recent releases for registered users. This explains the 'silent exits' that you are experiencing.
Second, process exits codes can be found this way:
./gwan -h
echo $?
0
Zero means no error, and any other value is an error (mixing system flags to be as informative as possible). That's why Ctrl+C returns 130: Control-C is fatal error signal 2, (130 = 128 + 2).

How to simulate process/daemon crash on OSX?

How can I invoke/simulate process/daemon crash on OSX and as result to receive crash report in
/Library/Logs/DiagnosticRepors
(e.g. opendirectoryd_2013-06-11-125032_macmini61.crash)?
I tried to make force quit for daemons using Activity Monitor but didn't receive any report. I need to crash some system or third party process (NOT developed by myself).
You can force almost any process to crash by sending it a "segmentation violation" signal.
Example: Find process id of "opendirectoryd":
$ ps -ef | grep opendirectoryd
0 15 1 0 9:14am ?? 0:01.11 /usr/libexec/opendirectoryd
^-- process id
Send signal to the process:
$ sudo kill -SEGV 15
This terminates the process and causes a diagnostic report to be written,
as can be verified in "system.log":
Oct 31 09:17:17 hostname com.apple.launchd[1] (com.apple.opendirectoryd[15]): Job appears to have crashed: Segmentation fault: 11
Oct 31 09:17:20 hostname ReportCrash[420]: Saved crash report for opendirectoryd[15] version ??? (???) to /Library/Logs/DiagnosticReports/opendirectoryd_2013-10-31-091720_localhost.crash
But note that deliberately crashing system services might cause severe problems (system instability, data loss, ...), so you should know exactly what you are doing.
Unless you can find a legitimate bug and get it to crash that way, you can't externally crash a daemon in such a fashion that it will result in a diagnostic report. All of the quit-forcing functions are exempt from diagnostic reports as they are external issues.

Resources