issue-#197 Problems with Coroutines

issue-#197 Problems with Coroutines

Postby Robert » Fri Apr 19, 2019 2:17 pm

For the issue see: https://redmine.blackboxframework.org/issues/197.

Initial discussion of this topic is in viewtopic.php?f=50&t=610&start=94 starting at date 10 April 2019.
User avatar
Robert
 
Posts: 1001
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#197 Problems with Coroutines

Postby Robert » Sat Apr 20, 2019 9:24 am

Latest crash today:

- Many trap windows called by Kernel.MarkReferencedCoroutines, then a final window called by Kernel.Cleanup, then 2 seconds later, exit to Windows.

No crashes yesterday!
User avatar
Robert
 
Posts: 1001
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#197 Problems with Coroutines

Postby Josef Templ » Sat Apr 27, 2019 8:29 am

Robert wrote:Latest crash today:

- Many trap windows called by Kernel.MarkReferencedCoroutines, then a final window called by Kernel.Cleanup, then 2 seconds later, exit to Windows.

No crashes yesterday!



Did it happen without unloading any modules that implement a coroutine?

- Josef
User avatar
Josef Templ
 
Posts: 2012
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#197 Problems with Coroutines

Postby Robert » Sat Apr 27, 2019 9:09 am

Josef Templ wrote:Did it happen without unloading any modules that implement a coroutine?

I can't remember precisely.
But while my module is now pretty stable / finished, it almost certainly had had a few cycles of minor edit - compile - unload.

The setup is, in some ways, pretty simple. Coroutines are only used in one module, which only generates one Iterator within a Command. The Command may be called more than once by the user, and each time a fresh Iterator is created.

The Iterator variable is a global variable of the module; it is not a local variable on a procedure call stack.

No other modules have pointer chains to the Iterator.
User avatar
Robert
 
Posts: 1001
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#197 Problems with Coroutines

Postby Josef Templ » Sat Apr 27, 2019 1:07 pm

Can you send me the sources?
I am not interested in the particular processing being done but in the overall setup and
if there is anything special about it. Something that I may have not considered in my tests.
Low-level things like finalizers, trap handlers, huge or otherwise special data structures,
calls to WinApi functions, etc.
Without that I am not able to debug this issue.
My tests so far have not shown a single anomaly.

- Josef
User avatar
Josef Templ
 
Posts: 2012
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#197 Problems with Coroutines

Postby Robert » Wed Jun 26, 2019 9:48 am

Maybe we should reject this issue until the problem appears again, if ever?

It has only affected me with one module, and then only during development. I am currently using the module with no problems.

The problem was always intermittent; I could never consistently provoke it.

If we do reject the main issue, should the minor points mentioned be fixed now?
User avatar
Robert
 
Posts: 1001
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#197 Problems with Coroutines

Postby Josef Templ » Mon Nov 18, 2019 10:43 pm

There seems to be a related posting on the community forum at https://community.blackboxframework.org/viewtopic.php?f=48&t=238.
Fortunately, it also contains a bug fix proposal for the garbage collector issue.

- Josef
User avatar
Josef Templ
 
Posts: 2012
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#197 Problems with Coroutines

Postby Robert » Tue Nov 19, 2019 4:10 pm

Interesting, and it sounds as if a fix has been found.
I am currently on a (pedal) cycling holiday in Spain, so can not look at the comments in any detail until I return (and even then will probably not understand the technical detail).
The problems I had were while developing a mapping program I use for planning these biking trips. The program now works reliably; the problems I had only occurred while developing it which involved multiple compile unload cycles.
User avatar
Robert
 
Posts: 1001
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#197 Problems with Coroutines

Postby Josef Templ » Tue Nov 19, 2019 4:42 pm

Robert, this is exactly where the bug occurs: unloading of a module that implements a coroutine object.
In that case the finalization procedure of the coroutine object is not called because the module the object belongs to
has been unloaded. In other words, even when the finalizer is inherted it is not executed when the module is unloaded.
Fortunately this can be fixed by moving the finalizer from module Coroutines to module Kernel.

have a safe trip

- Josef
User avatar
Josef Templ
 
Posts: 2012
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#197 Problems with Coroutines

Postby cfbsoftware » Tue Dec 03, 2019 7:46 pm

Robert wrote:... which involved multiple compile unload cycles.

Was that pun intentional? ;)
cfbsoftware
 
Posts: 204
Joined: Wed Sep 18, 2013 10:06 pm

Next

Return to Resolved (Bugs)

Who is online

Users browsing this forum: No registered users and 0 guests

cron