
| Key: |
STDCXX-643
|
| Type: |
Bug
|
| Status: |
Open
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Travis Vitek
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
IBM XLC++/AIX
|
|
Issue Links:
|
Blocker
|
|
This issue blocks:
|
|
STDCXX-644
[IBM XLC++ 9.0/AIX 5.3] SIGHUP in 19.exceptions.mt
|
|
|
|
|
|
|
|
| Severity: |
Binary Incompatibility
|
made changes - 02/Nov/07 10:31 PM
| Field |
Original Value |
New Value |
|
Severity
|
Incorrect Behavior
|
Binary Incompatibility
|
made changes - 27/Mar/08 07:33 AM
|
Comment
|
[ I've already suggested that we try to determine, at configuration time, the size and layout of the exception classes so that we can emulate them. If we don't go that far, we should at least add something that will check that the sizes match up and force the library to not compile if they don't. Something like this...
{noformat}
// looking for runtime library exceptions
#include <exception>
#include <typeinfo>
#include <stdio.h>
template <class T>
void run_test (const char* s)
{
printf ("#define %-18s %u\n", s, sizeof (T));
}
int main ()
{
#define TEST(s,t) run_test<t>(#s)
TEST (_RWSTD_EXCEPTION_SIZE , std::exception);
TEST (_RWSTD_BAD_ALLOC_SIZE , std::bad_alloc);
TEST (_RWSTD_BAD_CAST_SIZE , std::bad_cast);
TEST (_RWSTD_BAD_EXCDEPTION_SIZE, std::bad_exception);
TEST (_RWSTD_BAD_TYPEID_SIZE , std::bad_typeid);
return 0;
}
{noformat}
Then we would put something like this near the top of exception.cpp
{noformat}
_RWSTD_NAMESPACE (__rw) {
static void
__rw_exception_compile_asserts ()
{
#define TEST(s,t) _RWSTD_COMPILE_ASSERT (s == sizeof (t))
TEST (_RWSTD_EXCEPTION_SIZE , std::exception);
TEST (_RWSTD_BAD_ALLOC_SIZE , std::bad_alloc);
TEST (_RWSTD_BAD_CAST_SIZE , std::bad_cast);
TEST (_RWSTD_BAD_EXCDEPTION_SIZE, std::bad_exception);
TEST (_RWSTD_BAD_TYPEID_SIZE , std::bad_typeid);
#undef TEST
}
} // namespace rw
{noformat}
]
|
|
made changes - 27/Mar/08 07:34 AM
|
Comment
|
[ I have already suggested that we determine the size and layout of the exception classes, and that we emulate them in our implementation. If we don't do that, then at the very least we should do a configuration test and a compile assert. That way the library won't build if our implementation doesn't match the runtime library. I would hope that something like this would work.
{noformat}
// looking for runtime library exceptions
#include <exception>
#include <typeinfo>
#include <stdio.h>
template <class T>
void run_test (const char* s)
{
printf ("#define %-18s %u\n", s, sizeof (T));
}
int main ()
{
#define TEST(s,t) run_test<t>(s)
TEST ("_RWSTD_EXCEPTION_SIZE" , std::exception);
TEST ("_RWSTD_BAD_ALLOC_SIZE" , std::bad_alloc);
TEST ("_RWSTD_BAD_CAST_SIZE" , std::bad_cast);
TEST ("_RWSTD_BAD_EXCDEPTION_SIZE", std::bad_exception);
TEST ("_RWSTD_BAD_TYPEID_SIZE" , std::bad_typeid);
return 0;
}
{noformat}
And then, near the bottom of <exception>, we would write
{noformat}
_RWSTD_NAMESPACE (__rw) {
// used only to guarantee that we are binary compatible with the runtime library
inline void
__rw_exception_compile_asserts ()
{
_RWSTD_COMPILE_ASSERT (_RWSTD_EXCEPTION_SIZE == sizeof (_STD::exception));
_RWSTD_COMPILE_ASSERT (_RWSTD_BAD_ALLOC_SIZE == sizeof (_STD::bad_alloc));
_RWSTD_COMPILE_ASSERT (_RWSTD_BAD_CAST_SIZE == sizeof (_STD::bad_cast));
_RWSTD_COMPILE_ASSERT (_RWSTD_BAD_EXCEPTION_SIZE == sizeof (_STD::bad_exception));
_RWSTD_COMPILE_ASSERT (_RWSTD_BAD_TYPEID_SIZE == sizeof (_STD::bad_typeid));
}
} // namespace rw
{noformat}
]
|
|
made changes - 27/Mar/08 09:20 PM
|
Environment
|
AIX
|
IBM XLC++/AIX
|
|
Summary
|
std::exception declaration incompatible with implementation provided by runtime library on AIX
|
[IBM XLC++/AIX] std::exception incompatible with runtime library
|
made changes - 17/Jul/08 11:54 PM
|
Assignee
|
|
Travis Vitek
[ vitek
]
|
made changes - 11/Jul/09 12:07 AM
|
Assignee
|
Travis Vitek
[ vitek
]
|
|
|