Message172759
That's normal.
You're truncating the file after having it mapped, so touching the pages corresponding to the truncated part of the file will result in a segfault.
See mmap's man page:
"""
Use of a mapped region can result in these signals:
SIGBUS Attempted access to a portion of the buffer that does not correspond to
the file (for example, beyond the end of the file, including the case
where another process has truncated the file).
"""
The only way to guard against it would be to call fstat() in every buffer-protocol method in case of file-backed mapping to check against the current file size, but that would be awfully slow in case of sequential access (just imagine performing an md5sum of an mmap-ed file). |
|
Date |
User |
Action |
Args |
2012-10-12 16:30:44 | neologix | set | recipients:
+ neologix, christian.heimes, Vladimir.Ushakov |
2012-10-12 16:30:43 | neologix | set | messageid: <1350059443.96.0.681059893632.issue16212@psf.upfronthosting.co.za> |
2012-10-12 16:30:43 | neologix | link | issue16212 messages |
2012-10-12 16:30:43 | neologix | create | |
|