This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
PATCH: Fix PR libgcj/341
- To: java-patches at sourceware dot cygnus dot com
- Subject: PATCH: Fix PR libgcj/341
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Fri, 06 Oct 2000 18:39:47 +1300
This patch fixes Throwable.printStackTrace() on Red Hat 7.0
regards
[ bryce ]
2000-10-06 Bryce McKinlay <bryce@albatross.co.nz>
* name-finder.cc (lookup): Don't trust dladdr() if the address is from
the main program. Fix for PR libgcj/341.
Index: name-finder.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/name-finder.cc,v
retrieving revision 1.4
diff -u -r1.4 name-finder.cc
--- name-finder.cc 2000/05/30 23:26:02 1.4
+++ name-finder.cc 2000/10/06 05:34:30
@@ -136,6 +136,7 @@
bool
_Jv_name_finder::lookup (void *p)
{
+ extern char **_Jv_argv;
toHex (p);
#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
@@ -146,7 +147,10 @@
{
strncpy (file_name, dl_info.dli_fname, sizeof file_name);
strncpy (method_name, dl_info.dli_sname, sizeof method_name);
- return true;
+
+ /* Don't trust dladdr() if the address is from the main program. */
+ if (strcmp (file_name, _Jv_argv[0]) != 0)
+ return true;
}
}
#endif