[lug] Linux threads programming
rm at fabula.de
rm at fabula.de
Mon Jan 13 05:45:35 MST 2003
On Mon, Jan 13, 2003 at 01:32:56PM +0100, Carlos Hernandez wrote:
> Hi all,
>
> We hope someone can give us a hint or redirect us to the right place.
>
> We want to be able to rollback the state of a single thread in a
> multithread program under Linux (Debian Woody 2.4.20)
>
> What we're doing is : create a process with a few threads (each thread
> has a stack size of 10K), periodically save the stack of one of them in
> a file. Eventually, that thread exits, then we create another one and
> try to recover the state saved in the file.
Just for my understanding: are you trying to implement some
sort of thread-local dump/undump by saving the C-callstack?
Hmm, if so, how do you intend to deal with absolute addresses stored
on the stack? If your stack holds addresses from _within_ the stack
(like local pointers that get passed down in function calls) these
pointers will be dangling after undumping.
Ralf Mattes
> We're using sigsetjmp and siglongjmp functions. We are able to save the
> stack of the thread, but when we try to recover, the program aborts.
> Obviusly we're touching in prohibited place.
>
> The example is attached in case someone want to have a look.
>
> Any hints or comments are appreciate.
>
> Thanks a lot.
>
> Carlos
>
>
>
>
>
More information about the LUG
mailing list