Gdb Error Cannot Find Bounds Of Current Function
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the cannot find bounds of current function code blocks company Business Learn more about hiring developers or posting ads with us Stack Overflow
Gdb Step Cannot Find Bounds Of Current Function
Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 gdb single step assembly million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why I do get “Cannot find bound of current function” when I overwrite the ret address of a vulnerable program? gdb print stack up vote 3 down vote favorite 2 I want to exploit a stack based buffer overflow for education purposes. There is a typical function called with a parameter from main, which is given as input from the program a local buffer where the parameter is saved. Given an input such that nops+shellcode+address_shellcode, I will exploit it. After debugging with gdb I found the address of the shell code as it will pass as
Gdb Disassemble
a parameter, and right after the strcpy I examine the stack and the $ebp+8 which is the return address has successfully overwritten with the address of the shell code. So I have what I want. But when I stepped forward the execution I got: ->shellcode_address in ?? () and then Cannot find bound of current function The return address has the value that I want. Any ideas what is happening? Also when I execute it I got a segmentation fault and I have compile it with -g -fno-stack-protector. Why? c stack buffer-overflow shellcode share|improve this question edited Apr 14 at 18:19 Mogsdad 24.6k955123 asked Jan 5 '12 at 11:11 curious 62911030 Take a look at stackoverflow.com/questions/2420813/…, it explains that "Cannot find bounds of current function" just means gdb doesn't have debug info for the current instruction pointer, and that it's unhappy with this state of affairs. But you probably have another problem in addition to that. –Steve Jessop Jan 5 '12 at 11:30 How could i add debug info for the nop instruction, which is followed by other nops and in the end with shellcode? –curious Jan 5 '12 at 11:52 I don't know exactly how gdb works, but I expect you can't. gdb looks up the address of the instructi
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business gdbtui Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation gdb cheat sheet Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just
Gdb Commands
like you, helping each other. Join them; it only takes a minute: Sign up Cannot find bounds of Current function up vote 0 down vote favorite I'm implementing an insertion sort on a 16384 array on C. The http://stackoverflow.com/questions/8741493/why-i-do-get-cannot-find-bound-of-current-function-when-i-overwrite-the-ret-ad sorting algorithm is functioning properly but when the free(inser) command is encountered, the debugger is outputting the Cannot find bounds of current function error. Can this be caused because I'm using a 32-bit mingw on a 64-bit machine? int main(void) { int i,t,j; int *inser = malloc(sizeof(int)*16384); int *shell = malloc(sizeof(int)*16384); srand(time(NULL)); for(i=0;i<=16384;i++){ *(inser+i) = rand()% 17000;; *(shell+i) = *(inser+i); } for(i=1;i<=16384;i++){ j = i-1; while((*(inser+i)<*(inser+j)) && (j >=0)){ t = *(inser+i); *(inser+i) = *(inser+j); http://stackoverflow.com/questions/22838955/cannot-find-bounds-of-current-function *(inser+j) = t; j--; i--; } } for(i=0;i<=16384;i++){ printf("%d\t",*(inser+i)); } free(inser); free(shell); return 0; } c debugging bounds share|improve this question edited Apr 3 '14 at 15:42 Emmet 3,5171024 asked Apr 3 '14 at 13:16 user2035045 1215 1 The memory you allocate can be used as an array, with array-like indexing (e.g. inser[i] instead of *(inser+i)). When you do that you might realize that your loops will step out of bounds. –Joachim Pileborg Apr 3 '14 at 13:20 5 i<=16384 --> i<16384 –BLUEPIXY Apr 3 '14 at 13:20 add a comment| 4 Answers 4 active oldest votes up vote 1 down vote Apart from the loop bounds error, which has been pointed out by others, look at the line marked “WARNING”, below (I also cleaned up your code to make it more readable). On this line, when j starts off as zero, j becomes -1. This value will then be used here: while( inser[i] < inser[j] && j >= 0 ) { ... } The logical “and”, &&, is a shortcut operator: its left-hand side (LHS) is always evaluated, and the right-hand side is only evaluated if the LHS evaluates to “true”. So inser[-1] will always be evaluated after the last inner loop iteration because j has been decremented from 0 to -1 by j-- before the final loop test wh
Log In [x] | Forgot Password Login: [x] Bug9107 - GDB cannot continue debugging after error "Cannot find bounds https://sourceware.org/bugzilla/show_bug.cgi?id=9107 of current function" Summary: GDB cannot continue debugging after error "Cannot http://forums.codeblocks.org/index.php?topic=17700.0 find bounds of current func... Status: RESOLVED INVALID Alias: None Product: gdb Classification: Unclassified Component: gdb (show other bugs) Version: 6.3 Importance: P3 normal Target Milestone: --- Assignee: Not yet assigned to anyone URL: Keywords: Depends on: Blocks: Reported: 2005-09-01 07:38 UTC by tommi.hoynalanmaa cannot find Modified: 2015-05-13 19:44 UTC (History) CC List: 4 users (show) dje drow gdb-prs tommi.hoynalanmaa See Also: Host: Target: Build: Last reconfirmed: Attachments projekt8-0.1.tar.gz (92.54 KB, application/octet-stream) , tommi.hoynalanmaa Details View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description tommi.hoynalanmaa cannot find bounds 2005-09-01 07:38:13 UTC [Converted from Gnats 2002] I am not sure if this is a bug or a problem with the application binary files. When debugging a program with "auto-solib-add" and "stop-on-solib-events" both on GDB sometimes gives error "Cannot find bounds of current function" and it is then unable to continue debugging. Here is an example session: ----- GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...~"Using host libthread_db library \"/lib/tls/libthread_db.so.1\".\n" ~"\n" (gdb) -gdb-set auto-solib-add 1 ^done (gdb) -gdb-set stop-on-solib-events 1 ^done (gdb) -break-insert -t main ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x08049514",func="main",file="main.c",line="21",times="0"} (gdb) -exec-run ^running (gdb) ~"Stopped due to shared library event\n" *stopped,thread-id="0" (gdb) -exec-next 1 ^running (gdb) ~"Single stepping until exit from function _dl_debug_state, \n" ~"which has no line number information.\n" *stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x40001f6c",func="??",args=[],from="/lib/ld
to check the nightly builds in the forum. Home Help Search Login Register Wiki Code::Blocks » User forums » General (but related to Code::Blocks) » Cannot find bounds of current function? « previous next » Send this topic Print Pages: [1] Go Down Author Topic: Cannot find bounds of current function? (Read 12948 times) huzhongshan Multiple posting newcomer Posts: 109 Cannot find bounds of current function? « on: March 25, 2013, 04:34:25 am » I use codeblocks (12.11 TDMgcc 4.7.1 ) to debug a dll , I write a application to call dll functions (dll compiled with -g , no optimization) , when I step into function in dll , Debugger says "Cannot find bounds of current function" Logged jens Administrator Lives here! Posts: 7062 Re: Cannot find bounds of current function? « Reply #1 on: March 25, 2013, 06:13:53 am » And where is the relation to C::B ?It looks either like a compiler, gdb or user issue.In the first two case ask in the appropriate forums, mailing lists or irc-channels of gcc or gdb.To be sure it's not the last case, double-check the build options of your dll and your application, and check that the correct version of the dll is used.ANd please reread the forum rules. Logged Fedora package maintainer for Code::BlocksJens' Debian - nightlies (and release)Fedora [23 - 25]- and CentOS/RedHat 7 - nightlies huzhongshan Multiple posting newcomer Posts: 109 Re: Cannot find bounds of current function? « Reply #2 on: March 25, 2013, 08:16:22 am » Quote from: jens on March 25, 2013, 06:13:53 amAnd where is the relation to C::B ?It looks either like a compiler, gdb or user issue.In the first two case ask in the appropriate forums, mailing lists or irc-channels of gcc or gdb.To be sure it's not the last case, double-check the build options of your dll and your application, and check that the correct version of the dll is used.ANd please reread the forum ru