![]() |
stack overflow failure
hello,
i want to intentionally bypass the statement x=1; in the below program.but was unable to do. i am using gcc and gdb on fedora 8 linux on AMD64 machine. what i am getting is just segmentation fault. please put some points how to do that. thanks. :) Code:
/*................. This program writes bypass a particular statement by process stack overflow and return to the statement pass x=1 tp printf.... */ |
Re: stack overflow failure
This won't work if your calling convention is cdecl because the caller cleans up the stack, so by skipping the x=1 statement you also skip the stack cleanup code and thus leak stack memory (stack memory, which is more severe than heap memory cos there's usually a lot less).
This shouldn't cause a crash though, so what you'll need to do is to step through the code at the assembler level to find out where it's going wrong. Probably your calculations are off by a few. A better solution is to return a value and let the caller decide what to do, e.g. Code:
if (function(1,2,3)) |
Re: stack overflow failure
i can skip the statement x=1,but i wanted to do it through stack overflow.I am using linux machine with AMD64 processor..i going through all the gibberish in assembly level.i am using gcc and gdb.i am off but how much i am not able to determine.
thanks for help anyways. :) |
| All times are GMT +5.5. The time now is 09:43. |