This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11223] dynamic_cast<> in shared library fails with SegFault when called from JNI
- From: "lemehmet at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2003 21:36:54 -0000
- Subject: [Bug c++/11223] dynamic_cast<> in shared library fails with SegFault when called from JNI
- References: <20030617154510.11223.lemehmet@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11223
------- Additional Comments From lemehmet at hotmail dot com 2003-06-24 21:36 -------
I believe the problem does not belong to Java or any other process that
provides an interface to extend or customize functionality with shared
objects. The process just loads the object in a predefined way, and the rest
is run-time's responsibility.
A shared object has to be loadable from any process, independent from the
build environment used to create the shared object or the process. It could be
shame to tell it here, but a good example anyway, Windows DLLs loads smoothly
even they are created with the worst kind of compilers.
If the code were in C, I guess it would work as smooth as it would in Windows
environment. And if I knew that C++ compilers are not yet as stable and
compliant on other platforms as on Microsoft based ones, I wouldn't even
consider using C++ and stick to good old C. This is a problem report, so I
don't want to complain much, but in need to do some anyway, I spent most of
the porting time dealing with Sun's or other's C++ compiler bugs/features.
Aren't there a published C++ standard anyway? I guess that's why Java has its
publicity success.
Back to the subject, please correct me if I am so spoiled with Windows
environment, when a code is compiled and linked into a shared object it is
usable regardless of the build environment, surely with the supply of correct
run time libraries. Thus, asserting "it works with GCJ but not with Sun Java"
is void. C++ clearly states the functionality of dynamic_cast, why should a
standards aware C++ programmer worry about linkage method? What if it were
used in a static library that could be used to linked into a shared object?
How could the author of the static library that uses dynamic_cast cease from
the SegFault?