LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cvi 2013 and sql

Solved!
Go to solution

Hello All

 

I have upgrade today from CVI2012 SP1 to CVI2013 SP1

I have complied & run a project that works fine on the previous version.

I am sad to report that CVI 2013 crashes immediately in release mode (on debug mode it runs)

 

The project is huge project about 70k lines with extensive SQL calls to *.mdb files using sql toolkit

I have determined that the crash occurs in simple FetchNext call

 

The PC is XP SP3

CVI 2013 SP1

SQL toolkit 2.2

 

Pls help (i do not want to roll back unless i have to)

Thanks for advance

gabel Daniel

0 Kudos
Message 1 of 11
(5,150 Views)

Hello aplication_dev…,

 

Do you think you can send us the project using ftp.ni.com, so we can take a closer look?

 

Best regards,

= Nelu F. || National Instruments.

 

 

0 Kudos
Message 2 of 11
(5,132 Views)

Hi 

 

I have created small project that reproduces the bug

 

In debug everything runs OK

In release mode it crushes

pay attn to the msg box's , this way i could find the exact line in release (primitive but works...)

 

Gabel Daniel

0 Kudos
Message 3 of 11
(5,129 Views)

Hi aplication_dev…

 

Thank you for the project. We will investigate and get back to you soon.

 

Best regards,

= Nelu F. || National Instruments.

0 Kudos
Message 4 of 11
(5,124 Views)

Hello aplication_dev…,

 

I have opened bug report #461207 to address this issue. Unfortunately, at this time there appears to be no other work-around, than to use the debug builds. This issue should be addressed soon.

 

Best regards,

= Nelu F. || National Instruments.

0 Kudos
Message 5 of 11
(5,074 Views)

Thanks for the reply

 

Can you pls estimate when & how the bug will be fixed

My purpose for the question is do i roll back to 2012 or wait for the fix

 

Thanks

Gabel Daniel

0 Kudos
Message 6 of 11
(5,066 Views)

Hello aplication_dev…,

 

At this moment it looks like we might fix it in the next version of LabWindows/CVI. As for the how, I cannot speculate. I can get back to you when I have more information.

 

Best regards,

= Nelu F. || National Instruments.

0 Kudos
Message 7 of 11
(5,062 Views)

Hello aplication_dev…,

 

I think I might have another workaround for you. I discovered that replacing the function calls to "Bind_Money"  with the function's code eliminates the crash in the project you've attached, for the Release configuration. Does this work for you?

 

Best regards,

= Nelu F. || National Instruments.

0 Kudos
Message 8 of 11
(4,977 Views)

hello Nelu 

 

Unfortunately i have already roll back to 2012, i will wait for SP2 hopefully NI will fix the bug

 

Thanks for the reply

Gabel Daniel

 

0 Kudos
Message 9 of 11
(4,970 Views)
Solution
Accepted by topic author aplication_developper

Hello aplication_dev…,

 

We have completed the investigation. It looks like the crash was caused by a user error in function Bind_Money. In that function a local variable is being bound to the library. After the function executes, the variable stops existing, but its address is saved by the library.

When calling DBFetchNext, the library tries to write the status of the request at the specified address. But the variable stat does not exist anymore. And, because it was a local variable, it was allocated on the stack. Thus, the library tries to modify a value on the stack that exists no more and this leads to the corruption of the stack and the crash. 

The fact it doesn't crash in debug mode and with older versions appears to be coincidental. 

 

The help for the binding functions states that the status parameter is a "pointer to the variable that receives the status value of the specified column when you fetch a record." It might not be that obvious that it has the same importance like the address that is being bound to the column, so we are going to modify the documentation to provide this information. Also, please note that you can't pass a NULL value to the binding function. I would suggest adding the status variable to the CURRENCY structure and use it to determine if the information returned was NULL or if it was truncated.

 

Please let us know if you encounter any other issues.

 

Best regards,

= Nelu F. || National Instruments.

Message 10 of 11
(4,955 Views)