Exectuable size = 0 after Ctrl+Break?

Exectuable size = 0 after Ctrl+Break?

Post by Alexander Stapf » Fri, 04 Jul 2003 20:46:26



Hi,

I have a strange problem I can not find any solution for:

I am working at a program running under Romdos, compiled with djgpp 2
(gcc version 3.1) and using allegro 4.0.1. In the past I noticed, that on
some rare occasions, after a program crash the file size of the
executable was set to 0 bytes and the date to 01.01.1999.

Now I found, that I can reproduce the problem every time I hit
ctrl+break, which makes my program crash. Every time after such a crash
the executable size is set to 0 and the date again to 01.01.1999. Even
changing the file mode to "write protected" doesn't change that
behaviour.

The strange thing is, that my program never opens the executable for
writing (it is opened in rb mode at start up to check the file CRC but
closed after that - nevertheless my program writes once a second to an
other file but flushes and closes it after writing one data packet).

My main problem is, that the file is corrupted at a crash - normally
there is no keyboard connected to the computer running the program - but
I guess that both problems have the same cause.

Thanks for your help,
Alexander

 
 
 

Exectuable size = 0 after Ctrl+Break?

Post by Hans-Bernhard Broeke » Fri, 04 Jul 2003 21:01:17



> I am working at a program running under Romdos, compiled with djgpp 2
> (gcc version 3.1) and using allegro 4.0.1. In the past I noticed, that on
> some rare occasions, after a program crash the file size of the
> executable was set to 0 bytes and the date to 01.01.1999.

It being the least commonly used component of your setup, and yours
being the first time I remember ever having seen a report of a
misbehaviour like this, my prime suspect would be some horrible bug in
ROMDOS's file handling code.

Quote:> The strange thing is, that my program never opens the executable for
> writing (it is opened in rb mode at start up to check the file CRC but
> closed after that - nevertheless my program writes once a second to an
> other file but flushes and closes it after writing one data packet).

Please try doing without this and see if that gets you rid of the problem.

Since you're using allegro: did you by any chance embed some allegro
data into the executable?  That might keep a handle the executable
file open, too.

--

Even if all the snow were burnt, ashes would remain.

 
 
 

Exectuable size = 0 after Ctrl+Break?

Post by Alexander Stapf » Fri, 04 Jul 2003 23:48:33


Hi,

Quote:> It being the least commonly used component of your setup, and yours
> being the first time I remember ever having seen a report of a
> misbehaviour like this, my prime suspect would be some horrible bug in
> ROMDOS's file handling code.

I already searched for a documented bug in Romdos but couldn't find
anyone reporting such a misbehaviour. The datalight support hasn't
answered yet.

Quote:> Please try doing without this and see if that gets you rid of the
> problem.

I just disabled alle CRC checking and all writing to files. The only file
I use right now is an allegro data file which is opend at start up und
closed as soon as all data has been copied to memory. So this file isn't
used after the program start up anymore. But the problem still exists.

Quote:> Since you're using allegro: did you by any chance embed some allegro
> data into the executable?  That might keep a handle the executable
> file open, too.

No, there is no allegro data embeded into the executable. I use an
allegro data file which is only read at program start up and closed after
that.

Alexander

P.S.: Thanks for your fast answer
P.P.S.: I just noticed, that we are nearly neighbours. I am in Stolberg
right now...