In one aspect of the invention, the frames of a thread stack that
associated with the misbehaving code are popped from the thread stack.
Exception handling code is allowed to execute for trusted code by popping
the trusted code frame via processing an exception, but exception handling
is not allowed to execute for untrusted code. In a second aspect, frames
are popped on all thread stacks of all threads that are associated with
the misbehaving code. Threads are generally deemed to be associated with
the misbehaving code when the threads share a same object or the same
resources as the thread that is associated with the misbehaving code.