dankamongmen / growlight

notcurses block device manager / system installation tool
https://nick-black.com/dankwiki/index.php/Growlight
GNU General Public License v3.0
84 stars 12 forks source link

livelock in shutdown following "killing the event thread" #135

Closed dankamongmen closed 3 years ago

dankamongmen commented 3 years ago

This seems reproducible, actually:

we lock after "killing the event thread", and strace shows what looks to be a single thread sitting in a futex.

dankamongmen commented 3 years ago

Yeah, the event thread locks both growlight and notcurses locks. It's a tangled mess in there.

I wonder...can we not just detach the GUI from the running growlight context, and let it keep on keepin' on? It will no longer be calling into our GUI, and thus we can safely destroy the latter...

dankamongmen commented 3 years ago

Hrmmm...not unless we have everything lock on the gui struct, no. Which we could certainly do.

dankamongmen commented 3 years ago

This was happening because we were entering a hot loop due to a read() failure following an inotify event; see #136. I'm inclined to leave this open, since it's a more general problem, but this reproducible case is resolved...hrmm. Closing this for now.