LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Bug reporting guidelines:

See here for the proper LabVIEW bug reporting procedure.


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Automatic type cast in build array causes crash/data corruption
CHorn
post Nov 27 2006, 11:49 PM
Post #1


I've come back for more.


Member
Posts: 2
Joined: 27-November 06
Member No.: 6991
Using LabVIEW Since:2002
LV:8.0.1 ,7.1 ,6.1
Nothing Selected Nothing Selected Nothing Selected


When wiring variables of different types into a "build array" function, i.e. when automatic type casting is used, LabVIEW can crash completely or the resulting array can contain incorrect values.

The details depend on the exact configuration of the input for the build array function.

LV 8.01 and LabVIEW 8.20 (I discovered this using 8.01) seem to be affected on WinXP, Mac OSX (PPC) seems to be not affected.

This is a pretty nasty bug because instead of crashing it can result in incorrect numeric results and is then really hard to allocate because usually one does trust really essential basics of the programming language like automatic type casts.

P.S.: I posted this already in the NI forums but I thought this might be interesting...Attached File  TestBuildArrayCastCrash.vi ( 8.53K ) Number of downloads: 180
Attached File  TestBuildArrayCastIncorrectResult.vi ( 16.27K ) Number of downloads: 165


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Nov 27 2006, 11:49 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Ton
post Nov 28 2006, 06:57 AM
Post #2


CCT It
*****

Premium Member
Posts: 1331
Joined: 13-June 05
From: Woerden, Netherlands
Member No.: 2399
Using LabVIEW Since:2001
LV:8.5.1 ,6.1 ,8.2.1
Netherlands hol_utrecht Nothing Selected My Blog My Gallery


It looks like the constant folding is doing very weird.
If you use execution highlighting, you will see that the for-loop will run just once...
N will be 100 and I will stay 0 nono.gif
But if I change the contant to a complex type (cxt/cdb/csg) it will run 100 times (I=99)
Extended and double will run as well, other file types not...
However if I forced a data change to I32 I saw that I went to 1 and then got this:
Attached Image

oops unsure.gif

EDIT: what is the NI-forums discussion link?

Ton

This post has been edited by tcplomp: Nov 28 2006, 07:09 AM

--------------------
Certified LabVIEW Developer
Shouldn't you be programming a Code Repository solution?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
CHorn
post Nov 28 2006, 08:28 AM
Post #3


I've come back for more.


Member
Posts: 2
Joined: 27-November 06
Member No.: 6991
Using LabVIEW Since:2002
LV:8.0.1 ,7.1 ,6.1
Nothing Selected Nothing Selected Nothing Selected


QUOTE (tcplomp @ Nov 28 2006, 07:57 AM) *
It looks like the constant folding is doing very weird.

My guess is that it's some kind of buffer overflow when allocating memory for the array that uses automatic type casts. This would explain why sometimes weird stuff happens and sometimes it crashes. In this example the loop gets "damaged".

QUOTE
EDIT: what is the NI-forums discussion link?

http://forums.ni.com/ni/board/message?boar...ssage.id=217205

I think this is a very grave bug. Fortunately it is restricted to certain input configurations and to the combination of complex double with integers (all kinds) and singles. I didn't test very thoroughly though.

Christian


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Adam Kemp
post Nov 28 2006, 10:58 PM
Post #4


More Active
**

NI
Posts: 32
Joined: 28-September 06
Member No.: 6320
Using LabVIEW Since:2003
LV:8.20 ,. ,.
United States Nothing Selected Nothing Selected


This was reported to R&D (#43Q7NJPT) for further investigation. Thanks for bringing it to our attention.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
neB
post Nov 29 2006, 01:42 PM
Post #5


Certified Kool-Aid Kid
*****

Premium Member
Posts: 1155
Joined: 6-December 02
From: Pittsburgh PA USA
Member No.: 29
Using LabVIEW Since:1998
LV:7.1 ,. ,.
United States Germany Nothing Selected


QUOTE (Adam Kemp @ Nov 28 2006, 05:58 PM) *
This was reported to R&D (#43Q7NJPT) for further investigation. Thanks for bringing it to our attention.


Adam,

Thank you very much for updating this thread!

Ben


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 22nd November 2008 - 07:36 AM