Subject: Re: bug: MSCVRT.DLL?

From: Jan Wielemaker <[email-masked]>
Date: Tue, 20 Jul 1999 22:00:53 +0200

> I seem to have a bug in version 3.2.8 of Swi-Prolog, the MS-Windows version.  On
> a Win98 machine, if I launch PLWIN.EXE, type in most anything (e.g. "member(a,
> [a,b])."), then do "halt.", Prolog crashes with the ff. error:
> 
>      PLWIN caused an invalid page fault in module KERNEL32.DLL at 0177:bff7b9e6.
> 
> (further info about the registers etc. omitted here)  The same thing happens if
> I call the goal using the command line parameter -g, etc.
> 
> I _think_ I have tracked down the problem to the file MSVCRT.DLL.  The supplied
> version is dated 1/22/97, version 5.00.7022, and if that is loaded in, Prolog
> exits without problem.  BUT--if another program has already loaded a different
> version of MSVCRT.DLL (e.g. the Win98-supplied version dated 3/18/99, version
> 6.00.8397.0--well, that can't be the version supplied with the original Win98,
> but somewhere along the line that version got installed), Prolog crashes.  I'm
> no expert on how these things work (and I have no idea what this particular DLL
> is supposed to do), but my guess is that if a given DLL has already been loaded,
> Prolog doesn't load its own version, rather it uses the one already in memory. 
> And that newer version is apparently incompatible with Swi-Prolog.
> 
> However, I can only reproduce the problem on a Win98 machine, not on my Win95 PC
> (which has the same 1999 DLL), so maybe I'm barking up the wrong tree.
> 
> I can email a copy of the offending DLL, if that will help tracking things down.

I don't think that will really help.  As far as I know, an application
loads the DLL from the directory the executable is in first, but
appearently I'm wrong, or does this depend on the Windows version!?

I don't think I can do much about it.  Recompile using MSVC 6.0 (do
the MSVCRT versions match the compiler major version?)?  We don't have
6.0, but if you can get hold of it you may try to recompile the sources.

Anyone used to Windows DLL version problems with an idea?

	Regards --- Jan