LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

Tags
This content has not been tagged yet
2 Pages V   1 2 >  
Reply to this topic Start new topic
> Typedef enum CONSTANT changes during execution, Status: Fixed in 8.0.1
labviewman
post Feb 21 2006, 01:55 AM
Post #1


3 more posts to go!


Member
Posts: 7
Joined: 22-April 05
Member No.: 2108
Using LabVIEW Since:1995
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected


I have a simple .vi that uses a queued state machine using typedef enum constants. A very common technique in a state machine.

What I didn't expect was the typedef enum constant (yes, a constant!) to change during execution. Quite a serious bug.

This was originally LV7.0 code, converted it to LV7.1 but the problem exists. I have not tried LV8.0 (haven't even taken it out of shrink wrap yet).

NI is looking into this, issue #7105073.

Todd
Attached File(s)
Attached File  type_def_enum_constant_changes.zip ( 43.04K ) Number of downloads: 209
 


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Ad
post Feb 21 2006, 01:55 AM
Post #















Tags
This content has not been tagged yet
Go to the top of the page
Quote Post
yonatan.tidhar
post Feb 21 2006, 05:46 AM
Post #2


Active
*

Member
Posts: 23
Joined: 14-August 05
From: Jerusalem Israel
Member No.: 2756
Using LabVIEW Since:2001
LV:8.5 ,. ,.
Israel Nothing Selected Nothing Selected


I can see this too (7.1) and try few things - the only thing that help was to disconnect the constant from the typedef question.gif
so its look like the problem is in the typedef.


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
labviewman
post Feb 21 2006, 07:10 AM
Post #3


3 more posts to go!


Member
Posts: 7
Joined: 22-April 05
Member No.: 2108
Using LabVIEW Since:1995
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected


I tried that before and it didn't work. I even re-created the type-def completely, and it didn't work.

What did work was to replace the 'enqueue element' at the problem location in the code.

Watch how tnhe constant changes during execution...then changes back when the program stops!

It didn't take long to track down this problem since the code from this was taken is quite simple.

QUOTE (labviewman @ Feb 20 2006, 09:55 PM) *
I have a simple .vi that uses a queued state machine using typedef enum constants. A very common technique in a state machine.

What I didn't expect was the typedef enum constant (yes, a constant!) to change during execution. Quite a serious bug.

This was originally LV7.0 code, converted it to LV7.1 but the problem exists. I have not tried LV8.0 (haven't even taken it out of shrink wrap yet).

NI is looking into this, issue #7105073.

Todd


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
crelf
post Feb 22 2006, 01:24 AM
Post #4


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3500
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


Confirmed on LabVIEW 8.0 as well - as suggested, disconnecting it from the typedef fixes it...

--------------------


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
labviewman
post Feb 22 2006, 03:47 AM
Post #5


3 more posts to go!


Member
Posts: 7
Joined: 22-April 05
Member No.: 2108
Using LabVIEW Since:1995
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected


A big question is why is this happening in the first place? Can we ever trust queued state machines again using typedef enums?

NI is looking into it; I will provide and update here when I get an answer.


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Aitor Solar
post Feb 23 2006, 04:54 PM
Post #6


Extremely Active
****

Member
Posts: 259
Joined: 26-January 05
Member No.: 1450
Using LabVIEW Since:2000
LV:8.5 ,8.20 ,7.1.1
Spain spn_Madrid Nothing Selected


I suspect is a casting problem, something usual with enums. In fact, if you explicitly typecast the constant to U16 the problem dissapears... So in some step LabVIEW doesn't know what representation is that control.

Unfortunately I have no more time today, tomorrow I'll check it more deeply.

Saludos,
Aitor


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
neB
post Feb 23 2006, 05:08 PM
Post #7


Certified Kool-Aid Kid
*****

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


QUOTE (Entropy @ Feb 23 2006, 11:54 AM) *
I suspect is a casting problem, something usual with enums. In fact, if you explicitly typecast the constant to U16 the problem dissapears... So in some step LabVIEW doesn't know what representation is that control.

Unfortunately I have no more time today, tomorrow I'll check it more deeply.

Saludos,
Aitor


I took a quick peek at this the other day and it reminds me of a similar "form" of bug that involved a cluster. It looks like the optimization and buffer re-use logic is out of whack. The original buffer holding the constant is being updated instead of copied. Code changes that force execution order can help. Looks like constant folding is out of control.

Just my quick guess,

Ben


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
AnalogKid2Digita...
post Feb 23 2006, 09:46 PM
Post #8


Very Active
***

Member
Posts: 248
Joined: 15-October 04
From: Phoenix, AZ, USA
Member No.: 839
Using LabVIEW Since:2000
LV:8.20 ,. ,.
United States Nothing Selected Nothing Selected


Off topic, but Ben- just one more post to go. thumbup1.gif Sorry, no stars rolleyes.gif

--------------------
‘It’s the questions that drive us'


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Aitor Solar
post Feb 24 2006, 08:32 AM
Post #9


Extremely Active
****

Member
Posts: 259
Joined: 26-January 05
Member No.: 1450
Using LabVIEW Since:2000
LV:8.5 ,8.20 ,7.1.1
Spain spn_Madrid Nothing Selected


QUOTE (Ben @ Feb 23 2006, 06:08 PM) *
The original buffer holding the constant is being updated instead of copied.


Yes, that's true. And I think the problem is located in the queue creation. If you just rewire it or wire another copy of the enum constant, the problem solves. So I suspect that first constant set to "key id" is corrupt and, from that point, LabVIEW loses a valid reference to the object and what the heck it is.

In fact, if we knew how to reproduce this, it would be really interesting to change constants in run time wink.gif

Saludos,
Aitor


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
neB
post Feb 24 2006, 12:02 PM
Post #10


Certified Kool-Aid Kid
*****

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


QUOTE (Entropy @ Feb 24 2006, 03:32 AM) *
Yes, that's true. And I think the problem is located in the queue creation. If you just rewire it or wire another copy of the enum constant, the problem solves. So I suspect that first constant set to "key id" is corrupt and, from that point, LabVIEW loses a valid reference to the object and what the heck it is.

In fact, if we knew how to reproduce this, it would be really interesting to change constants in run time wink.gif

Saludos,
Aitor



Paraphrasing a posting by Rolf years ago....

"Self- modifying code is a very bad idea." nono.gif

OT > AK2DM

I am finding it hard to navigate without the stars. wink.gif

Ben


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Yair
post Feb 24 2006, 12:54 PM
Post #11


Extwemely Active
*****

Premium Member
Posts: 1570
Joined: 23-January 05
From: Here
Member No.: 1431
Using LabVIEW Since:2003
LV:7.0 ,7.1 ,.
Israel Nothing Selected Nothing Selected


QUOTE (Ben @ Feb 24 2006, 02:02 PM) *
Paraphrasing a posting by Rolf years ago....

"Self- modifying code is a very bad idea." nono.gif

OT > AK2DM

I am finding it hard to navigate without the stars. wink.gif

Ben

I know that I said that there are no stars here, but it was slightly changed since then. If you really want to give stars, each thread has a Rating button hiding on top, which rates the entire thread.
Personally, I find the NI forums much easier to use than the LAVA forums (even though LAVA has a significantly larger number of features). This is mostly because the NI forums have a much cleaner design (simple colors, mostly text) and because there it is easier to follow when things get posted (since LAVA is influenced by your logins and not by whether you actually read the posts). As long as LAVA doesn't have too much activity, though, it's not too much to handle. Thanks, Michael and team.

--------------------
More than meets the eye...


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Aitor Solar
post Feb 24 2006, 12:57 PM
Post #12


Extremely Active
****

Member
Posts: 259
Joined: 26-January 05
Member No.: 1450
Using LabVIEW Since:2000
LV:8.5 ,8.20 ,7.1.1
Spain spn_Madrid Nothing Selected


QUOTE (Ben @ Feb 24 2006, 01:02 PM) *
Paraphrasing a posting by Rolf years ago....

"Self- modifying code is a very bad idea." nono.gif


Not necessarily the same VI, but between them. Here the .ctl is in fact working as a external variable, in a very simple manner. Maybe this works between different runtimes too, all accessing the same type definition. Well, OK, probably not rolleyes.gif.

Saludos,
Aitor


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
crelf
post Feb 24 2006, 01:33 PM
Post #13


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3500
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (Entropy @ Feb 24 2006, 06:32 PM) *
In fact, if we knew how to reproduce this, it would be really interesting to change constants in run time wink.gif


...but then it's not a constant tongue.gif

--------------------


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
labviewman
post Mar 3 2006, 12:17 PM
Post #14


3 more posts to go!


Member
Posts: 7
Joined: 22-April 05
Member No.: 2108
Using LabVIEW Since:1995
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected


Here is NI's response:

-------

R&D have identified your issue as a bug and it will be fixed in the next release/patch for LabVIEW. Please let me know if you have any other questions about this issue.

-------


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
neB
post Mar 3 2006, 02:09 PM
Post #15


Certified Kool-Aid Kid
*****

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


QUOTE (labviewman @ Mar 3 2006, 07:17 AM) *
Here is NI's response:

-------

R&D have identified your issue as a bug and it will be fixed in the next release/patch for LabVIEW. Please let me know if you have any other questions about this issue.

-------


I have added this thread to the official NI BUg List that can be found here.

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

For those of you that do not frequent the NI Developer Exchange I want to make sure you are aware that the NI Bug List is now Official as I mention here. (See reply #20).

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

The Official NI Bug list should NOT be viewed as competition for the LAVA Bug List. It should be viewed as a compliment of same.

"Keep them bug and letters coming!"

Ben


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