JDK-8008807 : SA: jstack crash when target has mismatched bitness (Linux)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2013-02-25
  • Updated: 2024-12-05
  • Resolved: 2013-02-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8Fixed hs25Fixed
Related Reports
Relates :  
Description
On Linux, attaching a 32-bit "jstack -m" to a 64-bit target, or vice versa, will produce a crash, e.g.

# JRE version: Java(TM) SE Runtime Environment (8.0-b77) (build 1.8.0-ea-b77)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b18 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libsaproc.so+0x1f06]  read_section_data+0x1f


jstack without -m (only the java stacktrace) has no problem.

The stacktrace is:
(gdb) bt
#0  0x00007f6f55a85ba5 in raise (sig=<value optimised out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f6f55a896b0 in abort () at abort.c:92
#2  0x00007f6f5540bf85 in os::abort(bool) () from /opt/java/64/test8/jre/lib/amd64/server/libjvm.so
#3  0x00007f6f55591247 in VMError::report_and_die() () from /opt/java/64/test8/jre/lib/amd64/server/libjvm.so
#4  0x00007f6f5540fdf0 in JVM_handle_linux_signal () from /opt/java/64/test8/jre/lib/amd64/server/libjvm.so
#5  <signal handler called>
#6  0x00007f6f4b421f06 in read_section_data () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#7  0x00007f6f4b4221de in find_section_by_name () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#8  0x00007f6f4b4222e0 in open_file_from_debug_link () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#9  0x00007f6f4b4224d9 in build_symtab_from_debug_link () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#10 0x00007f6f4b422c65 in build_symtab_internal () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#11 0x00007f6f4b422d6b in build_symtab () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#12 0x00007f6f4b4234df in add_lib_info_fd () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#13 0x00007f6f4b4233c1 in add_lib_info () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#14 0x00007f6f4b4242fa in read_lib_info () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#15 0x00007f6f4b4244a1 in Pgrab () from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#16 0x00007f6f4b426a15 in Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_attach0(int0_t) ()
   from /opt/java/64/test8/jre/lib/amd64/libsaproc.so
#17 0x00007f6f500fa734 in ?? ()
#18 0x00007f6f440a0000 in ?? ()



Solaris prohibits the mixing of bitness, and gives: 

	Error attaching to process: Attach failed : debuggee is 64 bit, use java -d64 for debugger
or:
	Error attaching to process: debuggee is 32 bit, use 32 bit java for debugger

A similar restriction is likely needed on Linux.

The crash appears to happen since 6932270.
Prior to that change, a missing symbol error happened when mixing bitness.
But also to be fair on that change the matched case may not have worked either, due to: 
DebuggerException: get_thread_regs failed for a lwp


Comments
URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/96bd4772ec62 User: amurillo Date: 2013-03-08 20:14:20 +0000
08-03-2013

URL: http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/96bd4772ec62 User: kevinw Date: 2013-02-27 22:12:46 +0000
27-02-2013