Sponsored by: Klara, Inc.
Details
Details
- Reviewers
becker.greg_att.net kib - Group Reviewers
Klara tests - Commits
- rGc7dd4601aeeb: libc: Add a rudimentary test for quick_exit(3).
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 53670 Build 50561: arc lint + arc unit
Event Timeline
lib/libc/tests/stdlib/quick_exit_test.c | ||
---|---|---|
73 | What guarantees that buf is nul-terminated? |
lib/libc/tests/stdlib/quick_exit_test.c | ||
---|---|---|
73 | It doesn't matter, the comparison will fail before overrunning. |
lib/libc/tests/stdlib/quick_exit_test.c | ||
---|---|---|
73 | It fails and results in false test failure. If buf is not terminated by nul, strcmp() can return false despite initialized part of the buf containing the right chars. In fact, it worked for you because stack is zero-initialized and buf is large enough to not reuse anything in stack space. |
lib/libc/tests/stdlib/quick_exit_test.c | ||
---|---|---|
73 | You missed the fact that buf is initialized to all-zeroes on line 51. The only way it can end up being unterminated is if the child produces something else than what we expected, in which case the resultant test failure is very much the intended outcome. |
lib/libc/tests/stdlib/quick_exit_test.c | ||
---|---|---|
73 | Indeed, sorry. |