LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unflatten From String function hangs indefinitely

I have an application that uses some TCP/UDP network communication, so I need to flatten my data payloads to string before sending. Now I'm catching situations where the Unflatten operation on the receiver end is hanging up. There doesn't appear to be any way to fix the problem, short of aborting the application. It typically seems to function find for a little while, then it gets a payload it doesn't like and it just locks up the program:

 

unflatten_hang.png

 

I'm admittedly doing some fancy payload marshalling/demarshalling that could conceivably be screwing up the message upstream of this operation--my next step in troubleshooting will be to try to debug that functionality--but it certainly isn't comforting that a bogus payload will cause an infinite hang. I would expect it to just throw error 74 and keep executing....

 

Are there any known issues with "Unflatten From String"? Any open CARs? Or has anyone else run into this problem and come up with any workarounds?

0 Kudos
Message 1 of 10
(4,399 Views)

Hev not seen this problem. What is the datatype that you ae trying to unflatten into? Anything noticable about the string that is being unflattened?

 

Mike...

 

PS: have you stopped and restarted LV since this started happening? 


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 10
(4,390 Views)

I *have to* stop and restart LabVIEW every time I run into this problem.

 

The datatype is a cluster of string and variant, because it's being used for a general purpose data repeating application.

0 Kudos
Message 3 of 10
(4,379 Views)

@TurboPhil wrote:

I *have to* stop and restart LabVIEW every time I run into this problem.

 

The datatype is a cluster of string and variant, because it's being used for a general purpose data repeating application.


Have you waited for the timeout period, just in case it's something to do with the communications?

 

[edit] did not see the lightbulb on, so ignore my previous remark.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 10
(4,368 Views)

Anything stage about hte string you are trying to unflatten. Can you post an example of one that causes a hang? When it hangs is LV using a lot of CPU? Is anything happening to memory allocation while its hung? If you let it sit in the hung state long enough will LV eventually crash?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 10
(4,360 Views)

Do you have any more details regarding this issue? I am currently investigating some issues in a very large system with some UI updates and haven't confirmed it but I may be running into the same issue. I would like to know if there is any more information on what the OP observed. I will try to update the thread regarding my findings as well.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 10
(4,327 Views)

I found the problem that was corrupting the string I was trying to unflatten--in my marshalling/demarshalling routine, I handle out-of-order UDP messages by including a "payload_number" element in the metadata, and I was getting the payload_numbers mixed up (was using for loop index, then added a parallel process, so there was chance for conflict). I moved to uniquely identifying the payloads by using a single-element queue to keep track of the payload number across the parallel processes, and that stopped my unflatten errors.

 

However, that does not explain why LabVIEW would just completely hang up when it attempted to unflatten the bogus payloads. It's not like it's doing any hardware calls, or in any other way waiting for more information. When you call it, that's all the information it's gonna get, so I would expect it would either work nominally (unflatten to the desired datatype) or throw and error and return immediately.

0 Kudos
Message 7 of 10
(4,322 Views)

Hi TurboPhil,

As far as I could find, there were no known issues such as the one you were seeing concerning hanging when Unflattening From String. My best guess is that something in the program was expecting a certain payload_number, and when it was receiving the wrong one, it was waiting for the right one. Obviously, I'm not sure exactly how the program is architectured, but from the sound of it, the program was pretty complex in terms of sending and routing the payloads, so that's what seems to me to be the most likely cause for such behavior.

David S.
0 Kudos
Message 8 of 10
(4,288 Views)

If I enabled execution highlighting, the program stopped executing on the Unflatten from String.

0 Kudos
Message 9 of 10
(4,283 Views)

As I mentioned before, I'm not entirely sure of the context of your code, but like I said, I was unable to find any open issues concerning the Unflatten from String function. If ensuring that the payloads were received in proper order resolved the issue, my instinct would be that some identifier in the payload was causing the program to hang. Fortunately, it sounds like you were able to resolve the issue by ensuring the proper delivery of the payload. 

David S.
0 Kudos
Message 10 of 10
(4,246 Views)