| 
| 
BUG: Repeatedly Calling Genxtab Can Cause Memory Leak
ID: Q194886
 
 |  The information in this article applies to:
 
 
Microsoft Visual FoxPro for Windows, versions  3.0b, 5.0, 5.0a, 6.0
 
 
 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 INFORMATIONSteps to Reproduce BehaviorCreate 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 
 
 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 
However, to experience the system error message, you may need to
   increase the number of iterations in the FOR...NEXT loop.
      vfp.exeException: access violation(0x0000005), Address: <memory address>
 
 Additional query words: 
 
Keywords          : kbMiscTools kbVFp600 kbXBase Version           : WINDOWS:3.0b,5.0,5.0a,6.0
 Platform          : WINDOWS
 Issue type        : kbbug
 |