Skip to content

Commit

Permalink
Fix Rasberry Pi stream test failures. (#293)
Browse files Browse the repository at this point in the history
### ISSUE

Bizarre behavior on 32bit Raspberry Pi OS when aws_input_stream_seek() was called, due to aws-c libraries not being compiled with Large Files Support (LFS), which led to confusion over the size of off_t, which led to stack corruption when functions took arguments of this type.

### CHANGES
This incorporates fixes from awslabs/aws-c-common#808 and awslabs/aws-c-io#386.  

int64_t is now used for offsets instead of off_t/aws_off_t.
  • Loading branch information
graebm authored Jun 2, 2021
1 parent 2c7b49f commit c058989
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ static void s_aws_input_stream_py_destroy(struct aws_input_stream *stream) {

static int s_aws_input_stream_py_seek(
struct aws_input_stream *stream,
aws_off_t offset,
int64_t offset,
enum aws_stream_seek_basis basis) {

struct aws_input_stream_py_impl *impl = stream->impl;
Expand All @@ -664,7 +664,7 @@ static int s_aws_input_stream_py_seek(
return AWS_OP_ERR; /* Python has shut down. Nothing matters anymore, but don't crash */
}

method_result = PyObject_CallMethod(impl->self_proxy, "_seek", "(li)", offset, basis);
method_result = PyObject_CallMethod(impl->self_proxy, "_seek", "(Li)", offset, basis);
if (!method_result) {
aws_result = aws_py_raise_error();
goto done;
Expand Down
2 changes: 1 addition & 1 deletion source/s3_meta_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static int s_aws_input_stream_file_read(struct aws_input_stream *stream, struct
}
static int s_aws_input_stream_file_seek(
struct aws_input_stream *stream,
aws_off_t offset,
int64_t offset,
enum aws_stream_seek_basis basis) {
struct aws_input_py_stream_file_impl *impl = stream->impl;
return aws_input_stream_seek(impl->actual_stream, offset, basis);
Expand Down

0 comments on commit c058989

Please sign in to comment.