gdb调试运行程序报错,哪位遇到过这种错误?

和平战马 2013-08-28 09:58:33
主机:HP-UX B.11.31 U ia64 (td)
用gdb调试程序的时候报下面错误,不知道什么原因大致报错,请大侠指明一下。谢谢。
现在TB_CM_USR_201307这个重构的表记录是100万,当重构表记录很少的时候,是不会报错的。
2013-08-28 08:48:49 24724 EDM V01.00.00 start...
2013-08-28 08:48:49 24724 ./DATA_FILE/PRE/TB_CM_USR_201307.pre TB_CM_USR_201307重构开始
2013-08-28 08:48:49 24724 ./DATA_FILE/PRE/TB_CM_USR_201307.pre 用户资料重构

Program received signal SIGINT, Interrupt
si_code: 0 - .
0x9fffffffbeeaaad0:0 in lxoCvChar+0x250 ()
from /home/oracle/product/10.2.0/lib/libclntsh.so.10.1

...全文
732 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2013-08-30
  • 打赏
  • 举报
回复
Windows的注册表里面好象也有类似设置,如果程序运行太久,系统自动中断其运行。
max_min_ 2013-08-30
  • 打赏
  • 举报
回复
引用 7 楼 zhan_horse 的回复:
已经OK了,由于在HP的UNIX系统前台调下面的命令,如果程序运行太久,系统会在自动中断这个运行程序。 UDRefactor 2 ./DATA_FILE/PRE TB_CM_USR_201307 201307 HZ ./UDRefactor/config/UDR_PROG.ini 把命令放在SHELL脚本中放在后台执行,程序能够正常运行完!
和平战马 2013-08-30
  • 打赏
  • 举报
回复
已经OK了,由于在HP的UNIX系统前台调下面的命令,如果程序运行太久,系统会在自动中断这个运行程序。 UDRefactor 2 ./DATA_FILE/PRE TB_CM_USR_201307 201307 HZ ./UDRefactor/config/UDR_PROG.ini 把命令放在SHELL脚本中放在后台执行,程序能够正常运行完!
赵4老师 2013-08-29
  • 打赏
  • 举报
回复
#8 0x9fffffffbf670670:0 in oracle::occi::ResultSetImpl::getString () at occiResultSetImpl.cpp:1156 处理过长的string或包含非法字符的string或处理该string时内存不够用了。 有时不写日志到文件中是无论如何也发现不了问题在哪里的,包括捕获各种异常、写日志到屏幕、单步或设断点或生成core文件、……这些方法都不行! 写日志到文件参考下面:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
    #include <windows.h>
    #include <io.h>
#else
    #include <unistd.h>
    #include <sys/time.h>
    #include <pthread.h>
    #define  CRITICAL_SECTION   pthread_mutex_t
    #define  _vsnprintf         vsnprintf
#endif
//Log{
#define MAXLOGSIZE 20000000
#define MAXLINSIZE 16000
#include <time.h>
#include <sys/timeb.h>
#include <stdarg.h>
char logfilename1[]="MyLog1.log";
char logfilename2[]="MyLog2.log";
static char logstr[MAXLINSIZE+1];
char datestr[16];
char timestr[16];
char mss[4];
CRITICAL_SECTION cs_log;
FILE *flog;
#ifdef WIN32
void Lock(CRITICAL_SECTION *l) {
    EnterCriticalSection(l);
}
void Unlock(CRITICAL_SECTION *l) {
    LeaveCriticalSection(l);
}
#else
void Lock(CRITICAL_SECTION *l) {
    pthread_mutex_lock(l);
}
void Unlock(CRITICAL_SECTION *l) {
    pthread_mutex_unlock(l);
}
#endif
void LogV(const char *pszFmt,va_list argp) {
    struct tm *now;
    struct timeb tb;

    if (NULL==pszFmt||0==pszFmt[0]) return;
    _vsnprintf(logstr,MAXLINSIZE,pszFmt,argp);
    ftime(&tb);
    now=localtime(&tb.time);
    sprintf(datestr,"%04d-%02d-%02d",now->tm_year+1900,now->tm_mon+1,now->tm_mday);
    sprintf(timestr,"%02d:%02d:%02d",now->tm_hour     ,now->tm_min  ,now->tm_sec );
    sprintf(mss,"%03d",tb.millitm);
    printf("%s %s.%s %s",datestr,timestr,mss,logstr);
    flog=fopen(logfilename1,"a");
    if (NULL!=flog) {
        fprintf(flog,"%s %s.%s %s",datestr,timestr,mss,logstr);
        if (ftell(flog)>MAXLOGSIZE) {
            fclose(flog);
            if (rename(logfilename1,logfilename2)) {
                remove(logfilename2);
                rename(logfilename1,logfilename2);
            }
        } else {
            fclose(flog);
        }
    }
}
void Log(const char *pszFmt,...) {
    va_list argp;

    Lock(&cs_log);
    va_start(argp,pszFmt);
    LogV(pszFmt,argp);
    va_end(argp);
    Unlock(&cs_log);
}
//Log}
int main(int argc,char * argv[]) {
    int i;
#ifdef WIN32
    InitializeCriticalSection(&cs_log);
#else
    pthread_mutex_init(&cs_log,NULL);
#endif
    for (i=0;i<10000;i++) {
        Log("This is a Log %04d from FILE:%s LINE:%d\n",i, __FILE__, __LINE__);
    }
#ifdef WIN32
    DeleteCriticalSection(&cs_log);
#else
    pthread_mutex_destroy(&cs_log);
#endif
    return 0;
}
//1-78行添加到你带main的.c或.cpp的那个文件的最前面
//81-85行添加到你的main函数开头
//89-93行添加到你的main函数结束前
//在要写LOG的地方仿照第87行的写法写LOG到文件MyLog1.log中
和平战马 2013-08-29
  • 打赏
  • 举报
回复
引用 2 楼 max_min_ 的回复:
Program received signal SIGINT, Interrupt 这是你外界中断的?还是调试的时候中断的? 多了才出问题的?看看堆分配使用的情况,有没有泄漏
应该是由于外界中断,但不知道是什么原因导致中断的的
和平战马 2013-08-29
  • 打赏
  • 举报
回复
引用 1 楼 zhao4zhong1 的回复:
使用bt命令可以查看进程意外退出前函数调用的堆栈,内容为从上到下列出对应从里层到外层的函数调用历史。
使用bt命令查看情况,不过自己看得不太明白,请麻烦指教。谢谢! #0 0x9fffffffbc8be480:0 in real_malloc+0x560 () from /usr/lib/hpux64/libc.so.1 #1 0x9fffffffbc8bd6e0:0 in _malloc+0x1a0 () from /usr/lib/hpux64/libc.so.1 #2 0x9fffffffbc8c8ba0:0 in malloc+0x160 () from /usr/lib/hpux64/libc.so.1 #3 0x9fffffffbc967850:0 in __libc_mutex_alloc+0x50 () from /usr/lib/hpux64/libc.so.1 #4 0x9fffffffbcffa4d0:0 in _HPMutexWrapper::init()+0x90 () from /usr/lib/hpux64/libstd_v2.so.1 #5 0x9fffffffbf621ed0:0 in std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_C_getRep () at /usr/local/packages/compiler/opt/aCC/include_std/rw/string_ref:228 #6 0x9fffffffbf621a30:0 in std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string () at /usr/local/packages/compiler/opt/aCC/include_std/string.cc:143 #7 0x9fffffffbf6227b0:0 in std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string () at /usr/local/packages/compiler/opt/aCC/include_std/string:217 #8 0x9fffffffbf670670:0 in oracle::occi::ResultSetImpl::getString () at occiResultSetImpl.cpp:1156 #9 0x40000000000d9c20:0 in CRecordSet::FetchString ( No.Identifier_21=0x9fffffffffffdf88, this=0x60000000000be090, nColIndex=1) at COracleDB.cpp:1289 #10 0x400000000015fdb0:0 in CBindSQL::OutStrPointer (this=0x60000000000afcb0, pszParam=0x60000000001a7720 "YFWXKD2052485563") at COracleDB.cpp:5133 #11 0x400000000015fa40:0 in CBindSQL::operator>> (this=0x60000000000afcb0, pszParam=0x60000000001a7720 "YFWXKD2052485563") at COracleDB.cpp:5501 #12 0x400000000005f120:0 in CConvert::TbCommCmZhb (this=0x9fffffffffffeac0) at CConvert.cpp:136 #13 0x40000000001e79b0:0 in std::mem_fun_ref_t<long,CConvert>::operator() ( this=0x9fffffffffffea30, __p=@0x9fffffffffffeac0) at /opt/aCC/include_std/functional:447 #14 0x40000000001e0840:0 in main (argc=7, argv=0x9ffffffffffff1a8) at UDRefactor.cpp:156
和平战马 2013-08-29
  • 打赏
  • 举报
回复
[quote=引用 5 楼 zhao4zhong1 的回复:]
#8 0x9fffffffbf670670:0 in oracle::occi::ResultSetImpl::getString ()
at occiResultSetImpl.cpp:1156
处理过长的string或包含非法字符的string或处理该string时内存不够用了。

有时不写日志到文件中是无论如何也发现不了问题在哪里的,包括捕获各种异常、写日志到屏幕、单步或设断点或生成core文件、……这些方法都不行! 写日志到文件参考下面:

程序中已经写了日志的,不过还是按你提供的方法,修改了日志方式,程序运行后的情况:
$ UDRefactor 2 ./DATA_FILE/PRE TB_CM_USR_201307 201307 HZ ./UDRefactor/config/UDR_PROG.ini
2013-08-29 15:39:54 5005 UDRefactor V01.00.00 start...
2013-08-29 15:39:54 5005 ./DATA_FILE/PRE/TB_CM_USR_201307.pre TB_CM_USR_201307重构开始
2013-08-29 15:39:55 5005 ./DATA_FILE/PRE/TB_CM_USR_201307.pre 用户资料重构
$


max_min_ 2013-08-28
  • 打赏
  • 举报
回复
Program received signal SIGINT, Interrupt 这是你外界中断的?还是调试的时候中断的? 多了才出问题的?看看堆分配使用的情况,有没有泄漏
赵4老师 2013-08-28
  • 打赏
  • 举报
回复
使用bt命令可以查看进程意外退出前函数调用的堆栈,内容为从上到下列出对应从里层到外层的函数调用历史。

33,311

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧