NTVDM CPU encountered illegal instruction
I ran into a rather strange error that I don't understand. I created a C # console application that was developed simply to test if my web service is running from outside my network. All they did was try to connect to the webservice, output each step to the console and write it to a text file so they can send me logs.
It worked fine on 3 XP computers (one inside my network, 2 outside). Vista machine (had manifest file) but on my XP bosses machine (he's an IT guy so knows what he's doing) it threw a very strange error.
C: \ Temp \ testwe ~ 1.exe CPU NTVDM encountered an illegal instruction
http://www.houseofhawkins.com/roger.jpg ">
I did some sort of internet search and it seemed like his NTVDM might have been hacked, or there was a virus or something. None of this seemed to have happened. I can't figure out what will happen to make it fail this way.
using System; using System.Collections.Generic; using System.Text; using System.IO;
namespace testwebservice {cool program {FileStream theFile = null; Writer StreamWriter = null;
static void Main(string[] args)
{
Program p = new Program();
p.testMe();
}
private void testMe()
{
Console.WriteLine("Entered main method about to create stream");
try
{
theFile = File.Create(@"jonTestWebService.log");
writer = new StreamWriter(theFile);
writer.AutoFlush = true;
try
{
message("Starting test at: " + DateTime.Now.ToLongTimeString());
Random rand = new Random();
message("creating new instance of webservice");
houseofhawkins.testweb webServ = new testwebservice.houseofhawkins.testweb();
message("calling hello world");
String helloResult = webServ.HelloWorld();
message("hello world result = " + helloResult);
int one = rand.Next(999);
int two = rand.Next(999);
message("calling maths method with " + one + " + " + two);
String mathResult = webServ.mytestMethod(one, two);
message("Math result is: " + mathResult);
message("Creating instance of CSJawbreaker");
CSJawbreaker.InformationService csj = new testwebservice.CSJawbreaker.InformationService();
message("trying to get the latest version number");
float version = csj.latestVersionNumber();
message("Version number: " + version.ToString());
message("");
message("Finished all processing at: " + DateTime.Now.ToLongTimeString());
}
catch (Exception ex)
{
writer.WriteLine("");
writer.WriteLine(ex.Message);
writer.WriteLine("");
}
}
catch (Exception ex)
{
Console.WriteLine("could not create stream Writer, " + ex.Message);
}
message("");
message("Press return to exit");
Console.ReadLine();
writer.Close();
theFile.Close();
}
private void message(String message)
{
if (theFile != null && writer != null)
{
Console.WriteLine(message);
writer.WriteLine(message);
}
}
}
}
I am very obsessed as to why this code could / could do this. This is exactly what I want to know, and partly whether this could happen with a real customer car or just infected with my boss car or something.
thank
source to share
Something very wrong if you end up with NTVDM, as this is a 16-bit DOS emulation layer for XP. If this happens again after you convert the EXE, I would examine the software installed on your host computer (.NET framework version, etc.).
I'll also try to run this in WinDbg to see where you end up, get the call stack when it crashes, etc., I'm sure you will find a weird module on the stack (spyware, etc.).
source to share