LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Dereference of object

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.

0 Kudos
Message 1 of 21
(5,598 Views)

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

0 Kudos
Message 2 of 21
(5,574 Views)

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.

0 Kudos
Message 3 of 21
(5,563 Views)

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?

0 Kudos
Message 4 of 21
(5,431 Views)

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.

0 Kudos
Message 5 of 21
(5,422 Views)

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

 

0 Kudos
Message 6 of 21
(5,416 Views)

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.

0 Kudos
Message 7 of 21
(5,414 Views)

rebuilt, with a new installation (patch f1 was automatically applied but still in version 13.0.647...) and same status.

0 Kudos
Message 8 of 21
(5,366 Views)

is there a work around to go on migration of our application?

0 Kudos
Message 9 of 21
(5,365 Views)

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.

0 Kudos
Message 10 of 21
(5,360 Views)