[Gc] GC 6.2 on IRIX64 6.5

Shiro Kawai shiro at lava.net
Thu Apr 15 05:42:53 PDT 2004


A friend of mine experiences a problem using GC 6.2 on IRIX64 6.5.
I don't have the environment to confirm.   Has anybody seen a similar
problem?

Symptom: when a program that uses GC forks another program
that also uses GC, the forked program keeps receiving SIGSEGV
at os_dep.c:806 and killed by the OS.

To reproduce the symptom, run the following program
linked with libgc.  It calls itself via system(3).
DONT_ADD_BYTE_AT_END is defined.  Pthread is not used.

======================================================
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
  
#include "gc.h"
  
int
main(int argc, char *argv[])
{
  char *x,*a;
  int n,sig=0;
   
  a = (argc > 1) ? strdup(argv[1]) : strdup("hoge?");
  n = strlen(a);
 
  x = (char*) GC_malloc_atomic((n+1)*sizeof(char));
  strcpy(x,a);
  printf("%s\n", x);
  fflush(stdout);
 
  sig = system("./hoge.out inside");
  printf("hoge.out returned: %d\n", sig);
  fflush(stdout);
                                                                               
  return 0;
}
======================================================
  
On Linux, it invokes itself recursively until interrupted
manually.  On IRIX, the child process is killed immediately.

 shell$ gcc -I./include gc_hoge.c .libs/libgc.a -o hoge.out
 shell$ ./hoge.out "keke?"
 keke?
 hoge.out returned: 9
 shell$


--shiro


More information about the Gc mailing list