This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Exception handling contexts


I'm hoping someone can help me here:

I have a userland threading system which simply mallocs a stack and
sets %esp to it. By using longjmp and setjmp to save state it's a very
nice way to do threads.

However, exception handling breaks.

I null out the frame pointer in the first function of the new thread,
which keeps the stack tidy, but I'm guessing exception handling uses
some structure that i'm fscking (eh_context seems a good candidate
from looking at the source)

#0  0x4014586f in __frame_state_for () from /usr/lib/libstdc++-libc6.2-2.so.3
#1  0x40144ab8 in exception::what () from /usr/lib/libstdc++-libc6.2-2.so.3
#2  0x40144e1a in exception::what () from /usr/lib/libstdc++-libc6.2-2.so.3
#3  0x40144e85 in exception::what () from /usr/lib/libstdc++-libc6.2-2.so.3
#4  0x40145668 in __frame_state_for () from /usr/lib/libstdc++-libc6.2-2.so.3
#5  0x40143f65 in __throw () from /usr/lib/libstdc++-libc6.2-2.so.3
#6  0x808a821 in Thread::start (this=0x8110eb8) at neuroses.cc:193

The code in Thread::start is:

try {
	throw 1;
    } catch (...) {}

Cc'ing to agl@linuxpower.org would be nice, thou I'll keep an eye on
the archives. Thanks.
    
Adam Langley

-- 
Just because you don't understand it doesn't mean that it doesn't work


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]