免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3162 | 回复: 0
打印 上一主题 下一主题

[HP-UX]A very strange error while running a C program in HP-UX 11.0 system [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-04-22 10:30 |只看该作者 |倒序浏览
So far I am sufferring from a strange error when running a C program in HP-UX 11.0, the error message is

===========================================================================
# ./gprs_jobok_rep

Pid 23708 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.
Memory fault(coredump)
===========================================================================

where 23708 is exactly the pid of the process gprs_jobok_rep.
To my surprise, there is actually not any evidence in the source codes leading to memory boom. The starting sections of main program are listed as the follows:

===========================================================================
void main( int argc, char *argv[])
{
   FILE *jobok_fptr, *jobok_dur_fptr;
   struct tm *tmptr;
   struct bin_taxi_diagnostics bi;
   struct bout_taxi_diagnostics bo;
   struct mdt_pkts_struct gpkt;
   long job = 0;
   time_t day_time, start_time;
   int i, j, mode = REP_WITHOUT_DEBUG;
   int day, mth, yr, num_days;
   int day_cnt, hr, tx_type, veh_id;
   unsigned char flag;
   char opt_dir[300];
   char start_date_str[11], jobok_repname[200], jobok_dur_repname[200];
   unsigned char pkttype, spkttype;

   if( argc < 5 )
   {
       printf( \"Usage: gprs_jobok_rep start_date num_days gprs_jobok_rep gprs_jobok_dur_rep\\n\" );
       printf( \"Eg.  : gprs_jobok_rep 01/07/2004 30\\n\" );
       printf( \"D - optional, to print debug statements\\n\" );
       exit( -1 );
   }
.................................................................
===========================================================================

Absolutely the program will fall into the code section with bold fond. There is no reason to get \"insufficient memory\" error. The problem has never occurred in other similar programs.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP