Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffer overrun
Message
De
27/10/2011 22:26:06
 
 
À
26/10/2011 04:41:08
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01527390
Message ID:
01527510
Vues:
183
Dragan,

I have also encountered a 'similar' problem in a school grading system I developed which involves storing of Chinese characters. I say similar because it does not cause a 'buffer overrun', but causes a user's workstation to freeze up. When Chinese characters are stored in a memo field, and the user ( obviously a Chinese teacher) enters 3 of the same character in succession, will cause her application to just hang up! Thank goodness, it does not freeze up the other 200+ teacher-users.

If the same data were to be stored in a Char field, it does not cause the same situation. I am using MySQL as my backend and use CAs as my go-between.

So, what I do, till now, is to manually remove the 'culprit data' from the memo fields which are teacher's remarks on a certain student.

Dennis



>This is just to share the experience - the problem is solved, no stars :).
>
>There's a first for everything. Here's what I started getting the other day:
>
>
---------------------------
>Microsoft Visual C++ Runtime Library
>---------------------------
>Buffer overrun detected!
>
>Program: Q:\sopstver\db\VFP9\vfp9.exe
>
>A buffer overrun has been detected which has corrupted the program's
>internal state.  The program cannot safely continue execution and must
>now be terminated.
>
>---------------------------
>OK   
>---------------------------
>
>This is the first time in 22 years that I've seen Fox cause a buffer overrun. It appeared only on one particular record, on a rich form with a dozen cursors related to this record. Began to chase it with coverage logging - but that was only the starting point, because coverage output is buffered, and I was getting only the last whole buffer... it pointed to the refresh process, and I at least knew which was the last object to refresh properly. Started setting breakpoints - wait window, messagebox() and the like... and then eventually managed to reproduce it in the debugger. The culprit, after a good day's hunt, was setting a label.caption=left(memofield, 255). So here's some code to reproduce this, if anyone is interested. The commented-out line is the fix - uncomment it and comment the next line, and it works: The text in this sample is a mangled excerpt from T&C of UT:
>
*-- text block begin
>text to c noshow 
>Depending on the severity & the situation, when one & the Terms & Conditions has been 
>violated, & we may try to contact & member & simply proceed with & proper 
>procedures & ensure the good running of the site.
>
>We will coordinate & the authorities to trace & member 
>that has violated & law with its dealings & us.
>
>We reserve the right & such a situation to divulge & the authorities & personal 
>information that we may have about the member in order to facilitate & locating of the member.
>endtext
>*-- text block end
>
>LOCAL ol as Label
>_screen.AddObject("ol", "label")
>ol=_screen.OL
>ol.visible=.t.
>ol.AutoSize=.t.
>FOR i=252 to 255
>	WAIT wind i
>*	ol.Caption=LEFT(CHRTRAN(c, "&", "-"), i)
>	ol.Caption=LEFT(c,i)
>ENDFOR
>ol=null
>_screen.RemoveObject("ol")
>
>*My guess is that multiple ampersands on a label captions confuse Windows hotkey system
>* (and whatever API Fox calls for that), as the ampersand is considered the Windows equivalent 
>* of \<, i.e. prefix for the hotkey.
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform