www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/08/11:51:19

To: davis AT amy DOT tch DOT harvard DOT edu ("John E. Davis")
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Example of the coff2exe bug
Date: Wed, 08 Feb 95 17:30:18 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

>    5. Now do:
>    
>          a.exe coff2exe -s C:/djgpp/bin/go32.exe a.out
>	  
>       Did your system crash?  Do you get a hard drive seek error?  What is
>       in test.out?

This crashes with Segmantation Violation and ``Sector not found''
error ONLY if coff2exe is invoked ON THE SAME PROGRAM which
spawns coff2exe in the first place.  At least on my machine, it
NEVER crashes for any other filename EXCEPT a.out.  I think DJ
should be able to explain this in full, but my guess is that
go32 keeps the file of a running program open at all times,
because (at least in VCPI mode) it only reads into memory those
parts of program which it really needs, when it needs.  When you
call coff2exe as above, it overwrites that file, which will
totally confuse go32 when it tries to page in some part of that
file.  If I'm right, then it has nothing to do with coff2exe per
se, but rather with the way go32 works in VCPI mode.

This is an example of the old rule I've memorized when I first
started writing programs: never do anything rude to an executable
file while it runs.  Now, that was on an old machine and weird
OS, but I guess old lessons are still good nowadays, even if we
got used to pull out the diskette from the drive once a program
has been loaded into memory...

- Raw text -


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