stack-overflow

return to libc - problem

浪尽此生 提交于 2019-12-03 13:52:17
I'm having problems with return-to-libc exploit. The problem is that nothing happens, but no segmentation fault (and yes I'm actually overflowing the stack). This is my program: int main(int argc, char **argv) { char array[512]; gets(array); } I'm using gets instead of strcopy, because my addresses start with 0x00 and strcpy thinks it's the end of a string, so I can't use it. Here are the addresses that I need: $ gdb main core (gdb) p system $1 = {<text variable, no debug info>} 0x179680 <system> (gdb) p exit $2 = {<text variable, no debug info>} 0x16f6e0 <exit> (gdb) x/s 0xbffffe3f 0xbffffe3f

Handling stack overflows in embedded systems

橙三吉。 提交于 2019-12-03 09:47:02
问题 In embedded software, how do you handle a stack overflow in a generic way? I come across some processor which does protect in hardware way like recent AMD processors. There are some techniques on Wikipedia, but are those real practical approaches? Can anybody give a clear suggested approach which works in all case on today's 32-bit embedded processors? 回答1: Ideally you write your code with static stack usage (no recursive calls). Then you can evaluate maximum stack usage by: static analysis

StackOverflowError in spring oauth2 with custom ClientDetailsService

霸气de小男生 提交于 2019-12-03 09:19:01
问题 I made my own implementation of ClientDetailsService: @Service public class JpaClientDetailsService implements ClientDetailsService { @Autowired private ClientRepository clientRepositoy; @Override public ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException { ClientDetails client = clientRepositoy.findOne(clientId); if (client == null) { throw new ClientRegistrationException(String.format("Client with id %s not found", clientId)); } return client; } }

Stackoverflow on Android 2.3.3 Devices Only

余生长醉 提交于 2019-12-03 09:00:54
问题 I been working on Native Android App where i face some bug on purticularly Android 2.3.3 versions and below Android 3.0 version . I am not getting where exactly am falling in my code because in Logcat Every Line of code compiled but at the end am getting very strange error describe log below: java.lang.StackOverflowError at java.util.concurrent.locks.ReentrantLock$NonfairSync.tryAcquire(ReentrantLock.java:189) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire

Why does this simple use of the State monad cause a stack overflow?

自作多情 提交于 2019-12-03 08:50:43
问题 I was playing around with the State monad, and I don't know what's causing the stack overflow in this simple piece of code. import Control.Monad.State.Lazy tick :: State Int Int tick = do n <- get put $! (n+1) return n million :: Int million = snd $ runState (mapM_ (const tick) [1..1000000]) 0 main = print million Note I would just like to know what's causing the problem in this piece of code, the task itself is not important per se. 回答1: The problem is that Control.Monad.State.Lazy's (>>=)

Recovering from stack overflow or heap exhaustion in a Haskell program

微笑、不失礼 提交于 2019-12-03 08:02:09
I am currently writting a genetic algorithm in Haskell in which my chromosomes are rather complex structures representing executable systems. In order for me to evaluate the fitness of my chromosomes I have to run an evolution function which performs one computational cycle of a given system. The fitness then is calculated just by counting how many times the evolution can be applied before there is no change in the system (in which case the system terminates). The problem now is as follows: some systems can run infinitely long and will never terminate - I want to penalise those (by giving them

Trying to smash the stack

拜拜、爱过 提交于 2019-12-03 07:47:26
I am trying to reproduce the stackoverflow results that I read from Aleph One's article "smashing the stack for fun and profit"(can be found here: http://insecure.org/stf/smashstack.html ). Trying to overwrite the return address doesn't seem to work for me. C code: void function(int a, int b, int c) { char buffer1[5]; char buffer2[10]; int *ret; //Trying to overwrite return address ret = buffer1 + 12; (*ret) = 0x4005da; } void main() { int x; x = 0; function(1,2,3); x = 1; printf("%d\n",x); } disassembled main: (gdb) disassemble main Dump of assembler code for function main: 0x00000000004005b0

How can I guarantee catching a EXCEPTION_STACK_OVERFLOW structured exception in C++ under Visual Studio 2005?

℡╲_俬逩灬. 提交于 2019-12-03 07:47:07
Background I have an application with a Poof-Crash [ 1 ]. I'm fairly certain it is due to a blown stack. The application is Multi-Threaded. I am compiling with " Enable C++ Exceptions: Yes With SEH Exceptions (/EHa) ". I have written an SE Translator function and called _set_se_translator() with it. I have written functions for and setup set_terminate() and set_unexpected() . To get the Stack Overflow, I must run in release mode, under heavy load, for several days. Running under a debugger is not an option as the application can't perform fast enough to achieve the runtime necessary to see the

Why does compiling this code cause a compiler stack overflow?

非 Y 不嫁゛ 提交于 2019-12-03 06:58:02
interface Pong<T> {} class Ping<T> implements Pong<Pong<? super Ping<Ping<T>>>> { static void Ping() { Pong<? super Ping<Long>> Ping = new Ping<Long>(); } } Trying to compile this gives the error: The system is out of resources. Consult the following stack trace for details. java.lang.StackOverflowError at com.sun.tools.javac.code.Types$23.visitClassType(Types.java:2579) at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:554) at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3260) at com.sun.tools.javac.code.Types$23.visitClassType(Types.java:2592) at com.sun.tools.javac

How do I use OData Expand like a SQL join?

做~自己de王妃 提交于 2019-12-03 06:44:39
问题 I'm trying to figure out how to accomplish the equivalent of: select * from Users u inner join Comments c on c.UserId = u.Id where Id = 1569 (table aliases for better sql readability) ...on the StackOverflow OData endpoint. How would this url be constructed? I'm looking at the documentation for Expand at OData.org and I would have thought it'd look something like: https://odata.sqlazurelabs.com/OData.svc/v0.1/rp1uiewita/StackOverflow/Users?$Expand=Comments&$filter=UserId eq 1569 but isn't