Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Controls Guy on July 20, 2021, 04:10:59 PM

Title: Program Sticks, .Running never clears
Post by: Controls Guy on July 20, 2021, 04:10:59 PM
I'm having something going on that I don't understand.  In the trend below, the cyan trace is a .Running bit that never resets.   The spike to the left represents a typical run duration.   Clearing C21, the yellow trace, is almost the last thing done in the program, so I know it's (at least almost) completing.    How can a program hang and never terminate?

There is one YIELD, and a timeslice of 20,000.
Title: Re: Program Sticks, .Running never clears
Post by: BobO on July 20, 2021, 04:48:59 PM
I'm having something going on that I don't understand.  In the trend below, the cyan trace is a .Running bit that never resets.   The spike to the left represents a typical run duration.   Clearing C21, the yellow trace, is almost the last thing done in the program, so I know it's (at least almost) completing.    How can a program hang and never terminate?

There is one YIELD, and a timeslice of 20,000.

Are you EXITing or HALTing?
Title: Re: Program Sticks, .Running never clears
Post by: Controls Guy on July 20, 2021, 05:01:12 PM
EXITing.   Not even conditional.    Last rung is

STR ST1 EXIT

AND the RUN isn't likely to be continuously retriggering.

BTW, what's the difference between .Running and .RanThisScan?    Once RUN, doesn't it run every scan till terminated?
Title: Re: Program Sticks, .Running never clears
Post by: BobO on July 20, 2021, 05:19:37 PM
Yes...unless it's suspended.

Is .Done coming on?
Title: Re: Program Sticks, .Running never clears
Post by: Controls Guy on July 20, 2021, 05:28:42 PM
Dunno, I'll add it to my trend...

OK, yes it is.   However, .Running isn't stuck at the moment.   Only seems to occur sporadically, maybe every 20-30 executions.

Will let you know .Done status if and when .Running sticks on again.
Title: Re: Program Sticks, .Running never clears
Post by: BobO on July 20, 2021, 07:35:51 PM
Dunno, I'll add it to my trend...

OK, yes it is.   However, .Running isn't stuck at the moment.   Only seems to occur sporadically, maybe every 20-30 executions.

Will let you know .Done status if and when .Running sticks on again.

Please do. If there is a hole I'd like to fix it.
Title: Re: Program Sticks, .Running never clears
Post by: Controls Guy on July 21, 2021, 09:21:28 PM
It was a loose nut behind the wheel.  Will explain tomorrow.
Title: Re: Program Sticks, .Running never clears
Post by: Controls Guy on July 22, 2021, 12:51:17 PM
I had a FOR loop after resetting C21.   At some stage I did a search and replace that replaced too many locations, and the From item in the replace was the loop index.  Was too small on the screen with status on to see that that was one of the addresses that had got replaced.    So it could get changed inside the loop.

Add in phases of the moon, and Shazam! an infinite loop.   Only reason it didn't watchdog was that it was in a program so had a time slice.