LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

windows error in release version, not even a warning when in debug

Using Labwindows/CVI 6.0 and SQL Toolkit 2.0 on WIN2000, I get this infamous Windows error message when running the release version of my program:
 
{ The instruction at "0x0000001e" referenced memory at "0x0000001e". The memory could not be read. }
 
Using printf's I could determine that this message happens when a DB_FetchNext command is performed on a dbf-file. Strangely it is not the first FetchNext in this program.
 
The problem does not appear in the debug executable. That runs without generating a warning. I even used QAC (source code analyzer) to dig through the code but I can't find the bug.
 
Any suggestion is very welcome.

Message Edited by Han on 12-07-2005 07:29 AM

Message Edited by Han on 12-07-2005 07:32 AM

0 Kudos
Message 1 of 3
(3,245 Views)
My first guess would be that you are using uninitialized variables somewhere in your code.  In debug mode, LabWindows initializes all memory to 0.  In release mode, memory is in an unknown state.  This means that in debug mode, uninitialized strings will have a terminating null, integers will be 0 when declared, etc and can be used safely.  In release mode, your uninitialized strings will be random garbage and may not be terminated, integers will be semi-random numbers, etc.  This is not a safe state.  Sometimes Windows will catch you using an uninitialized variable and terminate the program. 
----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
0 Kudos
Message 2 of 3
(3,176 Views)
I also think it might come from an unitialised variable. That's why I used QAC in the hope that it tell me what variable is not initialised properly. I'll just have to look further...Smiley Sad
0 Kudos
Message 3 of 3
(3,141 Views)