From jan@swi.psy.uva.nl  Tue Jul 20 21:59:07 1999
Received: from gollem.swi.psy.uva.nl (jan@gollem.swi.psy.uva.nl [145.18.114.15])
	by swi.swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id VAA27756
	for <prolog@swi.psy.uva.nl>; Tue, 20 Jul 1999 21:59:07 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.8.8/8.8.8) id WAA02383;
	Tue, 20 Jul 1999 22:00:53 +0200
Date: Tue, 20 Jul 1999 22:00:53 +0200
Message-Id: <199907202000.WAA02383@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: bug: MSCVRT.DLL?
To: mike_maxwell@sil.org
In-Reply-To: mike_maxwell@sil.org's message of Tue, 20 Jul 1999 15:33:30 -0400
Phone: +31 - 20 - 525 6121
Cc: prolog@gollem.swi.psy.uva.nl

> 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

