SlideShare a Scribd company logo
1 of 47
Download to read offline
2016.5.22
数村 憲治
Python + GDB = Javaデバッガ
Copyright 2016 FUJITSU LIMITED
JJUG CCC 2016 Spring
M-5
アジェンダ
Copyright 2016 FUJITSU LIMITED
やりたいこと
GDB Pythonインタフェース
VMStruct
backtraceの実装
TODO
1
やりたいこと
Copyright 2016 FUJITSU LIMITED
coreファイルをデバッグ
coreからJava VM(C++)とJavaコードを同時に操作
なぜcoreなのか?
透過的なスタックトレース
Javaオブジェクトのダンプ
Javaならjdb、JVMならGDB。Java+JVMは?
2
jstack - man
Copyright 2016 FUJITSU LIMITED
jstack(1) Troubleshooting Tools jstack(1)
NAME
jstack - Prints Java thread stack traces for a Java process, core file, or remote debug
server. This command is experimental and unsupported.
SYNOPSIS
jstack [ options ] pid
jstack [ options ] executable core
jstack [ options ] [ server-id@ ] remote-hostname-or-IP
options
The command-line options. See Options.
pid The process ID for which the stack trace is printed. The process must be a Java
process. To get a list of Java processes running on a machine, use the jps(1) command.
executable
The Java executable from which the core dump was produced.
core The core file for which the stack trace is to be printed.
3
jstack - man
Copyright 2016 FUJITSU LIMITED
DESCRIPTION
The jstack command prints Java stack traces of Java threads for a specified Java process, core
file, or remote debug server. For each Java frame, the full class name, method name, byte code
index (BCI), and line number, when available, are printed. With the -m option,
the jstack command prints both Java and native frames
of all threads with the program counter (PC).
OPTIONS
-F
Force a stack dump when jstack [-l] pid does not respond.
-l
Long listing. Prints additional information about locks such as a list of owned
java.util.concurrent ownable synchronizers. See the AbstractOwnableSynchronizer class
description at
http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer.html
-m
Prints a mixed mode stack trace that has both Java and
native C/C++ frames.
4
jstack -m
Copyright 2016 FUJITSU LIMITED
% /v3/java/jdk1.8.0_66/bin/jstack -m /v3/java/jdk1.8.0_66/bin/java core.2017
Attaching to core core.2017 from executable /v3/java/jdk1.8.0_66/bin/java, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.66-b17
Deadlock Detection:
No deadlocks found.
----------------- 2018 -----------------
0x00007f3492d03149 __pthread_cond_timedwait + 0x129
0x00007f3491e54ff3 _ZN2os5sleepEP6Threadlb + 0x283
0x00007f3491c56f02 JVM_Sleep + 0x3b2
0x00007f348bc15994 * java.lang.Thread.sleep(long) bci:0 (Interpreted frame)
0x00007f348bc07c4d * a.xxx3() bci:11 line:15 (Interpreted frame)
0x00007f348bc07c4d * a.xxx2() bci:0 line:10 (Interpreted frame)
0x00007f348bc07c4d * a.xxx1() bci:0 line:7 (Interpreted frame)
0x00007f348bc07c4d * a.main(java.lang.String[]) bci:0 line:4 (Interpreted frame)
0x00007f348bc007a7 <StubRoutines>
0x00007f3491bc3c46 _ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread + 0x1056
0x00007f3491c05262 _ZL17jni_invoke_staticP7JNIEnv_P9JavaValueP8_jobject11JNICallTypeP10_jmethodIDP18JNI_ArgumentPushe
0x00007f3491c21c6a jni_CallStaticVoidMethod + 0x17a
0x00007f3492ae7bcc JavaMain + 0x80c
----------------- 2020 -----------------
0x00007f3492d02da0 __pthread_cond_wait + 0xc0
0x00007f3491e0ef07 _ZN7Monitor5IWaitEP6Threadl + 0xf7
0x00007f3491e0f826 _ZN7Monitor4waitEblb + 0x256
0x00007f3491b0ad93 _ZN13GCTaskManager8get_taskEj + 0x43
0x00007f3491b0bc28 _ZN12GCTaskThread3runEv + 0x188
5
jstackの課題
Copyright 2016 FUJITSU LIMITED
スタックトレースしか出ない
コアを他のマシンに移すと動作しない
拡張性に乏しい
修正が大変
6
GDB - backtrace
Copyright 2016 FUJITSU LIMITED
(gdb) bt
#0 0x00007f3492d03149 in pthread_cond_timedwait@@GLIBC_2.3
at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:23
#1 0x00007f3491e5361f in os::PlatformEvent::park(long) ()
from /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so
#2 0x00007f3491e54ff3 in os::sleep(Thread*, long, bool) ()
from /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so
#3 0x00007f3491c56f02 in JVM_Sleep ()
from /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so
#4 0x00007f348bc15994 in ?? ()
#5 0x00007f348c009800 in ?? ()
#6 0x00007f348bc156e2 in ?? ()
…..
#10 0x00007f348b3b3480 in ?? ()
#11 0x0000000000000000 in ?? ()
7
stack unwinding
Copyright 2016 FUJITSU LIMITED
呼び出し元fp
pc (戻りアドレス)
スタック
呼び出し元fp
pc (戻りアドレス)
呼び出し先
フレーム
呼び出し元
フレーム
fp(フレームポインタ)
sp(スタックポインタ)
デバッガは
このアドレスから
該当シンボルを探す
8
コーリングコンベンション
Copyright 2016 FUJITSU LIMITED
GDBは各言語のコーリングコンベンションを意識して
stack unwindingしている
Javaは難しい?
インタプリタ・JIT・ネイティブのミックスフレーム
このフレームがインタプリタフレームかどうか、
どうやって判断する?
コードが動的に生成される
テンプレートインタプリタ・JIT
9
Javaコーリングコンベンション
Copyright 2016 FUJITSU LIMITED
A frame represents a physical stack frame (an activation).
Frames can be C or Java frames,
and the Java frames can be interpreted or compiled.
In contrast, vframes represent source-level activations,
so that one physical frame can correspond to
multiple source level frames because of inlining.
A frame is comprised of {pc, fp, sp}
frame_x86.hpp
frame
interpreted
compiled vframe
vframe
vframe
10
Javaコーリングコンベンション
Copyright 2016 FUJITSU LIMITED
// Layout of asm interpreter frame:
// [expression stack ] * <- sp
// [monitors ] ¥
// ... | monitor block size
// [monitors ] /
// [monitor block size ]
// [byte code index/pointr] = bcx() bcx_offset
// [pointer to locals ] = locals() locals_offset
// [constant pool cache ] = cache() cache_offset
// [methodData ] = mdp() mdx_offset
// [Method* ] = method() method_offset
// [last sp ] = last_sp() last_sp_offset
// [old stack pointer ] (sender_sp) sender_sp_offset
// [old frame pointer ] <- fp = link() return_addr_offset
// [return pc ]
// [oop temp ] (only for native calls)
// [locals and parameters ]
// <- sender sp
11
これまでのアプローチ
Copyright 2016 FUJITSU LIMITED
GDB自身の改造
OS毎にGDBをビルド
最新のGDBがすぐに使えない
修正変更の管理
HotSpotのコーリングコンベンションの追加
12
他のアプローチ
Copyright 2016 FUJITSU LIMITED
GDB JIT Compilation Interface
https://sourceware.org/gdb/onlinedocs/gdb/JIT-Interface.html#JIT-Interface
JITの修正が必要。インタプリタはダメ。
GDB script
ifとかwhileはあるが。。。
13
アジェンダ
Copyright 2016 FUJITSU LIMITED
やりたいこと
GDB Pythonインタフェース
VMStruct
backtraceの実装
TODO
14
Pythonインタフェース
Copyright 2016 FUJITSU LIMITED
https://sourceware.org/gdb/onlinedocs/gdb/Extending-GDB.html#Extending-GDB
GDBでPythonスクリプトが使える
PythonプログラムをGDBでデバッグすることではない
configure時に--with-pythonを指定する
% gdb -configuration
This GDB was configured as follows:
configure --host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-auto-load-dir=$debugdir:$datadir/auto-load
……..
--with-jit-reader-dir=/usr/lib/gdb (relocatable)
--without-libunwind-ia64
--with-lzma
--with-python=/usr (relocatable)
15
Inferiorオブジェクト
Copyright 2016 FUJITSU LIMITED
メモリアクセス
— Function: Inferior.read_memory (address, length)
Read length addressable memory units from the
inferior, starting at address. Returns a buffer object,
which behaves much like an array or a string. It can be
modified and given to the Inferior.write_memory
function. In Python 3, the return value is a
memoryview object
16
メモリアクセス関数
Copyright 2016 FUJITSU LIMITED
def readNbyteAsLittle(addr, size):
try:
buf = gdb.selected_inferior().read_memory(addr, size)
except:
return None
i = size - 1
n = 0
while i >= 0:
n = n << 8
m = ord(buf[i])
n += m
i -= 1
return n
17
関数選択
Copyright 2016 FUJITSU LIMITED
if (target.isSparc):
readNbyte = readNbyteAsBig
sizeof_pointer = 4
elif (target.isX86):
readNbyte = readNbyteAsLittle
sizeof_pointer = 4
elif (target.isX64):
readNbyte = readNbyteAsLittle
sizeof_pointer = 8
動作環境によって、関数を自動的に切り替え
18
アジェンダ
Copyright 2016 FUJITSU LIMITED
やりたいこと
GDB Pythonインタフェース
VMStruct
backtraceの実装
TODO
19
VMStruct
Copyright 2016 FUJITSU LIMITED
JVM自身のデバッグ情報
JVM内部にテーブルとして保持
VMStructのアドバンテージ (vmStruct.hpp)
クラス、フィールド、サイズ等
従来、DWARF等で定義されていたもの
プラットフォーム・コンパイラ非依存
デバッグ用ビルドを作らなくてよい
Javaのサイズを保持 (「jlong」 v.s. 「long long」)
20
class VMStruct (vmStruct.hpp)
Copyright 2016 FUJITSU LIMITED
class VMStructs {
public:
// The last entry is identified over in the serviceability agent by
// the fact that it has a NULL fieldName
static VMStructEntry localHotSpotVMStructs[];
// The last entry is identified over in the serviceability agent by
// the fact that it has a NULL typeName
static VMTypeEntry localHotSpotVMTypes[];
// Table of integer constants required by the serviceability agent.
// The last entry is identified over in the serviceability agent by
// the fact that it has a NULL typeName
static VMIntConstantEntry localHotSpotVMIntConstants[];
…….
21
VMStructEntry
Copyright 2016 FUJITSU LIMITED
typedef struct {
const char* typeName;
// The type name containing the given field (example: "Klass")
const char* fieldName;
// The field name within the type (example: "_name")
const char* typeString;
// Quoted name of the type of this field (example: "Symbol*";
int32_t isStatic;
// Indicates whether following field is an offset or an address
uint64_t offset;
// Offset of field within structure; only used for nonstatic fields
void* address;
// Address of field; only used for static fields
} VMStructEntry;
Hotspot VMを構成する(C++の)クラス・フィールドを表現
22
VMStructEntry – 対応例
Copyright 2016 FUJITSU LIMITED
typedef struct {
const char* typeName;
const char* fieldName;
const char* typeString;
int32_t isStatic;
uint64_t offset;
void* address;
}
class Klass : public Metadata {
friend class VMStructs;
…
Symbol* _name;
vmStruct.hpp klass.hpp
_nameの(Klassクラスの先
頭からの)オフセット使わない
(staticのみ)
0
23
vmstructコマンド
Copyright 2016 FUJITSU LIMITED
class VMStruct (gdb.Command):
def __init__ (self):
super (VMStruct, self).__init__ ("info vmstruct", gdb.COMMAND
self.gHotSpot = memory.getSymbolAddr("gHotSpotVMStructs")
self.typeNameOffset = memory.readUint64FromSymbol( ¥
"gHotSpotVMStructEntryTypeNameOffset")
self.fieldNameOffset = memory.readUint64FromSymbol( ¥
"gHotSpotVMStructEntryFieldNameOffset")
self.typeStringOffset = memory.readUint64FromSymbol( ¥
"gHotSpotVMStructEntryTypeStringOffset")
self.isStaticOffset = memory.readUint64FromSymbol( ¥
"gHotSpotVMStructEntryIsStaticOffset")
24
vmstructコマンド
Copyright 2016 FUJITSU LIMITED
src = memory.readPointer(self.gHotSpot)
self.vmstruct = []
while (True) :
entry = self.readVMStructEntry(src)
if (entry == None):
break
self.vmstruct.append(entry)
src += VMStructEntry.entrySize
__init__の続き
25
vmstructコマンド
Copyright 2016 FUJITSU LIMITED
def readVMStructEntry(self, addr):
#TypeName
target = memory.readPointer(addr + self.typeNameOffset)
if (target == 0):
return None
else:
typeName = memory.readString(target)
if (typeName == ""):
return None
#FieldName
target = memory.readPointer(addr + self.fieldNameOffset)
if (target == 0):
fieldName= ""
else:
fieldName = memory.readString(target)
26
vmstructコマンド
Copyright 2016 FUJITSU LIMITED
def invoke(self, arg, from_tty):
args = arg.split()
argNum = len(args)
if (argNum == 0):
for entry in self.vmstruct:
entry.printEntry()
elif (argNum == 1):
typeName = args[0]
for entry in self.vmstruct:
if entry.typeName.startswith(arg):
entry.printEntry()
elif (argNum == 2):
…
else:
print ("usage : info vmstruct")
print (" : info vmstruct <typeName>")
27
アジェンダ
Copyright 2016 FUJITSU LIMITED
やりたいこと
GDB Pythonインタフェース
VMStruct
backtraceの実装
TODO
29
backtraceの実現ステップ
Copyright 2016 FUJITSU LIMITED
現在のフレームが、Javaのフレームかどうか判断する
現在のフレームを実行しているメソッド名を求める
前のフレーム(fp等)をセットする
unwinderの登録
frame filterの登録
30
unwinder
Copyright 2016 FUJITSU LIMITED
フレームをたどる処理
GDBにunwinderを登録しておくと、
フレーム処理のたびに呼び出される
unwinderでは、
自分が処理すべきフレームであればgdb.UnwindInfoを、
そうでなければNoneを返却。
31
unwinder登録
Copyright 2016 FUJITSU LIMITED
if (target.isX64):
jvmunwinder = JVMUnwinderX64()
gdb.unwinder.register_unwinder(None, jvmunwinder)
class JVMUnwinderX64(AbstractJVMUnwinder):
name = "JVMUnwinderX64"
enabled = True
def __init__(self):
super(JVMUnwinderX64, self).__init__()
32
unwinder呼び出し
Copyright 2016 FUJITSU LIMITED
def __call__(self, pending_frame):
pc = pending_frame.read_register('rip')
sp = pending_frame.read_register('rsp')
bp = pending_frame.read_register('rbp')
33
unwinder呼び出し(続き)
Copyright 2016 FUJITSU LIMITED
if self.isInterpretedFrame(pc) :
sp = bp + sender_sp_offset * memory.sizeof_pointer
pc = gdb.Value(memory.readPointer(bp + ¥
return_addr_offset * memory.sizeof_pointer))
bp = gdb.Value(memory.readPointer(bp))
uinfo = pending_frame.create_unwind_info(FrameId(sp))
uinfo.add_saved_register(6, bp)
uinfo.add_saved_register(7, sp)
uinfo.add_saved_register(16, pc)
return uinfo
elif self.iscCompiledFrame(pc) :
…
else:
return None
34
Javaコーリングコンベンション(再掲)
Copyright 2016 FUJITSU LIMITED
// Layout of asm interpreter frame:
// [expression stack ] * <- sp
// [monitors ] ¥
// ... | monitor block size
// [monitors ] /
// [monitor block size ]
// [byte code index/pointr] = bcx() bcx_offset
// [pointer to locals ] = locals() locals_offset
// [constant pool cache ] = cache() cache_offset
// [methodData ] = mdp() mdx_offset
// [Method* ] = method() method_offset
// [last sp ] = last_sp() last_sp_offset
// [old stack pointer ] (sender_sp) sender_sp_offset
// [old frame pointer ] <- fp = link() return_addr_offset
// [return pc ]
// [oop temp ] (only for native calls)
// [locals and parameters ]
// <- sender sp
35
isInterpretedFrame
Copyright 2016 FUJITSU LIMITED
class AbstractJVMUnwinder:
__ai = memory.readPointer( ¥
vmstruct.getValue("AbstractInterpreter", "_code"))
__sq_sb = memory.readPointer(
__ai + vmstruct.getValue("StubQueue", "_stub_buffer"))
__sq_bl= memory.readNbyte(
__ai + vmstruct.getValue("StubQueue", "_buffer_limit"), ¥
vmtype.getValue("int"))
def isInterpretedFrame(self, addr):
return ((addr >= self.__sq_sb) and ¥
(addr < self.__sq_sb + self.__sq_bl))
36
AbstractInterpreter
Copyright 2016 FUJITSU LIMITED
class AbstractInterpreter: AllStatic {
friend class VMStructs;
protected:
static StubQueue* _code; // the interpreter code (codelets)
abstractInterpreter.hpp
stubs.hpp
class StubQueue: public CHeapObj<mtCode> {
friend class VMStructs;
private:
StubInterface* _stub_interface; // the interface prototype
address _stub_buffer; // where all stubs are stored
int _buffer_size; // the buffer size in bytes
37
frame filter登録
Copyright 2016 FUJITSU LIMITED
class JavaFilter():
def __init__(self):
self.name = "JavaFilter"
self.priority = 100
self.enabled = True
gdb.frame_filters[self.name] = self
def filter(self, frame_iter):
frame_iter = map(JavaDecorator, frame_iter)
return frame_iter
38
decorator登録
Copyright 2016 FUJITSU LIMITED
class JavaDecorator(gdb.FrameDecorator.FrameDecorator):
def __init__(self, fobj):
super(JavaDecorator, self).__init__(fobj)
def function(self):
frame = self.inferior_frame()
pc = frame.pc()
if jvmunwinder.isInterpretedFrame(pc) :
methodOop = jvmunwinder.getMethodOop(frame)
name = oop.getMethodName(methodOop)
return ("j " + name)
elif jvmunwinder.isEntryFrame(pc) :
return " <<entryframe>>"
return str(frame.name())
39
backtrace
Copyright 2016 FUJITSU LIMITED
(gdb) bt
#0 0x00007f3492d03149 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1 0x00007f3491e5361f in os::PlatformEvent::park(long) ()
at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so
#2 0x00007f3491e54ff3 in os::sleep(Thread*, long, bool) ()
at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so
#3 0x00007f3491c56f02 in JVM_Sleep () at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so
#4 0x00007f348bc15994 in j java/lang/Thread#sleep(J)V ()
#5 0x00007f348bc07c4d in j a#xxx3()V ()
#6 0x00007f348bc07c4d in j a#xxx2()V ()
#7 0x00007f348bc07c4d in j a#xxx1()V ()
#8 0x00007f348bc07c4d in j a#main([Ljava/lang/String;)V ()
#9 0x00007f348bc007a7 in <<entryframe>> ()
#10 0x00007f3491bc3c46 in JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, T
at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so
#11 0x00007f3491c05262 in jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID
#12 0x00007f3491c21c6a in jni_CallStaticVoidMethod () at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/
#13 0x00007f3492ae7bcc in JavaMain () at /v3/java/jdk1.8.0_66/bin/../lib/amd64/jli/libjli.so
#14 0x00007f3492cfd6aa in start_thread (arg=0x7f349311b700) at pthread_create.c:333
#15 0x00007f3492618eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
40
アジェンダ
Copyright 2016 FUJITSU LIMITED
やりたいこと
GDB Pythonインタフェース
VMStruct
backtraceの実装
TODO
42
TODO
Copyright 2016 FUJITSU LIMITED
各種プラットフォーム展開
コマンド充実
oopコマンド
ライブデバッグ
JDK9
43
oopコマンド
Copyright 2016 FUJITSU LIMITED
(instanceOop*) 0xefe983d0 : oop is java.net.SocksSocketImpl instance.
+00 markOop _mark = 0x3ce7e9f8
+04 klassOop _klass = 0xcd649f38
=== instance value ===
*** java.net.SocketImpl ***
+08 Ljava.net.Socket; socket = 0xefe97db8
+0c Ljava.net.ServerSocket; serverSocket = 0x00000000
+10 protected Ljava.io.FileDescriptor; fd = 0xefe98478
+14 protected Ljava.net.InetAddress; address = 0xdf0cb5b0
+18 protected I port = 0x00009726
+1c protected I localport = 0x0000a5b1
*** java.net.PlainSocketImpl ***
+20 private Ljava.net.SocketInputStream; socketInputStream = 0x00000000
+24 private Ljava.lang.Object; fdLock = 0xefe98468
+28 private Ljava.lang.Object; resetLock = 0xefe98470
+2c private Ljava.io.FileDescriptor; fd1 = 0x00000000
+30 private Ljava.net.InetAddress; anyLocalBoundAddr = 0xd8e4b968
44
Q/A
Copyright 2016 FUJITSU LIMITED45
Copyright 2010 FUJITSU LIMITED

More Related Content

What's hot

Using Grails to power your electric car
Using Grails to power your electric carUsing Grails to power your electric car
Using Grails to power your electric carMarco Pas
 
Head toward Java 14 and Java 15
Head toward Java 14 and Java 15Head toward Java 14 and Java 15
Head toward Java 14 and Java 15Yuji Kubota
 
Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Minchul Jung
 
GPU profiling for computer vision applications
GPU profiling for computer vision applicationsGPU profiling for computer vision applications
GPU profiling for computer vision applicationsMai Nishimura
 
자바 성능 강의
자바 성능 강의자바 성능 강의
자바 성능 강의Terry Cho
 
Intrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMIntrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMKris Mok
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-kyon mm
 
Java util concurrent
Java util concurrentJava util concurrent
Java util concurrentRoger Xia
 
Groovy, Transforming Language
Groovy, Transforming LanguageGroovy, Transforming Language
Groovy, Transforming LanguageUehara Junji
 
Choosing the right parallel compute architecture
Choosing the right parallel compute architecture Choosing the right parallel compute architecture
Choosing the right parallel compute architecture corehard_by
 
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...Evgeny Antyshev
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Anton Arhipov
 
IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8Chris Bailey
 
Nanocloud cloud scale jvm
Nanocloud   cloud scale jvmNanocloud   cloud scale jvm
Nanocloud cloud scale jvmaragozin
 
Jdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsJdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsDror Bereznitsky
 

What's hot (20)

Using Grails to power your electric car
Using Grails to power your electric carUsing Grails to power your electric car
Using Grails to power your electric car
 
Head toward Java 14 and Java 15
Head toward Java 14 and Java 15Head toward Java 14 and Java 15
Head toward Java 14 and Java 15
 
Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법
 
GPU profiling for computer vision applications
GPU profiling for computer vision applicationsGPU profiling for computer vision applications
GPU profiling for computer vision applications
 
자바 성능 강의
자바 성능 강의자바 성능 강의
자바 성능 강의
 
GlassFish v2.1
GlassFish v2.1GlassFish v2.1
GlassFish v2.1
 
Intrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMIntrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VM
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-
 
Java util concurrent
Java util concurrentJava util concurrent
Java util concurrent
 
Groovy, Transforming Language
Groovy, Transforming LanguageGroovy, Transforming Language
Groovy, Transforming Language
 
Choosing the right parallel compute architecture
Choosing the right parallel compute architecture Choosing the right parallel compute architecture
Choosing the right parallel compute architecture
 
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
 
ClassLoader Leaks
ClassLoader LeaksClassLoader Leaks
ClassLoader Leaks
 
NodeJS: an Introduction
NodeJS: an IntroductionNodeJS: an Introduction
NodeJS: an Introduction
 
De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
 
IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8
 
Nanocloud cloud scale jvm
Nanocloud   cloud scale jvmNanocloud   cloud scale jvm
Nanocloud cloud scale jvm
 
Jdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsJdk Tools For Performance Diagnostics
Jdk Tools For Performance Diagnostics
 
What's new in Java 11
What's new in Java 11What's new in Java 11
What's new in Java 11
 

Similar to Python + GDB = Javaデバッガ

Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunningguest1f2740
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance TunningTerry Cho
 
Adopting GraalVM - NE Scala 2019
Adopting GraalVM - NE Scala 2019Adopting GraalVM - NE Scala 2019
Adopting GraalVM - NE Scala 2019Petr Zapletal
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVMSylvain Wallez
 
Inside the JVM - Performance & Garbage Collector Tuning in JAVA
Inside the JVM - Performance & Garbage Collector Tuning in JAVA Inside the JVM - Performance & Garbage Collector Tuning in JAVA
Inside the JVM - Performance & Garbage Collector Tuning in JAVA Rafael Monteiro e Pereira
 
Adopting GraalVM - Scale by the Bay 2018
Adopting GraalVM - Scale by the Bay 2018Adopting GraalVM - Scale by the Bay 2018
Adopting GraalVM - Scale by the Bay 2018Petr Zapletal
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardwayDave Pitts
 
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologiess6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologiesChris Huybregts
 
Adopting GraalVM - Scala eXchange London 2018
Adopting GraalVM - Scala eXchange London 2018Adopting GraalVM - Scala eXchange London 2018
Adopting GraalVM - Scala eXchange London 2018Petr Zapletal
 
x86_64 Hardware Deep dive
x86_64 Hardware Deep divex86_64 Hardware Deep dive
x86_64 Hardware Deep diveNaoto MATSUMOTO
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaKeith Bennett
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Dinakar Guniguntala
 
Java 40 versions_sgp
Java 40 versions_sgpJava 40 versions_sgp
Java 40 versions_sgpmichaelisvy
 
Easy and High Performance GPU Programming for Java Programmers
Easy and High Performance GPU Programming for Java ProgrammersEasy and High Performance GPU Programming for Java Programmers
Easy and High Performance GPU Programming for Java ProgrammersKazuaki Ishizaki
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the BoxMarcus Hirt
 
JavaOne 2014: Java Debugging
JavaOne 2014: Java DebuggingJavaOne 2014: Java Debugging
JavaOne 2014: Java DebuggingChris Bailey
 

Similar to Python + GDB = Javaデバッガ (20)

Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
 
Adopting GraalVM - NE Scala 2019
Adopting GraalVM - NE Scala 2019Adopting GraalVM - NE Scala 2019
Adopting GraalVM - NE Scala 2019
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVM
 
Inside the JVM - Performance & Garbage Collector Tuning in JAVA
Inside the JVM - Performance & Garbage Collector Tuning in JAVA Inside the JVM - Performance & Garbage Collector Tuning in JAVA
Inside the JVM - Performance & Garbage Collector Tuning in JAVA
 
Adopting GraalVM - Scale by the Bay 2018
Adopting GraalVM - Scale by the Bay 2018Adopting GraalVM - Scale by the Bay 2018
Adopting GraalVM - Scale by the Bay 2018
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologiess6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
 
Adopting GraalVM - Scala eXchange London 2018
Adopting GraalVM - Scala eXchange London 2018Adopting GraalVM - Scala eXchange London 2018
Adopting GraalVM - Scala eXchange London 2018
 
x86_64 Hardware Deep dive
x86_64 Hardware Deep divex86_64 Hardware Deep dive
x86_64 Hardware Deep dive
 
4 Sessions
4 Sessions4 Sessions
4 Sessions
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !
 
OpenMP
OpenMPOpenMP
OpenMP
 
Java 40 versions_sgp
Java 40 versions_sgpJava 40 versions_sgp
Java 40 versions_sgp
 
Java 9 new features
Java 9 new featuresJava 9 new features
Java 9 new features
 
Easy and High Performance GPU Programming for Java Programmers
Easy and High Performance GPU Programming for Java ProgrammersEasy and High Performance GPU Programming for Java Programmers
Easy and High Performance GPU Programming for Java Programmers
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the Box
 
JavaOne 2014: Java Debugging
JavaOne 2014: Java DebuggingJavaOne 2014: Java Debugging
JavaOne 2014: Java Debugging
 
Benchmarking on JVM
Benchmarking on JVMBenchmarking on JVM
Benchmarking on JVM
 

More from Kenji Kazumura

Jakarta EE 9 と これから
Jakarta EE 9 と これからJakarta EE 9 と これから
Jakarta EE 9 と これからKenji Kazumura
 
JakartaOne Livestream Japan 2020
JakartaOne Livestream Japan 2020JakartaOne Livestream Japan 2020
JakartaOne Livestream Japan 2020Kenji Kazumura
 
GCを発生させないJVMとコーディングスタイル
GCを発生させないJVMとコーディングスタイルGCを発生させないJVMとコーディングスタイル
GCを発生させないJVMとコーディングスタイルKenji Kazumura
 
Microprofileでエンタープライズ品質
Microprofileでエンタープライズ品質Microprofileでエンタープライズ品質
Microprofileでエンタープライズ品質Kenji Kazumura
 
Versatil Javaチューニング
Versatil JavaチューニングVersatil Javaチューニング
Versatil JavaチューニングKenji Kazumura
 
JavaDayTokyo2015 [3-1]
JavaDayTokyo2015 [3-1]JavaDayTokyo2015 [3-1]
JavaDayTokyo2015 [3-1]Kenji Kazumura
 
Javaでトランザクショナルメモリを使う
Javaでトランザクショナルメモリを使うJavaでトランザクショナルメモリを使う
Javaでトランザクショナルメモリを使うKenji Kazumura
 

More from Kenji Kazumura (9)

Jakarta EE 9 と これから
Jakarta EE 9 と これからJakarta EE 9 と これから
Jakarta EE 9 と これから
 
JakartaOne Livestream Japan 2020
JakartaOne Livestream Japan 2020JakartaOne Livestream Japan 2020
JakartaOne Livestream Japan 2020
 
GCを発生させないJVMとコーディングスタイル
GCを発生させないJVMとコーディングスタイルGCを発生させないJVMとコーディングスタイル
GCを発生させないJVMとコーディングスタイル
 
Microprofileでエンタープライズ品質
Microprofileでエンタープライズ品質Microprofileでエンタープライズ品質
Microprofileでエンタープライズ品質
 
CPUから見たG1GC
CPUから見たG1GCCPUから見たG1GC
CPUから見たG1GC
 
Versatil Javaチューニング
Versatil JavaチューニングVersatil Javaチューニング
Versatil Javaチューニング
 
microprofile
microprofilemicroprofile
microprofile
 
JavaDayTokyo2015 [3-1]
JavaDayTokyo2015 [3-1]JavaDayTokyo2015 [3-1]
JavaDayTokyo2015 [3-1]
 
Javaでトランザクショナルメモリを使う
Javaでトランザクショナルメモリを使うJavaでトランザクショナルメモリを使う
Javaでトランザクショナルメモリを使う
 

Recently uploaded

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Recently uploaded (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Python + GDB = Javaデバッガ

  • 1. 2016.5.22 数村 憲治 Python + GDB = Javaデバッガ Copyright 2016 FUJITSU LIMITED JJUG CCC 2016 Spring M-5
  • 2. アジェンダ Copyright 2016 FUJITSU LIMITED やりたいこと GDB Pythonインタフェース VMStruct backtraceの実装 TODO 1
  • 3. やりたいこと Copyright 2016 FUJITSU LIMITED coreファイルをデバッグ coreからJava VM(C++)とJavaコードを同時に操作 なぜcoreなのか? 透過的なスタックトレース Javaオブジェクトのダンプ Javaならjdb、JVMならGDB。Java+JVMは? 2
  • 4. jstack - man Copyright 2016 FUJITSU LIMITED jstack(1) Troubleshooting Tools jstack(1) NAME jstack - Prints Java thread stack traces for a Java process, core file, or remote debug server. This command is experimental and unsupported. SYNOPSIS jstack [ options ] pid jstack [ options ] executable core jstack [ options ] [ server-id@ ] remote-hostname-or-IP options The command-line options. See Options. pid The process ID for which the stack trace is printed. The process must be a Java process. To get a list of Java processes running on a machine, use the jps(1) command. executable The Java executable from which the core dump was produced. core The core file for which the stack trace is to be printed. 3
  • 5. jstack - man Copyright 2016 FUJITSU LIMITED DESCRIPTION The jstack command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed. With the -m option, the jstack command prints both Java and native frames of all threads with the program counter (PC). OPTIONS -F Force a stack dump when jstack [-l] pid does not respond. -l Long listing. Prints additional information about locks such as a list of owned java.util.concurrent ownable synchronizers. See the AbstractOwnableSynchronizer class description at http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer.html -m Prints a mixed mode stack trace that has both Java and native C/C++ frames. 4
  • 6. jstack -m Copyright 2016 FUJITSU LIMITED % /v3/java/jdk1.8.0_66/bin/jstack -m /v3/java/jdk1.8.0_66/bin/java core.2017 Attaching to core core.2017 from executable /v3/java/jdk1.8.0_66/bin/java, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.66-b17 Deadlock Detection: No deadlocks found. ----------------- 2018 ----------------- 0x00007f3492d03149 __pthread_cond_timedwait + 0x129 0x00007f3491e54ff3 _ZN2os5sleepEP6Threadlb + 0x283 0x00007f3491c56f02 JVM_Sleep + 0x3b2 0x00007f348bc15994 * java.lang.Thread.sleep(long) bci:0 (Interpreted frame) 0x00007f348bc07c4d * a.xxx3() bci:11 line:15 (Interpreted frame) 0x00007f348bc07c4d * a.xxx2() bci:0 line:10 (Interpreted frame) 0x00007f348bc07c4d * a.xxx1() bci:0 line:7 (Interpreted frame) 0x00007f348bc07c4d * a.main(java.lang.String[]) bci:0 line:4 (Interpreted frame) 0x00007f348bc007a7 <StubRoutines> 0x00007f3491bc3c46 _ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread + 0x1056 0x00007f3491c05262 _ZL17jni_invoke_staticP7JNIEnv_P9JavaValueP8_jobject11JNICallTypeP10_jmethodIDP18JNI_ArgumentPushe 0x00007f3491c21c6a jni_CallStaticVoidMethod + 0x17a 0x00007f3492ae7bcc JavaMain + 0x80c ----------------- 2020 ----------------- 0x00007f3492d02da0 __pthread_cond_wait + 0xc0 0x00007f3491e0ef07 _ZN7Monitor5IWaitEP6Threadl + 0xf7 0x00007f3491e0f826 _ZN7Monitor4waitEblb + 0x256 0x00007f3491b0ad93 _ZN13GCTaskManager8get_taskEj + 0x43 0x00007f3491b0bc28 _ZN12GCTaskThread3runEv + 0x188 5
  • 7. jstackの課題 Copyright 2016 FUJITSU LIMITED スタックトレースしか出ない コアを他のマシンに移すと動作しない 拡張性に乏しい 修正が大変 6
  • 8. GDB - backtrace Copyright 2016 FUJITSU LIMITED (gdb) bt #0 0x00007f3492d03149 in pthread_cond_timedwait@@GLIBC_2.3 at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:23 #1 0x00007f3491e5361f in os::PlatformEvent::park(long) () from /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so #2 0x00007f3491e54ff3 in os::sleep(Thread*, long, bool) () from /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so #3 0x00007f3491c56f02 in JVM_Sleep () from /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so #4 0x00007f348bc15994 in ?? () #5 0x00007f348c009800 in ?? () #6 0x00007f348bc156e2 in ?? () ….. #10 0x00007f348b3b3480 in ?? () #11 0x0000000000000000 in ?? () 7
  • 9. stack unwinding Copyright 2016 FUJITSU LIMITED 呼び出し元fp pc (戻りアドレス) スタック 呼び出し元fp pc (戻りアドレス) 呼び出し先 フレーム 呼び出し元 フレーム fp(フレームポインタ) sp(スタックポインタ) デバッガは このアドレスから 該当シンボルを探す 8
  • 10. コーリングコンベンション Copyright 2016 FUJITSU LIMITED GDBは各言語のコーリングコンベンションを意識して stack unwindingしている Javaは難しい? インタプリタ・JIT・ネイティブのミックスフレーム このフレームがインタプリタフレームかどうか、 どうやって判断する? コードが動的に生成される テンプレートインタプリタ・JIT 9
  • 11. Javaコーリングコンベンション Copyright 2016 FUJITSU LIMITED A frame represents a physical stack frame (an activation). Frames can be C or Java frames, and the Java frames can be interpreted or compiled. In contrast, vframes represent source-level activations, so that one physical frame can correspond to multiple source level frames because of inlining. A frame is comprised of {pc, fp, sp} frame_x86.hpp frame interpreted compiled vframe vframe vframe 10
  • 12. Javaコーリングコンベンション Copyright 2016 FUJITSU LIMITED // Layout of asm interpreter frame: // [expression stack ] * <- sp // [monitors ] ¥ // ... | monitor block size // [monitors ] / // [monitor block size ] // [byte code index/pointr] = bcx() bcx_offset // [pointer to locals ] = locals() locals_offset // [constant pool cache ] = cache() cache_offset // [methodData ] = mdp() mdx_offset // [Method* ] = method() method_offset // [last sp ] = last_sp() last_sp_offset // [old stack pointer ] (sender_sp) sender_sp_offset // [old frame pointer ] <- fp = link() return_addr_offset // [return pc ] // [oop temp ] (only for native calls) // [locals and parameters ] // <- sender sp 11
  • 13. これまでのアプローチ Copyright 2016 FUJITSU LIMITED GDB自身の改造 OS毎にGDBをビルド 最新のGDBがすぐに使えない 修正変更の管理 HotSpotのコーリングコンベンションの追加 12
  • 14. 他のアプローチ Copyright 2016 FUJITSU LIMITED GDB JIT Compilation Interface https://sourceware.org/gdb/onlinedocs/gdb/JIT-Interface.html#JIT-Interface JITの修正が必要。インタプリタはダメ。 GDB script ifとかwhileはあるが。。。 13
  • 15. アジェンダ Copyright 2016 FUJITSU LIMITED やりたいこと GDB Pythonインタフェース VMStruct backtraceの実装 TODO 14
  • 16. Pythonインタフェース Copyright 2016 FUJITSU LIMITED https://sourceware.org/gdb/onlinedocs/gdb/Extending-GDB.html#Extending-GDB GDBでPythonスクリプトが使える PythonプログラムをGDBでデバッグすることではない configure時に--with-pythonを指定する % gdb -configuration This GDB was configured as follows: configure --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-auto-load-dir=$debugdir:$datadir/auto-load …….. --with-jit-reader-dir=/usr/lib/gdb (relocatable) --without-libunwind-ia64 --with-lzma --with-python=/usr (relocatable) 15
  • 17. Inferiorオブジェクト Copyright 2016 FUJITSU LIMITED メモリアクセス — Function: Inferior.read_memory (address, length) Read length addressable memory units from the inferior, starting at address. Returns a buffer object, which behaves much like an array or a string. It can be modified and given to the Inferior.write_memory function. In Python 3, the return value is a memoryview object 16
  • 18. メモリアクセス関数 Copyright 2016 FUJITSU LIMITED def readNbyteAsLittle(addr, size): try: buf = gdb.selected_inferior().read_memory(addr, size) except: return None i = size - 1 n = 0 while i >= 0: n = n << 8 m = ord(buf[i]) n += m i -= 1 return n 17
  • 19. 関数選択 Copyright 2016 FUJITSU LIMITED if (target.isSparc): readNbyte = readNbyteAsBig sizeof_pointer = 4 elif (target.isX86): readNbyte = readNbyteAsLittle sizeof_pointer = 4 elif (target.isX64): readNbyte = readNbyteAsLittle sizeof_pointer = 8 動作環境によって、関数を自動的に切り替え 18
  • 20. アジェンダ Copyright 2016 FUJITSU LIMITED やりたいこと GDB Pythonインタフェース VMStruct backtraceの実装 TODO 19
  • 21. VMStruct Copyright 2016 FUJITSU LIMITED JVM自身のデバッグ情報 JVM内部にテーブルとして保持 VMStructのアドバンテージ (vmStruct.hpp) クラス、フィールド、サイズ等 従来、DWARF等で定義されていたもの プラットフォーム・コンパイラ非依存 デバッグ用ビルドを作らなくてよい Javaのサイズを保持 (「jlong」 v.s. 「long long」) 20
  • 22. class VMStruct (vmStruct.hpp) Copyright 2016 FUJITSU LIMITED class VMStructs { public: // The last entry is identified over in the serviceability agent by // the fact that it has a NULL fieldName static VMStructEntry localHotSpotVMStructs[]; // The last entry is identified over in the serviceability agent by // the fact that it has a NULL typeName static VMTypeEntry localHotSpotVMTypes[]; // Table of integer constants required by the serviceability agent. // The last entry is identified over in the serviceability agent by // the fact that it has a NULL typeName static VMIntConstantEntry localHotSpotVMIntConstants[]; ……. 21
  • 23. VMStructEntry Copyright 2016 FUJITSU LIMITED typedef struct { const char* typeName; // The type name containing the given field (example: "Klass") const char* fieldName; // The field name within the type (example: "_name") const char* typeString; // Quoted name of the type of this field (example: "Symbol*"; int32_t isStatic; // Indicates whether following field is an offset or an address uint64_t offset; // Offset of field within structure; only used for nonstatic fields void* address; // Address of field; only used for static fields } VMStructEntry; Hotspot VMを構成する(C++の)クラス・フィールドを表現 22
  • 24. VMStructEntry – 対応例 Copyright 2016 FUJITSU LIMITED typedef struct { const char* typeName; const char* fieldName; const char* typeString; int32_t isStatic; uint64_t offset; void* address; } class Klass : public Metadata { friend class VMStructs; … Symbol* _name; vmStruct.hpp klass.hpp _nameの(Klassクラスの先 頭からの)オフセット使わない (staticのみ) 0 23
  • 25. vmstructコマンド Copyright 2016 FUJITSU LIMITED class VMStruct (gdb.Command): def __init__ (self): super (VMStruct, self).__init__ ("info vmstruct", gdb.COMMAND self.gHotSpot = memory.getSymbolAddr("gHotSpotVMStructs") self.typeNameOffset = memory.readUint64FromSymbol( ¥ "gHotSpotVMStructEntryTypeNameOffset") self.fieldNameOffset = memory.readUint64FromSymbol( ¥ "gHotSpotVMStructEntryFieldNameOffset") self.typeStringOffset = memory.readUint64FromSymbol( ¥ "gHotSpotVMStructEntryTypeStringOffset") self.isStaticOffset = memory.readUint64FromSymbol( ¥ "gHotSpotVMStructEntryIsStaticOffset") 24
  • 26. vmstructコマンド Copyright 2016 FUJITSU LIMITED src = memory.readPointer(self.gHotSpot) self.vmstruct = [] while (True) : entry = self.readVMStructEntry(src) if (entry == None): break self.vmstruct.append(entry) src += VMStructEntry.entrySize __init__の続き 25
  • 27. vmstructコマンド Copyright 2016 FUJITSU LIMITED def readVMStructEntry(self, addr): #TypeName target = memory.readPointer(addr + self.typeNameOffset) if (target == 0): return None else: typeName = memory.readString(target) if (typeName == ""): return None #FieldName target = memory.readPointer(addr + self.fieldNameOffset) if (target == 0): fieldName= "" else: fieldName = memory.readString(target) 26
  • 28. vmstructコマンド Copyright 2016 FUJITSU LIMITED def invoke(self, arg, from_tty): args = arg.split() argNum = len(args) if (argNum == 0): for entry in self.vmstruct: entry.printEntry() elif (argNum == 1): typeName = args[0] for entry in self.vmstruct: if entry.typeName.startswith(arg): entry.printEntry() elif (argNum == 2): … else: print ("usage : info vmstruct") print (" : info vmstruct <typeName>") 27
  • 29.
  • 30. アジェンダ Copyright 2016 FUJITSU LIMITED やりたいこと GDB Pythonインタフェース VMStruct backtraceの実装 TODO 29
  • 31. backtraceの実現ステップ Copyright 2016 FUJITSU LIMITED 現在のフレームが、Javaのフレームかどうか判断する 現在のフレームを実行しているメソッド名を求める 前のフレーム(fp等)をセットする unwinderの登録 frame filterの登録 30
  • 32. unwinder Copyright 2016 FUJITSU LIMITED フレームをたどる処理 GDBにunwinderを登録しておくと、 フレーム処理のたびに呼び出される unwinderでは、 自分が処理すべきフレームであればgdb.UnwindInfoを、 そうでなければNoneを返却。 31
  • 33. unwinder登録 Copyright 2016 FUJITSU LIMITED if (target.isX64): jvmunwinder = JVMUnwinderX64() gdb.unwinder.register_unwinder(None, jvmunwinder) class JVMUnwinderX64(AbstractJVMUnwinder): name = "JVMUnwinderX64" enabled = True def __init__(self): super(JVMUnwinderX64, self).__init__() 32
  • 34. unwinder呼び出し Copyright 2016 FUJITSU LIMITED def __call__(self, pending_frame): pc = pending_frame.read_register('rip') sp = pending_frame.read_register('rsp') bp = pending_frame.read_register('rbp') 33
  • 35. unwinder呼び出し(続き) Copyright 2016 FUJITSU LIMITED if self.isInterpretedFrame(pc) : sp = bp + sender_sp_offset * memory.sizeof_pointer pc = gdb.Value(memory.readPointer(bp + ¥ return_addr_offset * memory.sizeof_pointer)) bp = gdb.Value(memory.readPointer(bp)) uinfo = pending_frame.create_unwind_info(FrameId(sp)) uinfo.add_saved_register(6, bp) uinfo.add_saved_register(7, sp) uinfo.add_saved_register(16, pc) return uinfo elif self.iscCompiledFrame(pc) : … else: return None 34
  • 36. Javaコーリングコンベンション(再掲) Copyright 2016 FUJITSU LIMITED // Layout of asm interpreter frame: // [expression stack ] * <- sp // [monitors ] ¥ // ... | monitor block size // [monitors ] / // [monitor block size ] // [byte code index/pointr] = bcx() bcx_offset // [pointer to locals ] = locals() locals_offset // [constant pool cache ] = cache() cache_offset // [methodData ] = mdp() mdx_offset // [Method* ] = method() method_offset // [last sp ] = last_sp() last_sp_offset // [old stack pointer ] (sender_sp) sender_sp_offset // [old frame pointer ] <- fp = link() return_addr_offset // [return pc ] // [oop temp ] (only for native calls) // [locals and parameters ] // <- sender sp 35
  • 37. isInterpretedFrame Copyright 2016 FUJITSU LIMITED class AbstractJVMUnwinder: __ai = memory.readPointer( ¥ vmstruct.getValue("AbstractInterpreter", "_code")) __sq_sb = memory.readPointer( __ai + vmstruct.getValue("StubQueue", "_stub_buffer")) __sq_bl= memory.readNbyte( __ai + vmstruct.getValue("StubQueue", "_buffer_limit"), ¥ vmtype.getValue("int")) def isInterpretedFrame(self, addr): return ((addr >= self.__sq_sb) and ¥ (addr < self.__sq_sb + self.__sq_bl)) 36
  • 38. AbstractInterpreter Copyright 2016 FUJITSU LIMITED class AbstractInterpreter: AllStatic { friend class VMStructs; protected: static StubQueue* _code; // the interpreter code (codelets) abstractInterpreter.hpp stubs.hpp class StubQueue: public CHeapObj<mtCode> { friend class VMStructs; private: StubInterface* _stub_interface; // the interface prototype address _stub_buffer; // where all stubs are stored int _buffer_size; // the buffer size in bytes 37
  • 39. frame filter登録 Copyright 2016 FUJITSU LIMITED class JavaFilter(): def __init__(self): self.name = "JavaFilter" self.priority = 100 self.enabled = True gdb.frame_filters[self.name] = self def filter(self, frame_iter): frame_iter = map(JavaDecorator, frame_iter) return frame_iter 38
  • 40. decorator登録 Copyright 2016 FUJITSU LIMITED class JavaDecorator(gdb.FrameDecorator.FrameDecorator): def __init__(self, fobj): super(JavaDecorator, self).__init__(fobj) def function(self): frame = self.inferior_frame() pc = frame.pc() if jvmunwinder.isInterpretedFrame(pc) : methodOop = jvmunwinder.getMethodOop(frame) name = oop.getMethodName(methodOop) return ("j " + name) elif jvmunwinder.isEntryFrame(pc) : return " <<entryframe>>" return str(frame.name()) 39
  • 41. backtrace Copyright 2016 FUJITSU LIMITED (gdb) bt #0 0x00007f3492d03149 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238 #1 0x00007f3491e5361f in os::PlatformEvent::park(long) () at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so #2 0x00007f3491e54ff3 in os::sleep(Thread*, long, bool) () at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so #3 0x00007f3491c56f02 in JVM_Sleep () at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so #4 0x00007f348bc15994 in j java/lang/Thread#sleep(J)V () #5 0x00007f348bc07c4d in j a#xxx3()V () #6 0x00007f348bc07c4d in j a#xxx2()V () #7 0x00007f348bc07c4d in j a#xxx1()V () #8 0x00007f348bc07c4d in j a#main([Ljava/lang/String;)V () #9 0x00007f348bc007a7 in <<entryframe>> () #10 0x00007f3491bc3c46 in JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, T at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/libjvm.so #11 0x00007f3491c05262 in jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID #12 0x00007f3491c21c6a in jni_CallStaticVoidMethod () at /v3/java/jdk1.8.0_66/jre/lib/amd64/server/ #13 0x00007f3492ae7bcc in JavaMain () at /v3/java/jdk1.8.0_66/bin/../lib/amd64/jli/libjli.so #14 0x00007f3492cfd6aa in start_thread (arg=0x7f349311b700) at pthread_create.c:333 #15 0x00007f3492618eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109 40
  • 42.
  • 43. アジェンダ Copyright 2016 FUJITSU LIMITED やりたいこと GDB Pythonインタフェース VMStruct backtraceの実装 TODO 42
  • 44. TODO Copyright 2016 FUJITSU LIMITED 各種プラットフォーム展開 コマンド充実 oopコマンド ライブデバッグ JDK9 43
  • 45. oopコマンド Copyright 2016 FUJITSU LIMITED (instanceOop*) 0xefe983d0 : oop is java.net.SocksSocketImpl instance. +00 markOop _mark = 0x3ce7e9f8 +04 klassOop _klass = 0xcd649f38 === instance value === *** java.net.SocketImpl *** +08 Ljava.net.Socket; socket = 0xefe97db8 +0c Ljava.net.ServerSocket; serverSocket = 0x00000000 +10 protected Ljava.io.FileDescriptor; fd = 0xefe98478 +14 protected Ljava.net.InetAddress; address = 0xdf0cb5b0 +18 protected I port = 0x00009726 +1c protected I localport = 0x0000a5b1 *** java.net.PlainSocketImpl *** +20 private Ljava.net.SocketInputStream; socketInputStream = 0x00000000 +24 private Ljava.lang.Object; fdLock = 0xefe98468 +28 private Ljava.lang.Object; resetLock = 0xefe98470 +2c private Ljava.io.FileDescriptor; fd1 = 0x00000000 +30 private Ljava.net.InetAddress; anyLocalBoundAddr = 0xd8e4b968 44