A SEGV when compiling OpenOrb

Alexandre Petit-Bianco apbianco@cygnus.com
Mon Jul 2 12:08:00 GMT 2001


minyard@acm.org writes:

> Here's the GDB session:

Can you please try the patch I posted for java/2633? I included it
below.

./A

Index: jcf-parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.86
diff -u -p -r1.86 jcf-parse.c
--- jcf-parse.c 2001/06/27 20:38:20     1.86
+++ jcf-parse.c 2001/07/02 19:04:52
@@ -101,14 +101,15 @@ static void jcf_parse PARAMS ((struct JC
 static void load_inner_classes PARAMS ((tree));
 
 /* Mark (for garbage collection) all the tree nodes that are
-   referenced from JCF's constant pool table. */
+   referenced from JCF's constant pool table. Do that only if the JCF
+   hasn't been marked finished.  */
 
 static void
 ggc_mark_jcf (elt)
      void **elt;
 {
   JCF *jcf = *(JCF**) elt;
-  if (jcf != NULL)
+  if (jcf != NULL && !jcf->finished)
     {
       CPool *cpool = &jcf->cpool;
       int size = CPOOL_COUNT(cpool);
Index: jcf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf.h,v
retrieving revision 1.23
diff -u -p -r1.23 jcf.h
--- jcf.h       2001/05/26 01:31:47     1.23
+++ jcf.h       2001/07/02 19:04:53
@@ -90,6 +90,7 @@ typedef struct JCF {
   unsigned char *read_end;
   int java_source : 1;
   int right_zip : 1;
+  int finished : 1;
   jcf_filbuf_t filbuf;
   void *read_state;
   const char *filename;
@@ -144,7 +145,8 @@ typedef struct JCF {
   CPOOL_FINISH(&(JCF)->cpool); \
   if ((JCF)->buffer) FREE ((JCF)->buffer); \
   if ((JCF)->filename) FREE ((char *) (JCF)->filename); \
-  if ((JCF)->classname) FREE ((char *) (JCF)->classname); }
+  if ((JCF)->classname) FREE ((char *) (JCF)->classname); \
+  (JCF)->finished = 1; }
   
 #define CPOOL_INIT(CPOOL) \
   ((CPOOL)->capacity = 0, (CPOOL)->count = 0, (CPOOL)->tags = 0, (CPOOL)->data 
= 0)
@@ -154,7 +156,8 @@ typedef struct JCF {
 #define JCF_ZERO(JCF)  \
   ((JCF)->buffer = (JCF)->buffer_end = (JCF)->read_ptr = (JCF)->read_end = 0,\
    (JCF)->read_state = 0, (JCF)->filename = (JCF)->classname = 0, \
-   CPOOL_INIT(&(JCF)->cpool), (JCF)->java_source = 0, (JCF)->zipd = 0)
+   CPOOL_INIT(&(JCF)->cpool), (JCF)->java_source = 0, (JCF)->zipd = 0, \
+   (JCF)->finished = 0)
 
 /* Given that PTR points to a 2-byte unsigned integer in network
    (big-endian) byte-order, return that integer. */



More information about the Java mailing list