-
Notifications
You must be signed in to change notification settings - Fork 662
Description
I have attached a copy of a program I am working on in its very early stages which suffers from this issue.
In the experimentation I've done with the program I've attached, the requirements for this crash to occur are as follows:
- Have some widgets that show tooltips when hovered over.
- Don't call nk_convert every single frame (as per the documentation's recommendation, I am only drawing frames where something changes, so I'm not calling nk_convert every frame).
- Move your mouse between two widgets that show a tooltip on hover. In my program, the easiest way to trigger the crash is to switch between the Project and Chain pages in the bottom left.
The crash occurs in nk_convert and seems to be because nk_foreach enters an infinite loop. This causes the program to freeze, CPU usage to spike to 100% and memory usage to slowly climb.
In my program, I have patched nk_convert so that it detects when an infinite loop is starting, prints a message, then breaks from nk_foreach. While this ideally shouldn't be needed, it is better than redrawing every frame or abandoning the use of tooltips entirely.
I've noticed that somebody else has had this issue several years ago (#168) although my problem is due to tooltips and the cause of the infinite loop seems different to how he described ('next' is not set to 0). I also can provide a program that has the issue so it should hopefully be easier to diagnose.