BUG: Repeatedly Calling Genxtab Can Cause Memory Leak (194886)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q194886

SYMPTOMS

Repeatedly calling Genxtab.prg within a program causes Visual FoxPro 3.0x and 5.0x to lose one memory handle in each iteration of the loop after the first pass. This problem does not occur in Visual FoxPro 6.0.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a program that contains the following code:
          CLEAR
          SET SAFETY OFF
          FOR i = 1 TO 200
             ? "Run Number: " + STR(i), SYS(1016), SYS(1011)
             SELECT to_country,ship_via,order_net FROM orders ;
             ORDER BY to_country, ship_via ;
             GROUP BY to_country, ship_via INTO TABLE bob
             DO (_GENXTAB) WITH ('bob1'), , , , , , ,.T.
          NEXT
          SET SAFETY ON
    						
  2. Run the program and notice the number of memory handles, the last number on each line, increase by one with each iteration after the first pass. Eventually, the system may report a memory error such as:

    Windows 95
    VFP caused an invalid page fault in module KERNEL32.DLL at <memory address>.

    -or-

    Windows NT 4.0
    vfp.exe
    Exception: access violation(0x0000005), Address: <memory address>
    However, to experience the system error message, you may need to increase the number of iterations in the FOR...NEXT loop.

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbbug kbMiscTools kbXBase KB194886