CPP 1.3 MAILINGLIST Avatar
  1. OMG Issue

CPP13 — UnknownUserException and stubs

  • Key: CPP13-28
  • Legacy Issue Number: 3246
  • Status: open  
  • Source: Triodia Technologies Pty Ltd ( Michi Henning)
  • Summary:

    the spec currently says (page 1-101):

    Request invocations made through the DII may result in
    user-defined exceptions that cannot be fully represented
    in the calling program because the specific exception type
    was not known at compile-time. The mapping provides the
    UnknownUserException so that such exceptions can be represented
    in the calling process: [...]

    Here is a code snippet for the DII:

    req->invoke();
    if (req->env()->exception())

    { // Got an exception CORBA::Exception * ep = req->env()->exception(); // ... }

    The para on page 1-101, by implication, says that:

    • If there are concrete C++ types available in the caller that
      can represent the user exception, a real user exception is
      instantiated and the pointer returned by exception() points
      at the concrete user exception instance.
    • If there is no concrete C++ type available in the caller for
      a user exception, the pointer returned by exception() points
      at an instance of UnknownUserException.

    It's not as clearly spelled out as this, but it can be implied from the
    words on page 1-101.

    This is bad. For one, it implies "action at a distance". For example,
    linking the stubs for a user exception into a completely unrelated
    part of the same binary (possibly via a library) would change
    the behavior of the above DII call. Further, to make this behavior
    happen would require some form of global initialization data structure.
    In effect, there would have to be something that would let the ORB
    know (globally) for which user exceptions stub code is linked in.

    We rejected the need for global data recently in another context (for
    the proposed extraction operator for user exceptions). For the same reason,
    we should reject this here and mandate that, if I use the DII, all user
    exceptions are always returned as UnknownUserException.

  • Reported: CPP 1.1 — Tue, 25 Jan 2000 05:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT