[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Gnome 0.30 fix?



Jim Pick <jim@jimpick.com> wrote:
> I have the same problem here.  I spent a little time trying to debug
> it, but never finished due to a lack of time.  It might have something
> to do with gtk and themes, but I'm not sure.

Where are the segfaults happening?  I found a pretty nasty one with
the session manager (gsm), that was preventing my session info from
being saved.  I spent many hours trying to catch it, but I wasn't able
to find anything wrong in the code.  However, at a given time I added
some printf statements to the code (to print certain values the
debugger was not getting right) and the problem disappeared (!!!!!).

Here is the patch for the printf statements.  It is not a real fix but
may help someone to find the bug (and is a workaround anyway :-).

-----------------------------------
diff -u --recursive gsm/prop.c ../gnome-core-0.30.modif/gsm/prop.c
--- gsm/prop.c	Thu Jul 23 19:12:54 1998
+++ ../gnome-core-0.30.modif/gsm/prop.c	Wed Sep 30 17:20:55 1998
@@ -62,12 +62,15 @@
   SmProp *prop;
 
   prop = find_property_by_name (client, name);
-  if (! prop || strcmp (prop->type, SmARRAY8))
+  if (! prop || strcmp (prop->type, SmARRAY8)) {
+    printf( "find_string_property: %s not found\n", name );
     return FALSE;
+  }
 
   *result = malloc (prop->vals[0].length + 1);
   memcpy (*result, prop->vals[0].value, prop->vals[0].length);
   result[prop->vals[0].length] = '\0';
+  printf( "find_string_property: %s = %s\n", name, *result );
 
   return TRUE;
 }
@@ -80,17 +83,22 @@
   int i;
 
   prop = find_property_by_name (client, name);
-  if (! prop || strcmp (prop->type, SmLISTofARRAY8))
+  if (! prop || strcmp (prop->type, SmLISTofARRAY8)) {
+    printf( "find_vector_property: %s not found\n", name );
     return FALSE;
+  }
 
   *argcp = prop->num_vals;
   *argvp = (char **) malloc (*argcp * sizeof (char *));
+  printf ( "find_vector_property: %s = ", name );
   for (i = 0; i < *argcp; ++i)
     {
       (*argvp)[i] = malloc (prop->vals[i].length + 1);
       memcpy ((*argvp)[i], prop->vals[i].value, prop->vals[i].length);
       (*argvp)[i][prop->vals[i].length] = '\0';
+      printf( " %s", (*argvp)[i] );
     }
+  printf( "\n" );
 
   return TRUE;
 }
Only in ../gnome-core-0.30.modif/gsm/: prop.c~
diff -u --recursive gsm/save.c ../gnome-core-0.30.modif/gsm/save.c
--- gsm/save.c	Thu Jul 23 19:12:54 1998
+++ ../gnome-core-0.30.modif/gsm/save.c	Wed Sep 30 19:49:45 1998
@@ -66,8 +66,9 @@
 write_one_client (int number, const Client *client)
 {
   /* We over-allocate; it doesn't matter.  */
-  int i, vec_count, string_count, argcs[NUM_PROPERTIES], failure;
-  char **argvs[NUM_PROPERTIES];
+  int i, vec_count, string_count, argcs[NUM_PROPERTIES], 
+    /*argcs2[NUM_PROPERTIES],*/ failure;
+  char **argvs[NUM_PROPERTIES]/*, **argvs2[NUM_PROPERTIES]*/;
   char *strings[NUM_PROPERTIES];
   const char *argv_names[NUM_PROPERTIES];
   const char *string_names[NUM_PROPERTIES];
@@ -77,6 +78,9 @@
   if (find_card8_property (client, SmRestartStyleHint, &style)
       && style == SmRestartNever)
     return 0;
+
+  /*  find_vector_property (client, "RestartCommand",
+      &argcs2[0], &argvs2[0]); */
 
   /* Read each property we care to save.  */
   failure = 0;
-----------------------------------

Regards,

M. S.

------------
Martin A. Soto J.                           Profesor
Departamento de Ingenieria de Sistemas y Computacion
Universidad de los Andes      masoto@uniandes.edu.co



Reply to: