Page 1 of 1

Borland C++ 4.52 W32 application, crashes in WindowsXP guest

Posted: 27. Jul 2011, 09:56
by wvv
I have a couple of Win32 applications, build with Borland C++ 4.52 (1995), that immediately crash when run on a Windows XP (SP3) guest.
I tried to install Borland C++ 4.52 on this guest also, but that's not possible either due to a crash of the installer.
This application has been working fine on real machines on lots of versions of Windows (95, 98, XP, Win7), until now.
The host is openSUSE 11.3, running virtualbox 4.1.0. (4.0 had the same problem)

Are there known issues with old applications from the Windows 95 age, running them on WinXP hosts?
What can I do about it, to get it working?

Re: Borland C++ 4.52 W32 application, crashes in WindowsXP guest

Posted: 27. Jul 2011, 14:03
by mpack
Is it actually a Win32 application? I still use the Borland "Resource Workshop" tool from BCW 4.5 [*], and it's actually a 16 bit application. You can tell because the app runs as a child of "wowexec.exe", which is the 16bit "Windows on Windows" API.

[*] I still use Resource Workshop because it's still IMHO the best such tool ever! Right after this the various IDE's (Borland included) started integrating cut down versions of these tools into the main environment, and a lot of functionality was lost.

Re: Borland C++ 4.52 W32 application, crashes in WindowsXP guest

Posted: 27. Jul 2011, 14:36
by wvv
Yes, it actually is Win32. At least the first few bytes of the .exe file contain the phrase: "This program must be run under Win32".

Tonight (or maybe later) I will try and make a small 'hello world' program to demonstrate the behavior and for others to test it...

Re: Borland C++ 4.52 W32 application, crashes in WindowsXP guest

Posted: 28. Jul 2011, 06:57
by jorgensen
I have used the Borland program without any problem, but it has been with VirtualBox versions prior to version 4.
Still using version 3.2.12 for the XP host, as I have found some vm's could crash VirtualBox totally (black screen) with version 4+.
With Win 7 as host, version 4+ does not have these problems.

Re: Borland C++ 4.52 W32 application, crashes in WindowsXP guest

Posted: 28. Jul 2011, 08:30
by wvv
wvv wrote:Tonight (or maybe later) I will try and make a small 'hello world' program to demonstrate the behavior and for others to test it...
The "hello world" program created with Borland C++ 4.52, using the same compiler options, functioned perfectly well. So it must be something else that the offending program uses, that makes it crash under Virtualbox. So I have to look further, but this will take a bit longer...

Re: Borland C++ 4.52 W32 application, crashes in WindowsXP guest

Posted: 28. Jul 2011, 08:38
by wvv
jorgensen wrote:I have used the Borland program without any problem, but it has been with VirtualBox versions prior to version 4.
Still using version 3.2.12 for the XP host, as I have found some vm's could crash VirtualBox totally (black screen) with version 4+.
The crashes I see, are elegant crashes, which produce the window where you can 'send' a crash report to microsoft...
jorgensen wrote:With Win 7 as host, version 4+ does not have these problems.
Win 7 is not an option for me, because I also want to use some (even older) Dos programs at the same time. ;)

Re: Borland C++ 4.52 W32 application, crashes in WindowsXP guest

Posted: 29. Jul 2011, 13:46
by wvv
wvv wrote:I tried to install Borland C++ 4.52 on this guest also, but that's not possible either due to a crash of the installer.
This wasn't true. I used an old copy of the installation disk that apparently had gone bad. When I used the original, the installation went just fine...

I'm now working on a "demonstration" program to reproduce the crashing and maybe find out what exactly causes the old application to crash when it's running under virtualbox on WinXP...

Re: Borland C++ 4.52 W32 application, crashes in WindowsXP guest

Posted: 6. Aug 2011, 23:04
by wvv
I found out what the problem was exactly. It has nothing to do with VirtualBox, I should say!

The crashing was caused by different properties settings for the console window the program was running in, under VirtualBox and the regular machine.
In the VirtualBox machine the Screen Buffer Size Height was set to 512, which isn't handled correctly by the Borland C++ conio functions because it uses an unsigned char (8 bits) to store the 16 bits integer returned by the windows api function GetConsoleScreenBufferInfo(). So the windows hight became 0. This value was just used and not checked by the program, and so it crashed... :evil: