segmentation fault in SableVM...
"Sébastien Adam" <[email protected]> Thu, 30 Mar 2006 09:18:16 -0500
| Newsgroups | gmane.comp.java.vm.sablevm.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0481737893==
Content-Type: multipart/alternative;
boundary="----=_Part_4430_10060292.1143728296724"
------=_Part_4430_10060292.1143728296724
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
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=3D0x804dcf0) at
instructions_switch.c:8778
/home/sadam/svm-gc/src/libsablevm/instructions_switch.c:8778:169341:beg:0xb=
7f25a6d
This segmentation fault happens in the following code:
...
#ifdef _SABLEVM_SIGNALS_FOR_EXCEPTIONS
#ifndef NDEBUG
if (instance =3D=3D NULL)
{
env->sigsegv_expected =3D JNI_TRUE;
}
#endif /* NOT NDEBUG */
/* save pc in case exception is raised */
env->stack.current_frame->pc =3D pc;
#else
if (instance =3D=3D NULL)
{
env->stack.current_frame->pc =3D pc;
_svmm_goto_label (nullpointerexception_handler);
}
#endif /* _SABLEVM_SIGNALS_FOR_EXCEPTIONS */
/* the following can cause a segfault */
method =3D
*((_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 =3D 10000;
final int DEL =3D 75000;
String s;
System.out.println("111111111");
String ss[] =3D new String[LG];
for (int i =3D 0; i < DEL; i++)
{
s =3D new String(i + " ");
}
System.out.println("2222222222");
for (int i =3D 0; i < LG; i++)
{
ss[i] =3D new String(i + " ");
}
System.out.println("333333333");
for (int i =3D 0; i < LG; i+=3D2)
{
ss[i] =3D new String(i + " ");
}
System.out.println("444444444");
for (int i =3D 0; i < DEL; i++)
{
s =3D new String(i + " ");
}
System.out.println("5555555555");
for (int i =3D 0; i < LG; i+=3D3)
{
ss[i] =3D new String(i + " ");
}
System.out.println("--------end--------");
}
}
Thanks,
S=E9bastien
------=_Part_4430_10060292.1143728296724
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi,<br>
<br>
I am working on a new gc in SableVM. When I ran a program with my new gc, I=
got the following segmentation fault:<br>
<br>
_#0 0xb7f25a6d in _svmf_interpreter (_env=3D0x804dcf0) at instruction=
s_switch.c:8778<br>
/home/sadam/svm-gc/src/libsablevm/instructions_switch.c:8778:169341:beg:0xb=
7f25a6d<br>
<br>
This segmentation fault happens in the following code:<br>
<font size=3D"1"><br>
...<br>
#ifdef _SABLEVM_SIGNALS_FOR_EXCEPTIONS<br>
<br>
#ifndef NDEBUG<br>
<br>
if (instance =3D=3D NULL)<br>
{<br>
env->sigsegv_expected =
=3D JNI_TRUE;<br>
}<br>
<br>
#endif /* NOT NDEBUG */<br>
<br>
/* save pc in case exception is raised */<br>
env->stack.current_frame->pc =3D pc;<br>
<br>
#else<br>
<br>
if (instance =3D=3D NULL)<br>
{<br>
env->stack.current_fra=
me->pc =3D pc;<br>
_svmm_goto_label (nullpoi=
nterexception_handler);<br>
}<br>
<br>
#endif /* _SABLEVM_SIGNALS_FOR_EXCEPTIONS */<br>
<br>
<span style=3D"font-weight: bold;"> </span><br sty=
le=3D"font-weight: bold;">
<span style=3D"font-weight: bold;"> /* the followi=
ng can cause a segfault */</span><br style=3D"font-weight: bold;">
<span style=3D"font-weight: bold;"> method =3D</sp=
an><br style=3D"font-weight: bold;">
<span style=3D"font-weight: bold;"> *(=
(_svmt_method_info **) (void *)</span><br style=3D"font-weight: bold;">
<span style=3D"font-weight: bold;"> &nb=
sp; (((char *) instance->vtable) + method_offset));<br>
</span><br>
<font size=3D"2">In this file, the comment specify that a segfault can happ=
en.<br>
<br>
Can somebody help me to find where I must search for the problem?<br>
<br>
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...</font></font><font size=3D"2=
"><br>
<br>
</font><font size=3D"1">public class C1 {<br>
public static void main(String[] args) {<br>
<br>
final int LG =3D 10000;<br>
final int DEL =3D 75000;<br>
<br>
String s;<br>
<br>
System.out.println("1111111=
11");<br>
<br>
String ss[] =3D new String[LG];<=
br>
<br>
for (int i =3D 0; i < DEL; i+=
+)<br>
{<br>
s =3D new String(i + " ");<=
br>
}<br>
<br>
System.out.println("2=
222222222");<br>
<br>
for (int i =3D 0; i < LG; i++=
)<br>
{<br>
ss[i] =3D new String(i + " "=
;);<br>
}<br>
<br>
System.o=
ut.println("333333333");<br>
<br>
for (int i =3D 0; i < LG; i+=
=3D2)<br>
{<br>
ss[i] =3D new String(i + " "=
;);<br>
}<br>
<br>
<br>
System.o=
ut.println("444444444");<br>
<br>
for (int i =3D 0; i < DEL; i+=
+)<br>
{<br>
s =3D new String(i + " ");<=
br>
}<br>
<br>
System.o=
ut.println("5555555555");<br>
<br>
for (int i =3D 0; i < LG; i+=
=3D3)<br>
{<br>
ss[i] =3D new String(i + " "=
;);<br>
}<br>
<br>
System.out.println("-------=
-end--------");<br>
}<br>
}<br>
<font size=3D"2"><br>
Thanks,<br>
S=E9bastien</font><br>
<span style=3D"font-weight: bold;"></span></font>
------=_Part_4430_10060292.1143728296724--
--===============0481737893==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
SableVM-devel mailing list
[email protected]
http://sablevm.org/lists/control/listinfo/sablevm-devel
--===============0481737893==--