[comp.lang.modula2] Another annoying insect?

Fred.van.der.Windt@f106.n512.z2.fidonet.org (Fred van.der.Windt) (06/22/90)

> Be wary of the Lib.Exec function with TS 2.0
> 
> I've noted some very flaky behavior.  Sometimes it works,
> sometimes it doesn't.  The problem seems to be with the
> Param parameter.  One kludge that usually (but not always)
> works is to add a space to the beginning of the Param
> string.
 
The 'Exec' functions in both V1.17 and V2.00 do not work on all DOS versions and flavours: it does work with my MS-DOS 3.30, not on somebody elses MS-DOS 3.30 (same Microsoft, same version, different dates & sizes).
 
'Exec' will crash because it assumes that *all* available memory is allocated to the current process. 'Exec' frees memory (so DOS can load and execute the program) by some twiddeling with 'Free' and 'Allocate' DOS function 48H and 49H calls.
 
This all fails (and crashes your machine) when some other block of memory was free. Some versions of DOS seem to free a little block of memory below the current program. This crashes 'Exec' calls.
 
                Fred!
 
PS. I wrote my own 'Exec' function to circumvent this problem..... 


--  
uucp: uunet!m2xenix!puddle!2!512!106!Fred.van.der.Windt
Internet: Fred.van.der.Windt@f106.n512.z2.fidonet.org