fibers icon indicating copy to clipboard operation
fibers copied to clipboard

Infinite loops on uncaught exceptions

Open cwebber opened this issue 3 years ago • 5 comments

In switching guile-goblins from Fibers 1.0 to 1.10, I noticed that when exceptions occured, schedulers suddenly stopped working but also my cpu would shoot up to 100%. That's strange, that shouldn't happen, what gives?

I did a git-bisect against fibers to try to figure out where this started. The issue is introduced in 84addfbfc69e7dea63c4b9b08656d052043bcecf. I haven't checked for sure, but I'm pretty certain that what's happening is that where the scheduler previously was catching the exception in the individual task but the scheduler would continue looping, now the scheduler is breaking and not continuing on an individual error. Thus, it isn't feeding anything to the individual fibers, which start spin locking madly.

cwebber avatar Apr 27 '22 21:04 cwebber

One option is simply to revert 84addfbfc69e7dea63c4b9b08656d052043bcecf. Maybe @wingo might not like this; it fixes it, but it re-introduces whatever performance issue the commit was meant to address.

cwebber avatar Apr 28 '22 19:04 cwebber

IMO, stability is always preferred over performance.

aconchillo avatar Apr 28 '22 21:04 aconchillo

Do you have a test case?

wingo avatar Apr 29 '22 13:04 wingo

@cwebber Probably completely unrelated, but I'm wondering if this commit https://github.com/wingo/fibers/commit/c25dcb9cc4b5b977474ffe555b40ce2f1d0d1edc would fix the issue you are seeing. Available in Fibers 1.1.1.

aconchillo avatar Jun 04 '22 05:06 aconchillo

Pretty sure this is fixed via #76, which is now in Guile main. Christine can you give a try with Guile from git and see if you are still having issues? Or otherwise close this one if you think it is fixed.

wingo avatar Jun 08 '23 08:06 wingo