1. 개요

멀쩡하던 WAS가 갑자기 Crash~~~

SIGBUS 시그널을 맞고 다운되었습니다. 

왜요?? 왜죠?? 왜?? 갑자기 왜일까요?ㅠ_ㅠ (ㅋㅋㅋ)

 

 

2. 추적

JVM이 다운되면서 hs err 파일을 남겨주었습니다. SIGSEGV 맞고 죽는건 많이 봤는데...이건 오랜만이네요! ㅎㅎ

 

 1) JVM Error Dump 파일 : SIGBUS 시그널을 어디서 받았는지? 아하! libzip.so 이 라이브러리와 관련이 있다고 하네요!

================================================================

#
# A fatal error has been detected by the Java Runtime Environment:
#
SIGBUS (0x7) at pc=0x00007f19054a6582, pid=16191, tid=139742179178240
#
# JRE version: Java(TM) SE Runtime Environment (7.0_80-b15) (build 1.7.0_80-b15)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.80-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libzip.so+0x4582]  newEntry+0x62
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00007f18bc015800):  JavaThread "WAS-ajp-9029-exec-12 /서비스URI" daemon [_thread_in_native, id=108406, stack(0x00007f1842e33000,0x00007f1842f34000)]

siginfo:si_signo=SIGBUS: si_errno=0, si_code=2 (BUS_ADRERR), si_addr=0x00007f1842fe20cc

Registers:
RAX=0x00007f18b41aae90, RBX=0x00007f18380ce790, RCX=0x00007f18b41aae80, RDX=0x00007f18b41aae90
RSP=0x00007f1842f2de80, RBP=0x00007f1842f2ded0, RSI=0x00007f18b4000038, RDI=0x0000000000000000

....

================================================================

 

 2) 애석하게도 이 시스템엔 core 파일이 쌓일 수가 없었네요..

    ulimit 에 coredump 가 0으로 설정되어 있었습니다. ㅠ.ㅠ 담번에 설정해두고 봐야겠습니다. 

 

 

 

3. 사례 검색

역시 구글링으로 해결책을 모색해 봅니다.

linux 에서 running 중인 java 프로세스의 SIGBUS crash 사례를 찾아보니, 제가 만났던 이슈 같은 글들이 많습니다.

결국, 오동작 인거라고 봐야 할까요? 이 현상의 원인으로 아래와 같은 글을 찾았습니다. :)

java가 live 한 상태에서 jar 파일 같은 파일이 변경/업데이트 되는 경우에 이렇게 crash가 날 수 있다고 하네요. 흑 ㅠ

 

==========================================================================================================================================

This is a common issue where a process or thread has modified the contents of a jar/zip file while it has been mmap'ed into memory by the JDK process.

The JDK cannot protect against such action without a performance impact. The JDK mmaps in the central directory on zip files on Linux and Solaris OSes. 

Runing JDKs with -Dsun.zip.disableMemoryMapping=true system property will disable memory mapping and the application will fail instead with a "file corrupted" type ZipException

Marking this incomplete. Submitter will need to determine who/what is updating the jar/zip file that's causing issue.

==========================================================================================================================================

 

 

4. 다른 원인은 없을까?

https://bugs.java.com/view_bug.do?bug_id=7007769

이 링크에서 보면,  "VM crashes with SIGBUS writing PerfData if tmp space is full"

/tmp 가 full 이 나도 SIGBUS 시그널을 맞고 vm이 crash 가 날 수 있다고 하네요.

crash의 세계는 여전히 어렵네요...ㅎㅎㅎ