Home
last modified time | relevance | path

Searched hist:110 (Results 1 – 6 of 6) sorted by path

/unit/src/
H A Dnxt_application.hdiff 685:99f3d48664de Wed Jun 06 13:53:00 UTC 2018 Valentin Bartenev <vbart@nginx.com> Go: specifying command line arguments to the executable.

This closes #110 issue on GitHub.
H A Dnxt_conf_validation.cdiff 685:99f3d48664de Wed Jun 06 13:53:00 UTC 2018 Valentin Bartenev <vbart@nginx.com> Go: specifying command line arguments to the executable.

This closes #110 issue on GitHub.
H A Dnxt_main_process.cdiff 685:99f3d48664de Wed Jun 06 13:53:00 UTC 2018 Valentin Bartenev <vbart@nginx.com> Go: specifying command line arguments to the executable.

This closes #110 issue on GitHub.
H A Dnxt_sockaddr.cdiff 110:b367ad00650d Thu Jun 29 16:25:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Fixed port processing in nxt_sockaddr_text().
H A Dnxt_sockaddr.hdiff 110:b367ad00650d Thu Jun 29 16:25:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Fixed port processing in nxt_sockaddr_text().
/unit/src/wasm/
H A Dnxt_wasm.cdiff 2557:af47f86f96a1 Wed Sep 13 23:37:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Wasm: Fix multiple successive calls to the request_handler.

When trying to upload files to the luw-upload-reflector demo[0] above a
certain size that would mean Unit would need to make more than two calls
to the request_handler function in the Wasm module we would get the
following error from wasmtime and the upload would stall on the third
call to the request_handler

WASMTIME ERROR: failed to call function [->wasm_request_handler]
error while executing at wasm backtrace:
0: 0x5ce2 - <unknown>!memcpy
1: 0x7df - luw_req_buf_append
at /home/andrew/src/unit-wasm/src/c/libunit-wasm.c:308:14
2: 0x3a1 - luw_request_handler
at /home/andrew/src/unit-wasm/examples/c/luw-upload-reflector.c:110:3

Caused by:
wasm trap: out of bounds memory access

This was due to ->content_off (the offset of where the actual body
content starts in the request structure/memory) being some overly large
value.

This was largely down to me being an idiot!

Before calling the loop that makes the calls to the request_handler we
would calculate the new offset, which is now just the size of the
request structure as we don't re-send all the HTTP meta data and headers
etc. However because this value is in the request structure which is in
the shared memory and we use this same memory for requests and
responses, when we make a response we overwrite this request structure
with the response structure, so our ->content_off is now some wacked out
value when we make the next call to the request_handler.

To fix this we just need to reset ->content_off each time round the
loop.

There's also no point in setting ->nfields to 0, it has the same issue
as above, but doesn't get re-used by the Wasm module anyway.

[0]: <https://github.com/nginx/unit-wasm/blob/main/examples/c/luw-upload-reflector.c>

Signed-off-by: Andrew Clayton <a.clayton@nginx.com>