From a-doug@microsoft.com  Tue Jul 11 22:36:07 2000
Received: from mail5.microsoft.com (mail5.microsoft.com [131.107.3.121])
	by swi.psy.uva.nl (8.9.3/8.9.3) with SMTP id WAA03719
	for <prolog@swi.psy.uva.nl>; Tue, 11 Jul 2000 22:36:01 +0200 (MET DST)
Received: from 157.54.9.108 by mail5.microsoft.com (InterScan E-Mail VirusWall NT); Tue, 11 Jul 2000 13:35:16 -0700 (Pacific Daylight Time)
Received: by INET-IMC-05 with Internet Mail Service (5.5.2651.58)
	id <3ND1XDW0>; Tue, 11 Jul 2000 13:25:01 -0700
Message-ID: <E713F2760348D211A9B600805F6FA1AB05676C1A@RED-MSG-09.itg-messaging.redmond.corp.microsoft.com>
From: "Douglas Miles (Volt Computer)" <a-doug@microsoft.com>
To: Martin Young <Martin.Young@st.com>, prolog@swi.psy.uva.nl
Cc: Martin.Young@st.com
Subject: RE: Debugging on WinNT.
Date: Tue, 11 Jul 2000 13:25:08 -0700
X-Mailer: Internet Mail Service (5.5.2651.58)

If you suspect your app is getting held up in foreign code .. you may want
to try to
run you plwin or plcon under windbg.exe or ntsd.exe (or even under visual
c++ debugger)
these are debugging utilities usual found on NT systems or in the Windows
Resource kit.
This allows you to examine the stack and see what modules your processor was
busy with.

I have noticed when working with for example the socket libraries for SWI
(this may be the case in other parts like steams). When i getch on NT, i was
getching something different then on Linux.. So i had a program running
reliably on one platform becasue i had was testing for integers and not
charcodes.  My routine was always failing on NT as it was looping very
tightly and spending most of time inside getch code..  (less time to look
for me pressing control C evidently). You may need to double check to see if
your stream always returns is the same kinds of data on both platforms. 

-D

-----Original Message-----
From: Jan Wielemaker [mailto:jan@swi.psy.uva.nl]
Sent: Tuesday, July 11, 2000 11:53 AM
To: Martin Young; prolog@swi.psy.uva.nl
Cc: Martin.Young@st.com
Subject: Re: Debugging on WinNT.


> I've written a Prolog program which runs correctly on Solaris and also on
> Windows NT for small data sets, but on Windows NT with a large amount of
data
> it appears to hang.  It's generally doing stuff related to writing text to
a
> stream but I'm not sure as I can't see how to break in to see what it's up
to.
>  So, questions:
> 
>   - Are there any known problems or predicates I should be avoiding (I'm
not
>     using signals, btw)?

Except from indeed signal handling, the Windows version should be fully
equivalent.  If you are using lots of memory (i.e. more than physically
available, the performance of NT drops down a lot faster than Solaris.

>   - How do I break in and see the current goals, as in ctrl/c under
Solaris?
>     ctrl/c in plwin does nothing, whilst plcon says "FATAL
ERROR...received
>     signal 2 (int) while in 20-th garbage collection".

This looks like a bug.  Signal handling is disabled while in garbage
collections, but appearently this doesn't work in Windows.  I don't know
what version we are talking about, but plwin-not-too-old should answer
Control-C.  It does so by the console thread setting a flag, which is
checked every few thousands passed through the call-port.  Normally this
should not take too long, unless it is doing a lot of work in foreign (C)
code.

>   - Is there some other way I can get some visibility on what's happening?

Good old format?  Switch on verbose garbage collection?  trace/1?

	Regards --- Jan


----------------
* To UNSUBSCRIBE, please use the HTML form at

    http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist

or send mail to prolog-request@swi.psy.uva.nl using the Subject:
"unsubscribe"
(without the quotes) and *no* message body.

** An ARCHIVE of this list is maintained at

    http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/

