2010-09-17 42 views
13

有趣的東西發生時,我調試CI服務器上的單元測試之一(實際上maven構建)。我使用strace -ff -e trace=network -p [pid]連接到java進程以跟蹤構建過程的網絡活動。這就是我所看到的:大量的SIGSEGV雖然strace'ing Java過程

Process 26324 attached 
Process 26325 attached (waiting for parent) 
Process 26325 resumed (parent 26312 ready) 
Process 26325 detached 
Process 26324 detached 
Process 26320 detached 
Process 26317 detached 
Process 26308 resumed 
[pid 26308] --- SIGCHLD (Child exited) @ 0 (0) --- 
Process 26307 resumed 
Process 26308 detached 
[pid 26310] --- SIGCHLD (Child exited) @ 0 (0) --- 
Process 26310 detached 
[pid 25551] --- SIGSEGV (Segmentation fault) @ 0 (0) --- 
Process 26309 detached 
Process 26307 detached 
[pid 25717] --- SIGSEGV (Segmentation fault) @ 0 (0) --- 
[pid 25715] --- SIGSEGV (Segmentation fault) @ 0 (0) --- 
[pid 25713] --- SIGSEGV (Segmentation fault) @ 0 (0) --- 
[pid 25551] socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 163 
[pid 25551] setsockopt(163, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0 
[pid 25551] bind(163, {sa_family=AF_INET, sin_port=htons(6590), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 
Process 26471 attached (waiting for parent) 
Process 26471 resumed (parent 25551 ready) 
[pid 25551] --- SIGSEGV (Segmentation fault) @ 0 (0) --- 
[pid 25551] --- SIGSEGV (Segmentation fault) @ 0 (0) --- 
[pid 26471] recvfrom(163, <unfinished ...> 
[pid 25551] socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 164 
[pid 25551] setsockopt(164, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0 
[pid 25551] bind(164, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 
[pid 25551] getsockname(164, {sa_family=AF_INET, sin_port=htons(45728), sin_addr=inet_addr("0.0.0.0")},[16]) = 0 
[pid 25551] --- SIGSEGV (Segmentation fault) @ 0 (0) --- 
[pid 26471] <... recvfrom resumed> 0x8e80618, 65536, 0, 0x6ef6aea0, 0x6ef6ae9c) = ? ERESTARTSYS (To be restarted) 
[pid 26471] --- SIGRT_29 (Real-time signal 27) @ 0 (0) --- 
Process 26471 detached 
Process 26472 attached (waiting for parent) 
Process 26472 resumed (parent 25551 ready) 
Process 26473 attached (waiting for parent) 
Process 26473 resumed (parent 25551 ready) 

因此,有我們有一些網絡活動(這是什麼,我其實搜索),很多SIGSEGV信號。

構建完成正確(只是一個破碎的測試)。情況一次又一次地可確定和再現。這是什麼意思?

回答

17

由於這是java,這意味着您的JVM正在使用SIGSEGVs來實現某些功能。常見的用途包括

  • 空指針引用 - ,JVM可以捕獲SIGSEGVs地址0,並把它們轉化成NullPointerExceptions的

  • 垃圾收集寫屏障 - 很少更改的頁面都標記爲只讀和SEGVs抓寫入他們。這樣垃圾收集器就不必重新掃描所有的內存。

+1

很有意思,謝謝!你能提供一些鏈接,我可以找到更多關於這個東西的信息嗎? – 2010-09-17 00:57:00

+0

那麼這是無害的還是應該解決?我在通過truss在solaris上運行的應用程序中看到類似的情況。 – Tom 2011-04-04 16:22:03

+1

我認爲沒有必要擔心:) – 2011-04-24 03:38:54