This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/221] C++ throw terminates ucontext_t context, instead of returning via uc_link


------- Additional Comments From drepper at redhat dot com  2004-08-10 02:26 -------
User contexts are no threads.  And they won't behave like this.  If you don't
catch an exception in one context the whole process dies.  That's the correct
behavior.

Not even threads have today the functionality of selecting whether only one
thread gets terminated in case of an uncaught exception, or as usual the whole
process.  There are talks about adding this extension and this actually might
make sense.  

For contexts all this is so underspecified that adding this functionality leads
to more problems.  Like, throw and exceptions from a signal handler; if the
currently used context is not prepared this will kill it even though the event
has nothing to do with the context.  And what would it mean if the currently
used context is replaced with the one addressed by uc_link?  The old context is
not really destroyed.  It can always be restarted.  The whole point behind user
contexts is that they under complete control of the user code.  The user code
must control the lifespan of the contexts.  The runtime cannot meddle with it.

And it is very simple for the user to implement something adequately: just
install the correct catch blocks in the initial function registered with
makecontext.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


http://sources.redhat.com/bugzilla/show_bug.cgi?id=221

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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