delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/08/12/11:16:54

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "John Hanley" <jdhanley AT telusplanet DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: program hanging
Date: Thu, 12 Aug 2004 09:10:40 -0600
Organization: University of Alberta
Lines: 103
Message-ID: <1092323368.400488@proxy2.srv.ualberta.ca>
References: <1092258885 DOT 100659 AT proxy2 DOT srv DOT ualberta DOT ca> <7105-Thu12Aug2004064431+0300-eliz AT gnu DOT org>
NNTP-Posting-Host: proxy2.srv.ualberta.ca
X-Trace: tabloid.srv.ualberta.ca 1092323370 27545 129.128.5.161 (12 Aug 2004 15:09:30 GMT)
X-Complaints-To: abuse AT ualberta DOT ca
NNTP-Posting-Date: Thu, 12 Aug 2004 15:09:30 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Cache-Post-Path: proxy2.srv.ualberta.ca!unknown AT d199-126-23-72 DOT abhsia DOT telus DOT net
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Eli Zaretskii" <eliz AT gnu DOT org> wrote in message
news:7105-Thu12Aug2004064431+0300-eliz AT gnu DOT org...
> > From: "John Hanley" <jdhanley AT telusplanet DOT net>
> > Newsgroups: comp.os.msdos.djgpp
> > Date: Wed, 11 Aug 2004 15:16:00 -0600
> >
> > My DOS program compiled under DJGPP seems to be hanging.  When I try
running
> > it, it doesn't even get to the first printf statement in the program.
When
> > I debugged it with gdb, the first time it stepped through ok, the second
> > time I set a breakpoint for line 1 and it didn't even make it there.
How
> > does  a program hang before it gets to the first line of the program?
>
> One possibility is that you have large automatic arrays or structures
> that overflow the run-time stack.

Well I do have some arrays.  I didn't think they were that large, however.
Here are my structs:
struct data_record
{
 long int stn_id;
     long int date;
 int yr;
 int mo;
 int dy;
 int elem;
 long int value[96];
 char f[32];
 struct data_record * next;
     struct data_record * prev;
};

/* data_list is a linked list of data_record structs
 * and contains a pointer to the head and tail.
 */
struct data_list
{
 struct data_record * head;
 struct data_record * tail;
};

/* data_day_DLY is a struct for use with the DLY format.
 * When the data_list linked list is full, all the
 * data_records are split up into daily data_day_DLY records.
 * data_day_DLY represents the data for each day.
 */
struct data_day_DLY
{
 long int stn_id;
     long int date;
     int yr;
     int mo;
     int day;
     long int element_data[20][2]; /* two dimensional array.
          store elem_data[element][data] */
     struct data_day_DLY * next;
     struct data_day_DLY * prev;
};

/* A linked list of data_day_DLY records
 * containing pointers to the head and
 * tail of the list.
 */
struct data_day_DLY_list
{
 struct data_day_DLY * head;
     struct data_day_DLY * tail;
};

/* The parameter_list contains the variables
 * read in from the parameter file.
 */
struct parameter_list
{
 long int stn_id;
     long start_date;
     long end_date;
     int start_year;
     int start_month;
     int start_day;
     int end_year;
     int end_month;
     int end_day;
     int start_hour;
     int end_hour;
     long int elements[20];
     int number_of_elements;
}parameters;

Apart from this, I have a char [693] temporary array for reading in a large
line from a file, also a couple of long int[96] temporary rarrays in my
other code.

Do any of these look like too much?

Thanks again!

John


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019