locked
Older Foxpro Dos freezing on XP. RRS feed

  • Question

  • Hi everyone; I hope you don't mind the pre historic question:

     

    I have an older app written in FPD2.6.

    On some new machines, the app will freeze up roughly a few times a day. It always happen when the user clicks a 'popup'.

     

    Any one experienced this? Any ideas where to start?

     

    I am in the process of updating my app to VFP but it will take some time and I would want the old app to be as problem free as possible.

     

    Thanks again,

     

    AK.

    Thursday, May 24, 2007 9:04 PM

Answers

  • We recently had a similar problem, an older FPD 2.6 app froze up multiple times a day on the client's new computers. Their new computer were the first machines they had acquired with Windows XP, but it turns out that was a red herring. The new machines were also dual-core CPU's, and we solved the problem by modifying the NT virtual DOS machine to use only one processor. I don't know if that applies in your situation, but if it does and you want details on the solution please post back here and ask.
    Friday, May 25, 2007 4:19 AM
  • To make sure this solution works before making a permanent change, you can set the processor affinity at runtime by locating the Windows virtual DOS machine ntvdm.exe in Task Manager while the DOS app is running, Right-click and choose Set Affinity, then un-mark either CPU 0 or CPU 1. This will persist until you terminate the app. If the app runs without freezing after you do this then this is probably the solution you need and you can proceed to make the permanent change as outlined below.

     

    To set the processor affinity permanently you need to use a utility called imagecfg to modify the Windows virtual DOS machine ntvdm.exe which is located in the %system% folder (e.g. system32). When I was researching this problem I found several references to imagecfg on the Web, but to give credit where credit is due the one that was most helpful to me was Mark Wilson's blog entry at http://www.markwilson.co.uk/blog/2005/01/troubleshooting-ms-dos-application.htm.

     

    First you have to download a utility called imagecfg.exe. It's evidently a Microsoft utility, but I could not find it for download on the MS site. However I did find it at http://www.robpol86.com/Pages/imagecfg.php. This appears to be the legitimate tool and it worked for me, but as with any download, use at your own risk. A search will turn up other download sources for this utility, too.

     

    What we did was to run imagecfg.exe with the -u parameter to change ntvdm.exe to uni-processor mode, as in imagecfg.exe -u ntvdm.exe. Note that this modifies the executable file ntvdm.exe, and as Mark points out in his blog post, Windows File Protection will complain about this and will attempt to restore the original file from the dll cache, so you have to change it there also. Being cautious, I started out by making a copy of ntvdm.exe in a temporary folder, running imagecfg on that, then copying it to the dll cache and the system folder.

     

    We did not find it necessary to run imagecfg with the -a option to set affinity to a particular processor. In our case running it with -u to set uni-processor mode was sufficient. In other words, it did not matter which of the two processors ntvdm.exe uses as long as it uses only one.

     

    Hope this was clear enough. I would be interested in knowing if this solves your problem.

     

    -Rick

     

     

    Friday, May 25, 2007 3:36 PM

All replies

  • We recently had a similar problem, an older FPD 2.6 app froze up multiple times a day on the client's new computers. Their new computer were the first machines they had acquired with Windows XP, but it turns out that was a red herring. The new machines were also dual-core CPU's, and we solved the problem by modifying the NT virtual DOS machine to use only one processor. I don't know if that applies in your situation, but if it does and you want details on the solution please post back here and ask.
    Friday, May 25, 2007 4:19 AM
  • Thank you so much. I think this is exactly my problem because it happens on Dual Cores.

     

    Can you post some details regarding how I make XP use only one processor?

     

    AK.

    Friday, May 25, 2007 2:41 PM
  • To make sure this solution works before making a permanent change, you can set the processor affinity at runtime by locating the Windows virtual DOS machine ntvdm.exe in Task Manager while the DOS app is running, Right-click and choose Set Affinity, then un-mark either CPU 0 or CPU 1. This will persist until you terminate the app. If the app runs without freezing after you do this then this is probably the solution you need and you can proceed to make the permanent change as outlined below.

     

    To set the processor affinity permanently you need to use a utility called imagecfg to modify the Windows virtual DOS machine ntvdm.exe which is located in the %system% folder (e.g. system32). When I was researching this problem I found several references to imagecfg on the Web, but to give credit where credit is due the one that was most helpful to me was Mark Wilson's blog entry at http://www.markwilson.co.uk/blog/2005/01/troubleshooting-ms-dos-application.htm.

     

    First you have to download a utility called imagecfg.exe. It's evidently a Microsoft utility, but I could not find it for download on the MS site. However I did find it at http://www.robpol86.com/Pages/imagecfg.php. This appears to be the legitimate tool and it worked for me, but as with any download, use at your own risk. A search will turn up other download sources for this utility, too.

     

    What we did was to run imagecfg.exe with the -u parameter to change ntvdm.exe to uni-processor mode, as in imagecfg.exe -u ntvdm.exe. Note that this modifies the executable file ntvdm.exe, and as Mark points out in his blog post, Windows File Protection will complain about this and will attempt to restore the original file from the dll cache, so you have to change it there also. Being cautious, I started out by making a copy of ntvdm.exe in a temporary folder, running imagecfg on that, then copying it to the dll cache and the system folder.

     

    We did not find it necessary to run imagecfg with the -a option to set affinity to a particular processor. In our case running it with -u to set uni-processor mode was sufficient. In other words, it did not matter which of the two processors ntvdm.exe uses as long as it uses only one.

     

    Hope this was clear enough. I would be interested in knowing if this solves your problem.

     

    -Rick

     

     

    Friday, May 25, 2007 3:36 PM
  • It is a "exe" file  or "app" file ? What "exe" file name are you using ?
    Friday, May 25, 2007 5:48 PM
  • The solution I posted involves using imagecfg.exe (the utility program) to modify ntvdm.exe (the Windows virtual DOS machine). You do not have to change anything in your FoxPro for DOS app or exe.
    Friday, May 25, 2007 7:57 PM
  • Thanks for the detailed solution. I will be testing this today, and will let you know.

    Thanks again!!!

    AK.
    Tuesday, May 29, 2007 3:20 PM
  • Indeed a solution!

    A million thanks. Now I can postpone upgrading my users to VFP for another 5 years... Joking of course.

    AK.
    Friday, June 1, 2007 11:02 PM
  • Indeed a solution!

    A million thanks. Now I can postpone upgrading my users to VFP for another 5 years... Joking of course.

    AK.

     

    You're welcome, and thanks for confirming that this solution worked for you. Good luck to you going forward and keeping that app running for however long your customer wants it!

     

    -Rick

     


    Saturday, June 2, 2007 3:53 AM
  • Sorry for reviving this post but I have a problem with a Dual Core with XP SP2 running foxpro 2.6 (dos). For the first time I tried the imagecfg.exe solution, and "It works during 1 week!!!", I was really happy, but 3 days ago it begin to freeze again. I will explain the sintoms. During some times the app run normally, but in a seconds when the app open some tables y freeze during this process, during de USE table.dbf process. What I have notice is, if I unplug de RJ45 for a few seconds and then I plug it again the app being to works normally for a time.... then again the problem.
    I have change the switch, the cable, and the network card. The problem is with this machine and this machine is the server, so it freeze the other pcs when this problem happends.

    Thanks for reading....any ideas????

    Regards

    Jesús from Argentina
    Saturday, December 6, 2008 10:19 AM
  • Hi,

     

    You can try this probably it will solve your problem.

     

    In task Manager look for

     

    sprtcmd.exe

     

    if it is there remove it and then use your application should work properly.

     

    Hope you get what you want

     

    Sunday, December 7, 2008 6:01 AM
  •  

    Thanks, but sprtcmd.exe doesn´t appear in the task manager. Last week I decided to reinstall XP again. All seems to work fine during 5 days, then again the problem, but now what I can say is: That the LAN freeze, what I mean. The dual core machine can go to internet and connect to all share resources of the other PCs, but the other PCs can go to internet, can ping the Dual Core machine, but but !!!! cannot connect to the resources, I cant make  NET USE X: \\SERVIDOR\C. I have to reboot the Dual Core machine and again everything normal for a time...

    Thank for everybody... I´m really desperate !!!!

     

    Jesús

    Saturday, December 20, 2008 3:13 PM
  • We have been having the same issue, and reverted back to the original NTVDM.exe Dated 2004 from the installation CD and we have been running perfectly! I would recommend trying this.

    Friday, July 24, 2009 5:17 PM
  • First sorry for my bad English;

    Second I have the same problem now and haven't figure out a solution yet ?????/.At work we use fox 2.0 LAN app and a month ago we bougt new machines (5300 dual core,2GB 800 Mz ram,MSI motherboard).3-4 times a day the app freezes so I have to restart the server and other machines conected to it , to continue work normaly.It start with the error "Delayed Write Failed" (some *tmp file take too long time to be written on the disk and the data was lost (app freezes)).I've reinstall Windows XP service pack 2 on all machines and this error cease to exist but now I have this freeze problem, and is getting worst , the program started to allow duplicate records to be written in  some  tables , something like when  the CDX file is damaged , so now I don't trust the computed results anymore and I am really scarred altough I've reindexed the tables and tryed to restore the table indexes  but  the problem with duplicate records still exsist and is getting worse , 7 days ago the CDX file in one table was complitly destroyed so I had to rebuild the CDX file again . I haven't try this imagecfg.exe method , but I'll try it for sure .

    So did anyone have the same or similar problem like mine , it will be really helpfull to  post me a solution please because I am desperate.

    Thanks

    Mende from Macedonia
    Saturday, February 13, 2010 7:26 PM
  • Hi "Atomski_pp"
     
    First: Always try to use the latest vorsion of Windows as well as FoxPro:
     
    >> I've reinstall Windows XP service pack 2
    Servicepack 3 is available since July 2009.
     
    >> fox 2.0 LAN
    Duuh. Why was that never recompiled to 2.6 ?  The 2.0 uses a very outdated memorymanager, which is incompatible with Windows and therefor your app can only run with max 512 kb of DOS-RAM.  If you have the source available: Do yourself a favour and upgrade to 2.6!  It's basically just a recompile.
     
    Besides of that, you need to look at the settings of config.nt and autoecec.nt to configure the DOS-emulator do work correctly.
    See http://fox.wikis.com/wc.dll?Wiki~FoxProAndWinXp for more information on that.
     
     
    Another source of trouble with new machines is the default enabled "Opportunistic Locking", which is known to corrupt data on any fileserver-based database (not only FoxPro, but also Accesss etc). Thus I strongly recommend to disable that setting on clients-pcs as well as on the server machines.
     
     
     

    wOOdy
    Microsoft Visual FoxPro Technology Advisor
    Microsoft "Most Valuable Professional" from 1996 to 2009
    Visit my XING profile! Don't know what XING is?

    *´¨)
    ¸.·´¸.·*´¨) ¸.·*¨)
    (¸.·´. (¸.·` *
    .·`.Visual FoxPro: It's magic !
    (¸.·``··*


     

    Sunday, February 14, 2010 10:31 AM