We've been using `p_ftruncate()` to extend the packfile in order to mmap it and write the new data into it. This works well in the general case, but as truncation does not allocate space in the filesystem, it must do so when we write data to it. The only way the OS has to indicate a failure to allocate space is via SIGBUS which means we tried to write outside the file. This will cause everyone to crash as they don't expect to handle this signal. Switch to using `p_lseek()` and `p_write()` to extend the file in a way which tells the filesystem to allocate the space for the missing data. We can then be sure that we have space to write into.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
hash | Loading commit data... | |
transports | Loading commit data... | |
unix | Loading commit data... | |
win32 | Loading commit data... | |
xdiff | Loading commit data... | |
annotated_commit.c | Loading commit data... | |
annotated_commit.h | Loading commit data... | |
array.h | Loading commit data... | |
attr.c | Loading commit data... | |
attr.h | Loading commit data... | |
attr_file.c | Loading commit data... | |
attr_file.h | Loading commit data... | |
attrcache.c | Loading commit data... | |
attrcache.h | Loading commit data... | |
bitvec.h | Loading commit data... | |
blame.c | Loading commit data... | |
blame.h | Loading commit data... | |
blame_git.c | Loading commit data... | |
blame_git.h | Loading commit data... | |
blob.c | Loading commit data... | |
blob.h | Loading commit data... | |
branch.c | Loading commit data... | |
branch.h | Loading commit data... | |
bswap.h | Loading commit data... | |
buf_text.c | Loading commit data... | |
buf_text.h | Loading commit data... | |
buffer.c | Loading commit data... | |
buffer.h | Loading commit data... | |
cache.c | Loading commit data... | |
cache.h | Loading commit data... | |
cc-compat.h | Loading commit data... | |
checkout.c | Loading commit data... | |
checkout.h | Loading commit data... | |
cherrypick.c | Loading commit data... | |
clone.c | Loading commit data... | |
clone.h | Loading commit data... | |
commit.c | Loading commit data... | |
commit.h | Loading commit data... | |
commit_list.c | Loading commit data... | |
commit_list.h | Loading commit data... | |
common.h | Loading commit data... | |
config.c | Loading commit data... | |
config.h | Loading commit data... | |
config_cache.c | Loading commit data... | |
config_file.c | Loading commit data... | |
config_file.h | Loading commit data... | |
crlf.c | Loading commit data... | |
date.c | Loading commit data... | |
delta-apply.c | Loading commit data... | |
delta-apply.h | Loading commit data... | |
delta.c | Loading commit data... | |
delta.h | Loading commit data... | |
describe.c | Loading commit data... | |
diff.c | Loading commit data... | |
diff.h | Loading commit data... | |
diff_driver.c | Loading commit data... | |
diff_driver.h | Loading commit data... | |
diff_file.c | Loading commit data... | |
diff_file.h | Loading commit data... | |
diff_patch.c | Loading commit data... | |
diff_patch.h | Loading commit data... | |
diff_print.c | Loading commit data... | |
diff_stats.c | Loading commit data... | |
diff_tform.c | Loading commit data... | |
diff_xdiff.c | Loading commit data... | |
diff_xdiff.h | Loading commit data... | |
errors.c | Loading commit data... | |
fetch.c | Loading commit data... | |
fetch.h | Loading commit data... | |
fetchhead.c | Loading commit data... | |
fetchhead.h | Loading commit data... | |
filebuf.c | Loading commit data... | |
filebuf.h | Loading commit data... | |
fileops.c | Loading commit data... | |
fileops.h | Loading commit data... | |
filter.c | Loading commit data... | |
filter.h | Loading commit data... | |
fnmatch.c | Loading commit data... | |
fnmatch.h | Loading commit data... | |
global.c | Loading commit data... | |
global.h | Loading commit data... | |
graph.c | Loading commit data... | |
hash.c | Loading commit data... | |
hash.h | Loading commit data... | |
hashsig.c | Loading commit data... | |
ident.c | Loading commit data... | |
ignore.c | Loading commit data... | |
ignore.h | Loading commit data... | |
index.c | Loading commit data... | |
index.h | Loading commit data... | |
indexer.c | Loading commit data... | |
iterator.c | Loading commit data... | |
iterator.h | Loading commit data... | |
khash.h | Loading commit data... | |
map.h | Loading commit data... | |
merge.c | Loading commit data... | |
merge.h | Loading commit data... | |
merge_file.c | Loading commit data... | |
merge_file.h | Loading commit data... | |
message.c | Loading commit data... | |
message.h | Loading commit data... | |
mwindow.c | Loading commit data... | |
mwindow.h | Loading commit data... | |
netops.c | Loading commit data... | |
netops.h | Loading commit data... | |
notes.c | Loading commit data... | |
notes.h | Loading commit data... | |
object.c | Loading commit data... | |
object.h | Loading commit data... | |
object_api.c | Loading commit data... | |
odb.c | Loading commit data... | |
odb.h | Loading commit data... | |
odb_loose.c | Loading commit data... | |
odb_mempack.c | Loading commit data... | |
odb_pack.c | Loading commit data... | |
offmap.h | Loading commit data... | |
oid.c | Loading commit data... | |
oid.h | Loading commit data... | |
oidarray.c | Loading commit data... | |
oidarray.h | Loading commit data... | |
oidmap.h | Loading commit data... | |
openssl_stream.c | Loading commit data... | |
openssl_stream.h | Loading commit data... | |
pack-objects.c | Loading commit data... | |
pack-objects.h | Loading commit data... | |
pack.c | Loading commit data... | |
pack.h | Loading commit data... | |
path.c | Loading commit data... | |
path.h | Loading commit data... | |
pathspec.c | Loading commit data... | |
pathspec.h | Loading commit data... | |
pool.c | Loading commit data... | |
pool.h | Loading commit data... | |
posix.c | Loading commit data... | |
posix.h | Loading commit data... | |
pqueue.c | Loading commit data... | |
pqueue.h | Loading commit data... | |
push.c | Loading commit data... | |
push.h | Loading commit data... | |
rebase.c | Loading commit data... | |
refdb.c | Loading commit data... | |
refdb.h | Loading commit data... | |
refdb_fs.c | Loading commit data... | |
refdb_fs.h | Loading commit data... | |
reflog.c | Loading commit data... | |
reflog.h | Loading commit data... | |
refs.c | Loading commit data... | |
refs.h | Loading commit data... | |
refspec.c | Loading commit data... | |
refspec.h | Loading commit data... | |
remote.c | Loading commit data... | |
remote.h | Loading commit data... | |
repo_template.h | Loading commit data... | |
repository.c | Loading commit data... | |
repository.h | Loading commit data... | |
reset.c | Loading commit data... | |
revert.c | Loading commit data... | |
revparse.c | Loading commit data... | |
revwalk.c | Loading commit data... | |
revwalk.h | Loading commit data... | |
settings.c | Loading commit data... | |
sha1_lookup.c | Loading commit data... | |
sha1_lookup.h | Loading commit data... | |
signature.c | Loading commit data... | |
signature.h | Loading commit data... | |
socket_stream.c | Loading commit data... | |
socket_stream.h | Loading commit data... | |
sortedcache.c | Loading commit data... | |
sortedcache.h | Loading commit data... | |
stash.c | Loading commit data... | |
status.c | Loading commit data... | |
status.h | Loading commit data... | |
stream.h | Loading commit data... | |
strmap.c | Loading commit data... | |
strmap.h | Loading commit data... | |
strnlen.h | Loading commit data... | |
submodule.c | Loading commit data... | |
submodule.h | Loading commit data... | |
sysdir.c | Loading commit data... | |
sysdir.h | Loading commit data... | |
tag.c | Loading commit data... | |
tag.h | Loading commit data... | |
thread-utils.c | Loading commit data... | |
thread-utils.h | Loading commit data... | |
trace.c | Loading commit data... | |
trace.h | Loading commit data... | |
transaction.c | Loading commit data... | |
transport.c | Loading commit data... | |
tree-cache.c | Loading commit data... | |
tree-cache.h | Loading commit data... | |
tree.c | Loading commit data... | |
tree.h | Loading commit data... | |
tsort.c | Loading commit data... | |
userdiff.h | Loading commit data... | |
util.c | Loading commit data... | |
util.h | Loading commit data... | |
vector.c | Loading commit data... | |
vector.h | Loading commit data... | |
zstream.c | Loading commit data... | |
zstream.h | Loading commit data... |