子墨子曾经曰过,LTP是个好模型!
car老师oneplus还有bhan开发的LTP4J是个很好的项目,使用起来也非常方便,下面贴几个常见的错误使用引起的bug的log分析
1、现象描述:程序中断,生成一个hs_err_pidXXXX.log文件
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fab8c69b911, pid=2398, tid=140375976539904
#
# JRE version: Java(TM) SE Runtime Environment (8.0_73-b02) (build 1.8.0_73-b02)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.73-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libsegmentor.so.0.2.0+0x1a911] _ZN5boost12regex_searchIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS5_EEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SD_RNS_13match_resultsISD_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsESD_.constprop.277+0x11
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/xxx/test/java_test/CorefModule/hs_err_pid2398.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
问题可能的原因:
内存不够了 ---> -Xmx2G 以上
模型文件没找到 ---> 确认模型文件路径是否存在
模型没有写初始化代码 ---> 在函数执行的时候初始化一下
2、现象描述:程序中断,下面有的还有详细信息,显示的是.so错误
*** glibc detected *** java: corrupted double-linked list: 0x00007fc774139dc0 ***
问题可能的原因:
系统版本和源码、模型版本不匹配 ---> 模型下载最新版本的
附C语言中这种问题的几种原因:From http://blog.csdn.net/yalisiyi1/article/details/9284391
两个原因
1.
int* a = new int(10);
delete a;
delete a; //
2. int* a;
delete a; //
还有一个
char s[10];
int* a = new int(10);
sprintf(s, "1234567890");
delete a; // a 被前面的给覆盖了
======================================================
当然把各种问题的原因,在源码中多打印一些log就更好啦~~