New stack trace code

Andrew Haley aph@redhat.com
Fri Mar 11 21:13:00 GMT 2005


I've found a few problems.

We're not marking the line table in boehm.cc:

Index: boehm.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/boehm.cc,v
retrieving revision 1.45
diff -u -r1.45 boehm.cc
--- boehm.cc    25 Nov 2004 03:46:53 -0000      1.45
+++ boehm.cc    11 Mar 2005 18:52:31 -0000
@@ -289,6 +289,8 @@
                    = (_Jv_InterpMethod *) ic->interpreted_methods[i];
                  if (im)
                    {
+                     p = (GC_PTR) im->line_table;
+                     MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
                      p = (GC_PTR) im->prepared;
                      MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
                    }

Also, the calls to _Jv_AllocBytes in stacktrace.cc are potentially
problematic: unless they're rechable from somewhere we scan, the
memory may be freed before it gets used.

Andrew.



More information about the Java-patches mailing list