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
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
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 ↗ | (On Diff #28595) | 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 ↗ | (On Diff #28595) | 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. |