Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Tracking down the cause of a hanging actor

Hello all,

Last week, I was having an issue where adding more than a certain number of Timed Loop inherited actors would cause the project to hang when stopping and ultimately lock up LabVIEW. The cause was determined to be that LabVIEW was allocating a processor core to each child that inherits Timed Loop. At the time, I wasn't sure if this was applicable to my application because I was not using a timed loop structure with the diagram disable switch for LabVIEW RT; I was still using the Wait Until ms block to do timing. But I ended up creating a single high-rate timed loop actor that will periodically request data to be sent, rather than the child actors sending up to the root.

The scheme was working well with 4 child actors and the Timer (inherits from Timed Loop) child. Today, I plugged in the last actor of my project, the Logger, and I'm seeing the hanging issue again. I can successfully launch and close this Logger actor in a test VI and there are no errors. I also created a Dummy actor to take the place of the Logger. The Dummy has no functionality and therefore nothing in it that could possibly hang the application. I still cannot properly stop. If I disable the Dummy, everything works again. I'm at a loss as to how to go about debugging this or what could be causing it. A limit in the number of Message Enqueuers that a root actor can possess in its private variables maybe? Does anyone have any suggestions?

All child actors (including the dummy) when launched from the root:

dummy.PNG

0 Kudos
Message 1 of 6
(5,173 Views)

Where are you hanging? When you watch execution highlighting, where does it stop? Does Dummy just not launch? Does one of your Send functions never return? If you open up all the Actor Cores, is there one that is waiting for something?

0 Kudos
Message 2 of 6
(3,961 Views)

I am hanging after I initiate a stop. Once the stop button is pressed, the front panel closes but all of the libraries in my project remain locked indicating they are still running. I know all the actors are launching. They're able to send/receive messages to/from the root. The dummy does not do anything, but if I put the Logger in, it can create logs files and write to them. None of the children you can see above have their Actor Core method over-ridden. They simply wait for the root to send them a message. I'm not sure how to tell if a Send function never returns; none of them use while or for loops or anything that would cause them to wait.

With execution highlighting, the application stops in different places. Here is what happens when I launch Logger:

logger_highlighting.PNG

And this is what happens when I launch Dummy:

dummy_highlighting.PNG

0 Kudos
Message 3 of 6
(3,961 Views)

I can't tell anything from the static images -- sorry, my eyes aren't good enough to make out the gray. It's one of my complaints about debugging this stuff in LV that has never gotten traction to get improved. I can only tell what hasn't executed by actually watching the excution highlight dots live. I suggest you do the same. Set a breakpoint on a wire that gets triggered after the Stop signal is sent and then when that is tripped, turn on all the exec highlights on your dual monitor system and watch where the execution hangs. Failing that, put in a "Write to File" call in various places to write "I got to point 1" and "I got to point 2" into a log file.

Basically, you track this in AF the same way you track a parallel hang in any LV program (or, really, any program, only LV has the advantage of the execution highlighting... this stuff is true hell in C++ and C#). Watch the highlights and add to your log file. (Sometimes instead of using logs, I've been known to use One Button Alerts because I was too lazy to put the log file together. Someday I'll build and distribute a re-use library for a debug logger... I'm sure someone has built one... it's easy enough to do on an ad hoc basis ... you just need a non-reentrant subVI that takes in a string and keeps appending to the same file internally.)

0 Kudos
Message 4 of 6
(3,961 Views)

You can use my Debug Actor, you can send it messages from anywhere in the program using an FGV and it shows all the messages online in a console, with color filtering. Send messages to it after finishing all loops and see what doesn't appear.

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 5 of 6
(3,961 Views)

Ok, thank you for the suggestions. I'll let you know if I ever figure it out.

0 Kudos
Message 6 of 6
(3,961 Views)