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

growlight eats a core following new partition #136

Closed dankamongmen closed 3 years ago

dankamongmen commented 3 years ago

I create a new partition (see #135 for the same setup). Before exiting, growlight is showing 100% cpu usage, or close to it. strace shows a hot loop of the following:

[pid 1810107] read(8, 0x7f79dc066250, 8) = -1 EINVAL (Invalid argument)
[pid 1810107] ioctl(3, TIOCGWINSZ, {ws_row=70, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
[pid 1810107] ioctl(3, TIOCGWINSZ, {ws_row=70, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
[pid 1810107] epoll_wait(13, [{EPOLLIN, {u32=8, u64=8}}], 128, 1000) = 1
[pid 1810107] read(8, 0x7f79dc066250, 8) = -1 EINVAL (Invalid argument)
[pid 1810107] ioctl(3, TIOCGWINSZ, {ws_row=70, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
[pid 1810107] ioctl(3, TIOCGWINSZ, {ws_row=70, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
[pid 1810107] epoll_wait(13, [{EPOLLIN, {u32=8, u64=8}}], 128, 1000) = 1
[pid 1810107] read(8, 0x7f79dc066250, 8) = -1 EINVAL (Invalid argument)
[pid 1810107] ioctl(3, TIOCGWINSZ, {ws_row=70, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
[pid 1810107] ioctl(3, TIOCGWINSZ, {ws_row=70, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
[pid 1810107] epoll_wait(13, [{EPOLLIN, {u32=8, u64=8}}], 128, 1000) = 1

this seems to go on forever. the diagnostics are filled with "Error reading inotify event on 8 (Invalid argument)". this probably leads directly to the problems we see in #135 (though that is a more general problem at work).

dankamongmen commented 3 years ago

Ahhh. We're passing in sizeof(buf), but that changed to be a heap-allocated pointer recently. We thus need its true size. Whoops!

dankamongmen commented 3 years ago

Yeah, that got it. We can now shut down properly, also.