LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

memcpy causes a "general protection fault"

Solved!
Go to solution

using CVI 9.0.1, the sample code attached causes a general protection fault on the second memcpy of the main function on my computer, when compiled in debug mode. when compiled in release mode, no problem... i don't know if it crashes on other computers. this code compiled and ran fine with gcc, visual studio and digital mars.

 

0 Kudos
Message 1 of 5
(4,133 Views)
Solution
Accepted by topic author dummy_decoy

Do you still get the error if you remove the const qualifier from the sDanfossFactoryParams array?

 

JR

Message 2 of 5
(4,132 Views)

thanks jr, removing the const qualifier did the trick.

now i am left wondering why a const qualifier crashes the software while memcpy does define its second parameter as const.

0 Kudos
Message 3 of 5
(4,121 Views)

My guess would be that there is some issue with the CVI debug framework around the memcpy() call. Maybe they have mixed up the source and destination parameter checking? Perhaps someone from NI could tell.

 

JR

0 Kudos
Message 4 of 5
(4,118 Views)

This does seem like a bug in CVI's user protection code. I've created an internal bug report with ID 177188. I'll post an update here as soon as I find out some more details.

 

Thanks for reporting this.

 

Luis

0 Kudos
Message 5 of 5
(4,096 Views)