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.
issue-#197 Problems with Coroutines
Re: issue-#197 Problems with Coroutines
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!
- 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!
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#197 Problems with Coroutines
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
Re: issue-#197 Problems with Coroutines
I can't remember precisely.Josef Templ wrote:Did it happen without unloading any modules that implement a coroutine?
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.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#197 Problems with Coroutines
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
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
Re: issue-#197 Problems with Coroutines
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?
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?
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#197 Problems with Coroutines
There seems to be a related posting on the community forum at https://community.blackboxframework.org ... f=48&t=238.
Fortunately, it also contains a bug fix proposal for the garbage collector issue.
- Josef
Fortunately, it also contains a bug fix proposal for the garbage collector issue.
- Josef
Re: issue-#197 Problems with Coroutines
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.
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.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#197 Problems with Coroutines
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
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
-
- Posts: 204
- Joined: Wed Sep 18, 2013 10:06 pm
- Contact:
Re: issue-#197 Problems with Coroutines
Was that pun intentional?Robert wrote:... which involved multiple compile unload cycles.