Problem in Thread.c

"Sébastien Adam" <[email protected]> Sun, 16 Apr 2006 14:30:50 +0000
Newsgroups gmane.comp.java.vm.sablevm.devel
Message-ID <[email protected]>
--===============0059436829==
Content-Type: multipart/alternative; 
	boundary="----=_Part_4745_16849155.1145197850042"

------=_Part_4745_16849155.1145197850042
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,

I developed a new generational gc in SableVM release 1.13.

I get a segmentation fault at the last instruction in the following code.
This instruction is found at line 1364 in the method
_svmf_enter_object_monitor of Thread.c.

++++++++++++
...
  else
    {
      /* it is a fat lock */

      _svmt_word fat_index =3D _svmf_lockword_get_fatlock_index
(old_lockword);
      _svmt_fat_lock *fat_lock =3D vm->fat_locks.array[fat_index];
      jint status =3D JNI_OK;
      jobject obj;

      if (_svmm_new_native_local (env, obj) !=3D JNI_OK)
    {
      return JNI_ERR;
    }

      /* save reference in case GC happens */
      *obj =3D instance;

      _svmm_stopping_java (env);

      /* IMPORTANT: From now on, we MUST NOT read or write any
         value which can be changed by GC or any other "stop the
         word" dependent operation. */

      _svmm_mutex_lock (fat_lock->mutex);
++++++++++++

When I print the lockword, I get the following:

1 011011100000000 011101 010010 00 0 0

This lockword don't change in the method _svmf_enter_object_monitor.

The least significant bit is 0 which means that it is a reference. My gc
uses a forward reference when an object is copied (it replaces the header o=
f
the original object with a reference to the copied object). So, what I get
is probably a forward reference. My segmentation fault happens immediately
after a call to the gc.

I don't work a lot with the Thread code but I don't think the problem is in
_svmf_enter_object_monitor. Is there somebody that can help me to resolve
this problem? Where should I look?

thanks,
Seb

------=_Part_4745_16849155.1145197850042
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,<br>
<br>
I developed a new generational gc in SableVM release 1.13.<br>
<br>
I get a segmentation fault at the last instruction in the following
code. This instruction is found at line 1364 in the method
_svmf_enter_object_monitor of Thread.c.<br>
<br>
++++++++++++<br>
...<br>
&nbsp; else<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* it is a fat lock */<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _svmt_word fat_index =3D _svmf_lockword_get_=
fatlock_index (old_lockword);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _svmt_fat_lock *fat_lock =3D vm-&gt;fat_lock=
s.array[fat_index];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jint status =3D JNI_OK;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jobject obj;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (_svmm_new_native_local (env, obj) !=3D J=
NI_OK)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp; return JNI_ERR;<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* save reference in case GC happens */<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *obj =3D instance;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _svmm_stopping_java (env);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* IMPORTANT: From now on, we MUST NOT read =
or write any<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value which can be changed=
 by GC or any other &quot;stop the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; word&quot; dependent opera=
tion. */<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _svmm_mutex_lock (fat_lock-&gt;mutex);<br>
++++++++++++<br>
<br>
When I print the lockword, I get the following:<br>
<br>
1 011011100000000 011101 010010 00 0 0<br>
<br>
This lockword don't change in the method _svmf_enter_object_monitor.<br>
<br>
The least significant bit is 0 which means that it is a reference. My
gc uses a forward reference when an object is copied (it replaces the
header of the original object with a reference to the copied object).
So, what I get is probably a forward reference. My segmentation fault
happens immediately after a call to the gc.<br>
<br>
I don't work a lot with the Thread code but I don't think the problem
is in _svmf_enter_object_monitor. Is there somebody that can help me to
resolve this problem? Where should I look?<br>
<br>
thanks,<br>
Seb<br>

------=_Part_4745_16849155.1145197850042--


--===============0059436829==
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

--===============0059436829==--