Advertisement
MBJ

GDB_Recording_Error_Log

MBJ
Jun 19th, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.73 KB | None | 0 0
  1. Breakpoint 1 at 0x4005d0: file main.c, line 13.
  2. Function "exit" not defined.
  3. Make breakpoint pending on future shared library load? (y or [n]) Breakpoint 2 (exit) pending.
  4.  
  5. (gdb) echo: I typed y
  6.  
  7. Starting program: /home/ivuser/Desktop/Learning/GDB_testing/StackErrorTesting/main
  8.  
  9. Breakpoint 1, main () at main.c:13
  10. 13 uint8_t size = 32;
  11. 14 long array[size]; /* part of the error: given an element size that's smaller than sizeof array*/
  12. 15 int i = 0;
  13. 17 srand(time(NULL)); /* seeds the rand() fnc */
  14. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  15. 23 array[i] = rand();
  16. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  17. 23 array[i] = rand();
  18. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  19. 23 array[i] = rand();
  20. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  21. 23 array[i] = rand();
  22. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  23. 23 array[i] = rand();
  24. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  25. 23 array[i] = rand();
  26. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  27. 23 array[i] = rand();
  28. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  29. 23 array[i] = rand();
  30. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  31. 23 array[i] = rand();
  32. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  33. 23 array[i] = rand();
  34. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  35. 23 array[i] = rand();
  36. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  37. 23 array[i] = rand();
  38. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  39. 23 array[i] = rand();
  40. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  41. 23 array[i] = rand();
  42. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  43. 23 array[i] = rand();
  44. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  45. 23 array[i] = rand();
  46. 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
  47. 28 sort(array,size);
  48. 30 return 0;
  49. 31 }
  50. 0x00000000004006b8 31 }
  51. 0x00000000004006b9 31 }
  52. 0x00000000004006bb 31 }
  53. 0x00000000004006bd 31 }
  54. 0x00000000004006be 31 }
  55. __libc_start_main (main=0x4005bd <main>, argc=1, argv=0x7fffffffe338, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe328) at libc-start.c:321
  56. 321 libc-start.c: No such file or directory.
  57. 0x00007ffff7a32f47 321 in libc-start.c
  58.  
  59. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  60. 104 exit.c: No such file or directory.
  61. Kill the program being debugged? (y or n)
  62. Using echo again: I stepped thru my C file with next, waited until the return then used si (step by one instruction)
  63. until I reached a point where gdb placed a breakpoint (b 2)
  64. I then killed the program.
  65.  
  66. Now I am creating the two commands, which won't output in the log file. This is what I typed:
  67. command 1
  68. Type commands for breakpoint(s) 1, one per line.
  69. End with a line saying just "end".
  70. >record
  71. >continue
  72. >end
  73.  
  74. command 2
  75. Type commands for breakpoint(s) 2, one per line.
  76. End with a line saying just "end".
  77. >run
  78. >end
  79.  
  80. echo: Here I will hit run and the loop should be going until the error shows up.. then I should theoretically be able to reverse step thru the recording but I cannot.
  81.  
  82. Starting program: /home/ivuser/Desktop/Learning/GDB_testing/StackErrorTesting/main
  83.  
  84. Breakpoint 1, main () at main.c:13
  85. 13 uint8_t size = 32;
  86.  
  87. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  88. 104 exit.c: No such file or directory.
  89.  
  90. Breakpoint 1, main () at main.c:13
  91. 13 uint8_t size = 32;
  92.  
  93. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  94. 104 exit.c: No such file or directory.
  95.  
  96. Breakpoint 1, main () at main.c:13
  97. 13 uint8_t size = 32;
  98.  
  99. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  100. 104 exit.c: No such file or directory.
  101.  
  102. Breakpoint 1, main () at main.c:13
  103. 13 uint8_t size = 32;
  104.  
  105. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  106. 104 exit.c: No such file or directory.
  107.  
  108. Breakpoint 1, main () at main.c:13
  109. 13 uint8_t size = 32;
  110.  
  111. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  112. 104 exit.c: No such file or directory.
  113.  
  114. Breakpoint 1, main () at main.c:13
  115. 13 uint8_t size = 32;
  116.  
  117. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  118. 104 exit.c: No such file or directory.
  119.  
  120. Breakpoint 1, main () at main.c:13
  121. 13 uint8_t size = 32;
  122.  
  123. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  124. 104 exit.c: No such file or directory.
  125.  
  126. Breakpoint 1, main () at main.c:13
  127. 13 uint8_t size = 32;
  128.  
  129. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  130. 104 exit.c: No such file or directory.
  131.  
  132. Breakpoint 1, main () at main.c:13
  133. 13 uint8_t size = 32;
  134.  
  135. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  136. 104 exit.c: No such file or directory.
  137.  
  138. Breakpoint 1, main () at main.c:13
  139. 13 uint8_t size = 32;
  140.  
  141. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  142. 104 exit.c: No such file or directory.
  143.  
  144. Breakpoint 1, main () at main.c:13
  145. 13 uint8_t size = 32;
  146.  
  147. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  148. 104 exit.c: No such file or directory.
  149.  
  150. Breakpoint 1, main () at main.c:13
  151. 13 uint8_t size = 32;
  152.  
  153. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  154. 104 exit.c: No such file or directory.
  155.  
  156. Breakpoint 1, main () at main.c:13
  157. 13 uint8_t size = 32;
  158.  
  159. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  160. 104 exit.c: No such file or directory.
  161.  
  162. Breakpoint 1, main () at main.c:13
  163. 13 uint8_t size = 32;
  164.  
  165. Breakpoint 2, __GI_exit (status=0) at exit.c:104
  166. 104 exit.c: No such file or directory.
  167.  
  168. Breakpoint 1, main () at main.c:13
  169. 13 uint8_t size = 32;
  170. Process record: failed to record execution log.
  171.  
  172. [process 23854] #1 stopped.
  173. 0x0000000029f12d3f in ?? ()
  174.  
  175. echo: See the recording error? This means when I set a watchpoint on my stack pointer addres and reverse continue, it just goes to my breakpoint 1 (at main).
  176. Wherever the stack pointer changes to an invalid address, it is beyond the scope of my 'execution log'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement