Other backends may also be affected. I have not tested exhaustively.
It would be good to check in GraphicsContextBase.set_dashes that dash_list is not all 0's. Some backends (cairo and gdk) override set_dashes, so those may need to be modified as well.
Fix #1999: dash value of zero causes infinite loop
@rephorm: Can you please confirm that the attached patch resolves your problem?
👍 - this is good to merge.