Add some basic sanity checks for --mmap to cover general match/not match
correctness and to test breakage discovered in PRs 165471, 219402 and ultimately
fixed in rS318565.
Details
Details
- Reviewers
emaste cem ngie bapt - Commits
- rS318908: bsdgrep: add --mmap tests
Diff Detail
Diff Detail
- Lint
No Lint Coverage - Unit
No Test Coverage - Build Status
Buildable 9401 Build 9859: arc lint + arc unit
Event Timeline
Comment Actions
- Correct path for test; input file is not generated in /tmp, leftover from local testing
Comment Actions
- Clarify gnu grep from port failure
- use jot(1) more effectively in a way portable to both NetBSD and FreeBSD
contrib/netbsd-tests/usr.bin/grep/t_grep.sh | ||
---|---|---|
609–611 | I compromise, went with jot -b " " -s "" 4096 since -s seems to also be available on NetBSD. Apologies- I had a case of 'not paying attention to the man page' | |
617 | It's possible, but I've not thought of it yet. The alternative methods that I've conceived of for reproduction are unreliable. From the heap-allocated line buffer, you have to manage to either: 1.) Smash the stack Alternatively, you could try to exhaust address space, but #1 would be an easier target than that. I'm not sure how to set this up any other way, unfortunately, to guarantee detecting the overflow. The original test case was grep --mmap -r -e '^Feb' /usr/share/*', which is also technicaly unreliable. |