mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix SF bug #1402308, segfault when using mmap(-1, ...)
This didn't crash on Linux, but valgrind complained. I'm not sure if this test is valid on Windows. Will backport.
This commit is contained in:
parent
ae1df41127
commit
3b4fff8079
5 changed files with 13 additions and 0 deletions
|
@ -281,6 +281,14 @@ def test_both():
|
|||
except OSError:
|
||||
pass
|
||||
|
||||
print ' Try opening a bad file descriptor...'
|
||||
try:
|
||||
mmap.mmap(-1, 4096)
|
||||
except mmap.error:
|
||||
pass
|
||||
else:
|
||||
verify(0, 'expected a mmap.error but did not get it')
|
||||
|
||||
# Do a tougher .find() test. SF bug 515943 pointed out that, in 2.2,
|
||||
# searching for data with embedded \0 bytes didn't work.
|
||||
f = open(TESTFN, 'w+')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue