zxcalc / zxlive

A graphical tool for the ZX calculus
Apache License 2.0
50 stars 19 forks source link

Cutting a W-spider with the magic wand generates a segmentation fault in Windows #355

Open semiclassical opened 1 day ago

semiclassical commented 1 day ago

I run ZXLive via Git Bash on Windows 10. I draw two-leg W-spider, then move to derivation mode and attempt to cut the W-spider using the magic wand (to split it into two W-spiders). This immediately causes my session of ZXLive to end, with Git Bash indicating a segmentation fault.

image

RazinShaikh commented 1 day ago

Do you get any error messages?

semiclassical commented 20 hours ago

ZXLive immediately closes when I do with no error message. Git Bash's response is just "Segmentation fault" and moving on to a fresh prompt.

That said, while testing today I realized I'd missed that the fault only occurs if I try to cut the dot-marked wire of a W spider. If I cut one of the unmarked wires, the spider unfuses in the expected way. The former isn't a proper operation in the first place, but having that user error result in ZXLive closing doesn't seem ideal.

jvdwetering commented 5 hours ago

Hmm, probably it tries to reference a node that doesn't exist, due to some special case behaviour with the W-spider. Spider cutting with the W needs to have special case behaviour anyway