4

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

javad
  • 83
  • 2
  • 7
  • gdb got the error `internal-error: virtual memory exhausted.`. Either your entire system ran out of virtual memory (but Windows would have given you a warning in advance about that), or gdb is running into some per-process limits as described in [PerfGuide: Out of Process Virtual Memory](https://social.technet.microsoft.com/wiki/contents/articles/2361.perfguide-out-of-process-virtual-memory.aspx). Maybe you have a 32-bit gdb. Where did you download gdb from? – Mark Plotnick Feb 15 '17 at 16:06
  • i don't know what the virtual memory is ?! but i checked the ram from task manager and it is in 45% at max. my debugger is 32 bit(MinGW_32bit-Debug) that downloaded With Qt pack from Qt Website. – javad Feb 16 '17 at 16:27
  • 1
    SOLVED by installing mingw-w64 from:[https://netix.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe] – javad Feb 19 '17 at 14:30
  • Thanks I will test this solution but do you know why this is happening? – Mohamed Amine Ouali Feb 24 '17 at 15:57

1 Answers1

2

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

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • 1
    I already have QT 5,14,2 MinGW 64 bit but facing same problem – Imran Aug 17 '20 at 11:37
  • On Windows my experience is only with microsoft compiler. For MinGW, I guess one should use "GNU gdb X.Y for MinGW M.M.Q 64bit" (second line in the debuggers list) – Davit Kalantaryan Feb 03 '21 at 13:34