-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
bytecodealliance/wasmtime
#2164Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Precisely, size as off64_t
. The conversion occurs here
On my system off64_t
is i64
. This means that the number will overflow if larger than i64::max_value()
and become negative. In such case, ftruncate
will return an EINVAL
: (from man ftruncate
:
EINVAL The argument length is negative or larger than the maximum file size.
Should we manually return an error should an overflow occur or is the EINVAL
returned by ftruncate
the intended behavior? I would return an io::ErrorKind::InvalidInput
with the payload indicating that an overflow occured (or even just TryFromIntError(())
which try_into
returns)
This issue was noticed while discussing CraneStation/wasi-common#47.
cc @alexcrichton
I will implement the fix once we've decided what kind of behavior we want.
hellow554
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.