Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Aug 10, 2022

The code here assumed that we can write HEAP64[ptr>>3] to read an
i64 value. That assumes the pointer has 64-bit alignment, which is not the
case with wasm32+WASM_BIGINT.

This fixes a WasmFS issue where we'd pass a pointer to a file size, a
64-bit number, and write it from JS in the fetch backend (specifically the
async jsimpl code that it uses), but this is a much more general issue.

Fixes #17614. The test added here fails before the fix, but perhaps we
should add a specific test for makeSetValue as well? (do we have unit
tests for that @sbc100 ?)

@kripken kripken requested review from sbc100 and tlively August 10, 2022 18:43
'proxy_to_pthread': (['-sPROXY_TO_PTHREAD', '-sINITIAL_MEMORY=32MB', '-DPROXYING'],),
# using BigInt support affects the ABI, and should not break things. (this
# could be tested on either thread; do the main thread for simplicity)
'bigint': (['-sPTHREAD_POOL_SIZE=5', '-sWASM_BIGINT'],),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we modify test/other/test_parseTools.js to test this fix more directly/precisely?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test there now.

@kripken kripken enabled auto-merge (squash) August 11, 2022 19:18
@kripken kripken merged commit 654f45f into main Aug 11, 2022
@kripken kripken deleted the wasmfs_i64 branch August 11, 2022 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WasmFS: Zero file size using fetch backend with WASM_BIGINT

3 participants