Jump to content

LabVIEW crashes with pre-allocated array


Mellroth

Recommended Posts

I reported this bug december 2005, and just recently checked if it was still present in LabVIEW 8.2 (sorry I don't have a CAR for this one).

/J

-------

The Problem.vi contains a pre-allocated array, that is populated by using a second array that is auto indexed in a FOR loop.

The crash:

  1. LabVIEW crashes when closing the Problem.VI after it has been run.
  2. LabVIEW also crashes sometimes, if you edit and try to save a VI (Caller vi), that has the Problem.VI in its sub-vi hierarchy (Caller VI must be run first in order to crash))

post-5958-1169203489.png?width=400

Solution:

Change the dimension size input (Initialize array) from constant to control (this changes the type of the array wires)

  • the pre-allocated array changes from "1-D fixed size array [100] of" to "1D array of".
  • the output from the Array subset node changes from "1-D bounded-size (sub) array [100] of" to "1-D (sub)array of"

In LabVIEW 7.1.1, I have the FPGA toolkit installed, maybe this is forcing LabVIEW to use a special version of the "Initialize array" node?

Download File:post-5958-1169203496.zip

Link to comment
I reported this bug december 2005, and just recently checked if it was still present in LabVIEW 8.2 (sorry I don't have a CAR for this one).

/J

-------

The Problem.vi contains a pre-allocated array, that is populated by using a second array that is auto indexed in a FOR loop.

The crash:

  1. LabVIEW crashes when closing the Problem.VI after it has been run.
  2. LabVIEW also crashes sometimes, if you edit and try to save a VI (Caller vi), that has the Problem.VI in its sub-vi hierarchy (Caller VI must be run first in order to crash))

post-5958-1169203489.png?width=400

Solution:

Change the dimension size input (Initialize array) from constant to control (this changes the type of the array wires)

  • the pre-allocated array changes from "1-D fixed size array [100] of" to "1D array of".
  • the output from the Array subset node changes from "1-D bounded-size (sub) array [100] of" to "1-D (sub)array of"

In LabVIEW 7.1.1, I have the FPGA toolkit installed, maybe this is forcing LabVIEW to use a special version of the "Initialize array" node?

Download File:post-5958-1169203496.zip

The idea about FPGA might be interesting here. Earlier versions of LabVIEW did not support (or should I say use) fixed sized arrays although the typedescriptor explicitedly had this feature documented as long as the document about Typedescriptors exists. FPGA was to my knowledge the first environment really needing fixed size arrays so they pushed that.

The particular problem you see also seems a bit like pains of the early attempts to get the constant folding optimization into LabVIEW. Not sure if the FPGA Toolkit adds this feature to the LabVIEW environment but I rather think that it is there independant of the existence of the FPGA Toolkit (but can't currently check as I have the FPGA Toolkit also installed).

Rolf Kalbermatter

Link to comment

I reported this bug december 2005, and just recently checked if it was still present in LabVIEW 8.2 (sorry I don't have a CAR for this one).

Added the bug to the LV7.1.1 bug list as well:

http://forums.lavag.org/LabVIEW-crashes-wi...-711-t5888.html

The same crash appears in LV8.2 if the LV7.1.1 VI is opened, but not if the code is created from scratch.

post-5958-1169204324.png?width=400

Somehow LabVIEW is using a special version of the "initialize array" node in LabVIEW 7.1.1, and when opened in LV8.2 this version is still being used (generating "fixed size array").

Developing new code in LabVIEW 8.2 is not a problem, its only when you open up old 7.1.1 code you might run into this crash.

What really annoys me is that the two VIs, Problem.vi and Problem-solved.vi is more or less identical, its only when you check the type of wire you can spot the difference.

Download File:post-5958-1169204334.zip

/J

-------

The Problem.vi contains a pre-allocated array, that is populated by using a second array that is auto indexed in a FOR loop.

The crash:

  1. LabVIEW crashes when closing the Problem.VI after it has been run.
  2. LabVIEW also crashes sometimes, if you edit and try to save a VI (Caller vi), that has the Problem.VI in its sub-vi hierarchy (Caller VI must be run first in order to crash))

post-5958-1169203489.png?width=400

Solution:

Change the dimension size input (Initialize array) from constant to control (this changes the type of the array wires)

  • the pre-allocated array changes from "1-D fixed size array [100] of" to "1D array of".
  • the output from the Array subset node changes from "1-D bounded-size (sub) array [100] of" to "1-D (sub)array of"

In LabVIEW 7.1.1, I have the FPGA toolkit installed, maybe this is forcing LabVIEW to use a special version of the "Initialize array" node?

Download File:post-5958-1169203496.zip

Link to comment

CAR# 3SL9US00.

Update: LabVIEW 8.2 will also crash if you create the Problem.vi for a FPGA target, and then open the VI in "Main Application Instance".

The reason seems to be that the VI remembers what target it originally was created for, and therefore uses a special version of the "Initialize array" node, that outputs "fixed size array".

/J

Link to comment

I've seen something related (most probably already reported too). It seems an array control or constant can remember that it was wired to a fixed size array. Then when you paste it somewhere else, the array wire does not allow to be changed size anymore. I was unable to remove the problem changing control/wire properties or by setting FPGA options off and restarting LV.

Workaround: create the wire/control again from scratch.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.