[Bug 209599] SIGSEGV in regression test suite on java/openjdk8

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu May 19 13:40:18 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209599

--- Comment #7 from Andrew Smith <iamasmith.home at gmail.com> ---
turning off PCH makes no difference, the fault still occurs.

Interestingly with slow debug only the MappedByteBuffer.Truncate test throws
the exception.

Looking at the disassembly of the region of code...

0x0000000802a01f8b <Unsafe_GetNativeByte+347>:  callq  0x801f04550
<_ZN10JavaThread7currentEv>
0x0000000802a01f90 <Unsafe_GetNativeByte+352>:  mov    $0x1,%esi
0x0000000802a01f95 <Unsafe_GetNativeByte+357>:  mov    %rax,-0x60(%rbp)
0x0000000802a01f99 <Unsafe_GetNativeByte+361>:  mov    -0x60(%rbp),%rdi
0x0000000802a01f9d <Unsafe_GetNativeByte+365>:  callq  0x802a09fe0
<_ZN10JavaThread23set_doing_unsafe_accessEb>
0x0000000802a01fa2 <Unsafe_GetNativeByte+370>:  mov    $0x0,%esi
0x0000000802a01fa7 <Unsafe_GetNativeByte+375>:  mov    -0x58(%rbp),%rax
0x0000000802a01fab <Unsafe_GetNativeByte+379>:  mov    (%rax),%cl             #
SIGSEGV is HERE
0x0000000802a01fad <Unsafe_GetNativeByte+381>:  mov    %cl,-0x61(%rbp)
0x0000000802a01fb0 <Unsafe_GetNativeByte+384>:  mov    -0x60(%rbp),%rdi
0x0000000802a01fb4 <Unsafe_GetNativeByte+388>:  callq  0x802a09fe0
<_ZN10JavaThread23set_doing_unsafe_accessEb>
0x0000000802a01fb9 <Unsafe_GetNativeByte+393>:  lea    -0x48(%rbp),%rdi
0x0000000802a01fbd <Unsafe_GetNativeByte+397>:  mov    -0x61(%rbp),%cl

This pretty much maps to here in unsafe.cpp

#define DEFINE_GETSETNATIVE(java_type, Type, native_type) \
 \
UNSAFE_ENTRY(java_type, Unsafe_GetNative##Type(JNIEnv *env, jobject unsafe,
jlong addr)) \
  UnsafeWrapper("Unsafe_GetNative"#Type); \
  void* p = addr_from_java(addr); \
  JavaThread* t = JavaThread::current(); \
  t->set_doing_unsafe_access(true); \
  java_type x = *(volatile native_type*)p; \ # So, here in our macro
  t->set_doing_unsafe_access(false); \
  return x; \
UNSAFE_END \
 \
UNSAFE_ENTRY(void, Unsafe_SetNative##Type(JNIEnv *env, jobject unsafe, jlong
addr, java_type x)) \
  UnsafeWrapper("Unsafe_SetNative"#Type); \
  JavaThread* t = JavaThread::current(); \
  t->set_doing_unsafe_access(true); \
  void* p = addr_from_java(addr); \
  *(volatile native_type*)p = x; \
  t->set_doing_unsafe_access(false); \
UNSAFE_END \
 \
// END DEFINE_GETSETNATIVE.

DEFINE_GETSETNATIVE(jbyte, Byte, signed char)
DEFINE_GETSETNATIVE(jshort, Short, signed short);
DEFINE_GETSETNATIVE(jchar, Char, unsigned short);
DEFINE_GETSETNATIVE(jint, Int, jint);
// no long -- handled specially
DEFINE_GETSETNATIVE(jfloat, Float, float);
DEFINE_GETSETNATIVE(jdouble, Double, double);

As far as I can see this looks OK and I suspect this is more about the caller
than this particular function.

Unfortunately from frame 11 onwards we look to be in the murky region of
hotspot compiled code and gdb is isn't really much help following that piece.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-java mailing list