12-10-2012 11:00 AM
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:
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?
12-10-2012 11:22 AM
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?
12-10-2012 11:35 AM
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.
12-10-2012 11:45 AM - edited 12-10-2012 11:47 AM
@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.
12-10-2012 12:03 PM
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...
12-11-2012 03:12 PM
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.
12-11-2012 03:28 PM
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.
12-12-2012 01:29 PM
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.
12-12-2012 01:47 PM
If I enabled execution highlighting, the program stopped executing on the Unflatten from String.
12-13-2012 06:37 PM
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.