https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198706
Bug ID: 198706 Summary: [libstand] ngets shall exit on EOF Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: int0ds...@gmail.com Hi All, I`ve noted that ngets() from libstand starts consuming CPU like mad when EOF appears on stdin. I see this issue with bhyveload when forwarding "user input" over pipe. Here is the simpliest program to reproduce: cat > ./bget.c #include #include #include #include int main() { char str[512]; for (;;) { ngets(str, sizeof(str)); if (str[0] == '\n') // <--- The program shall exit on \nEOF here, but it // spins inside ngets() and does not reach this point break; } return 0; } $ echo "balbalbalabl" | ./bget & $ There is no problem in libstand when it is used in the real boot loader, but inside bhyveload it has a bug described above. There is a github pull request with suggested patch https://github.com/freebsd/freebsd/pull/23 -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"