LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Code "1097.....this might corrupted LABVIEW's memory.........." appears after exit the labview and re-start labview

        I have a probelm when I use the "tool/import shared library(.dll)" wizard to generate the API from C.
        The API  works correctly when I complete the wizard, but after I exit labview and re-start labview to run the API again. The error 1097 code "......this might corrupted LABVIEW's memory.............."appears.
 
        The only solution now is to re-generate or update the wizard to generate the API.
 
        I try to find the answer in
 
        The paragraph in above article shows
...........................
         "LabVIEW does not crash until it is closed
The most likely problem is that the DLL function being called has corrupted the memory. If you pass arrays or strings to the DLL, the DLL function cannot dynamically resize the array. Writing beyond the last element of the array or string could corrupt the memory and this may not be obvious until LabVIEW is closed."
............................
 
But it doesn't match my case. Does someone have idea about this? I Attach my .h file for reference
 
 
 
 
Download All
0 Kudos
Message 1 of 2
(3,755 Views)


@wewe1215 wrote:
        I have a probelm when I use the "tool/import shared library(.dll)" wizard to generate the API from C.
        The API  works correctly when I complete the wizard, but after I exit labview and re-start labview to run the API again. The error 1097 code "......this might corrupted LABVIEW's memory.............."appears.
 
        The only solution now is to re-generate or update the wizard to generate the API.
 
        I try to find the answer in
 
        The paragraph in above article shows
...........................
         "LabVIEW does not crash until it is closed
The most likely problem is that the DLL function being called has corrupted the memory. If you pass arrays or strings to the DLL, the DLL function cannot dynamically resize the array. Writing beyond the last element of the array or string could corrupt the memory and this may not be obvious until LabVIEW is closed."
............................
 
But it doesn't match my case. Does someone have idea about this? I Attach my .h file for reference
 


Which of the 2 functions do you call? How?

The documentation of InitSocketEx() seems to indicate reversed parameter order than what the function prototype looks like!

I indeed do not see much possibilities to pass in to small a buffer that the DLL function might be overwriting past the end. This really only leaves one more possibility:

Your DLL is doing something largely illegal somehow. Maybe something as silly as storing the reference to the ipAdress instead of the address itself. The memory passed as parameters into a C function is generally only valid for the duration of the call. This is especially true if you use LabVIEW since LabVIEW will re- and deallocate memory buffers frequently as soon as they are not used anymore and the parameter to a Call Library node is considered to not be required anymore after the function returns.

Rolf Kalbermatter


Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 2
(3,737 Views)