08-20-2013 10:48 AM
I'm getting a fatal run-time error when I debug a program in CVI 2013 that worked fine in CVI 2012. I get this message: Dereference of a 4 byte object where only 2 bytes exist. This happens when accessing the last structure in every array. I have a structure that contains two unsigned char items. I then have an array of these structures. The error is generated when the program tries to write to the last structure in the array. If I increase the array by one then works.
08-22-2013 05:54 AM
Hello kplafa,
I'm trying to reproduce the problem with this simple project, but I don't see any run-time errors.
typedef struct { unsigned char x; unsigned char y; } point_t; int main (int argc, char *argv[]) { point_t array[10]; for (int i = 0; i < 10; ++i) { array[i].x = i; array[i].y = i; } return 0; }
I'm probably missing some critical aspect of your project. Do you have a simple example that shows the problem?
Thanks,
Peter
08-22-2013 07:36 AM
If you create a pointer to the array and then use it you will get the error. I ended up creating a support instance on it and they were able to repeat it and looking into a solution. Also, it works fine in release mode, only a problem in debug mode.
02-04-2014 02:35 AM
I've a similar issue with CVI2013 Evaluation mode, not for members of a structure but for parameters of the function.
What would be the solution to make this operating in debug mode?
02-04-2014 02:52 AM
Hello R1M,
You can try installing the patch:
http://digital.ni.com/public.nsf/allkb/B632593DECA1F0C986257BF600766F03
http://www.ni.com/download/labwindowscvi-full-development-system-2013/4447/en/
We have also recently released service pack 1 for CVI 2013 SP1. Your copy of the eval version may be older. You can try downloading the latest one from our website:
https://lumen.ni.com/nicif/us/evalcvi/content.xhtml
Please let us know if this still does not solve the problem. In the meantime, you can also set the debugging level to "No run-time checking" in Options >> Build Options. You'll lose bounds checking on arrays and pointers, but you can still step through your program and look at variables.
Sorry for the inconvenience.
02-04-2014 03:31 AM
Patch has been applied but doesn't modify the application: no changes made.
I try once more to download the last evaluation version and will keep you informed.
In another hand, I've asked sales dpt to update the price offer in order to have an official version, that, I hope, has no longer such FATAL RUNTIME ERRORs.
Regards
02-04-2014 03:36 AM
I think you might have to rebuild your application explicitly after installing the patch, if CVI doesn't do it for you.
There were a handful of bugs in the compiler that resulted in incorrect code.
02-07-2014 04:46 AM
rebuilt, with a new installation (patch f1 was automatically applied but still in version 13.0.647...) and same status.
02-07-2014 04:47 AM
is there a work around to go on migration of our application?
02-07-2014 04:58 AM
You can set the debugging level to "No run-time checking" in Options >> Build Options. You will lose bounds checking on arrays and pointers, but you can still step through your program and look at variables.
It would help us greatly if you could send us a small project that reproduces the problem. You can also send us your full project if it is not against your company's policies, and we'll narrow it down.