logo       

segmentation fault in SableVM...: msg#00049

java.vm.sablevm.devel

Subject: segmentation fault in SableVM...

Hi,

I am working on a new gc in SableVM. When I ran a program with my new gc, I got the following segmentation fault:

_#0  0xb7f25a6d in _svmf_interpreter (_env=0x804dcf0) at instructions_switch.c:8778
/home/sadam/svm-gc/src/libsablevm/instructions_switch.c:8778:169341:beg:0xb7f25a6d

This segmentation fault happens in the following code:

...
#ifdef _SABLEVM_SIGNALS_FOR_EXCEPTIONS

#ifndef NDEBUG

      if (instance == NULL)
        {
          env->sigsegv_expected = JNI_TRUE;
        }

#endif /* NOT NDEBUG */

      /* save pc in case exception is raised */
      env->stack.current_frame->pc = pc;

#else

      if (instance == NULL)
        {
          env->stack.current_frame->pc = pc;
          _svmm_goto_label (nullpointerexception_handler);
        }

#endif /* _SABLEVM_SIGNALS_FOR_EXCEPTIONS */

     
      /* the following can cause a segfault */
      method =
        *((_svmt_method_info **) (void *)
          (((char *) instance->vtable) + method_offset));

In this file, the comment specify that a segfault can happen.

Can somebody help me to find where I must search for the problem?

Here is the program I used to test my gc. If I remove the print statements, I get the segfault.  Otherwise, everything works perfectly. Why???? I have no answer for now...


public class C1 {
    public static void main(String[] args) {

    final int LG = 10000;
    final int DEL = 75000;

        String s;

        System.out.println("111111111");

        String ss[] = new String[LG];

        for (int i = 0; i < DEL; i++)
        {
        s = new String(i + " ");
        }

         System.out.println("2222222222");
   
        for (int i = 0; i < LG; i++)
        {
        ss[i] = new String(i + " ");
        }

            System.out.println("333333333");

        for (int i = 0; i < LG; i+=2)
        {
        ss[i] = new String(i + " ");
        }


            System.out.println("444444444");

        for (int i = 0; i < DEL; i++)
        {
        s = new String(i + " ");
        }

            System.out.println("5555555555");

        for (int i = 0; i < LG; i+=3)
        {
        ss[i] = new String(i + " ");
        }

        System.out.println("--------end--------");
    }
}

Thanks,
Sébastien

_______________________________________________
SableVM-devel mailing list
SableVM-devel@xxxxxxxxxxx
http://sablevm.org/lists/control/listinfo/sablevm-devel
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise