Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with catching exceptions under Linux

0 views
Skip to first unread message

David V

unread,
Apr 26, 2002, 11:03:56 AM4/26/02
to
We have a X/Motif/OpenGL code that's now running on 3 platforms:

- SGI irix
- PC-NT (professional)
- PC-Linux

and have found a peculiar problem with the Linux version:

Whenever an exception gets thrown from within the Xt main event loop
(i.e., somewhere on the stack after the call to XtAppMainLoop() ), the
default exception handler gets called even though the a catch for both
our own error handler (EUtl) and any other catch(...) resides just
after the call to XtAppMainLoop().

We're wondering if this is a known problem with the Xt lib under Linux,
something with gcc, or maybe the Xm library? The same code compiled
under irix works just fine. Any advice would be helpful.

Thanks - David

rossb

unread,
Apr 26, 2002, 7:28:19 PM4/26/02
to
David V <dav...@nospamdavis-eng.com> wrote in message news:<pan.2002.04.26.11....@nospamdavis-eng.com>...

Hmmmm. When I last looked at XFree86, Xt was C code. Exception
handling, try, throw, catch style is C++. I am intrigued to know how
the other systems manage to generate a C++ exception that you can
catch.

I understand that Windows has some sort of mechanism that uses C++
exceptions to handle signals, but that is entirely non-standard - and
not even a very good idea.

This is from the XFree86 version 4.10 source for Xt in Error.c:

/* The error handlers in the application context aren't used since we
can't
come up with a uniform way of using them. If you can, define
GLOBALERRORS to be FALSE (or 0). */

It is also doubtful that you can throw an exception through a layer of
C code between two C++ functions. I will test this, and get back.

So basically, it would appear that what you are trying probably cannot
be done.

Brenton

0 new messages