- 论坛徽章:
- 0
|
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. |
|