Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Test terminates_on_timeout fails with latest Substrate #5190

Closed
bkchr opened this issue Mar 23, 2022 · 2 comments · Fixed by paritytech/substrate#11107 or #5197
Closed

Test terminates_on_timeout fails with latest Substrate #5190

bkchr opened this issue Mar 23, 2022 · 2 comments · Fixed by paritytech/substrate#11107 or #5197
Assignees
Labels
I3-bug Fails to follow expected behavior.

Comments

@bkchr
Copy link
Member

bkchr commented Mar 23, 2022

The test is failing with:

thread 'terminates_on_timeout' panicked at 'Err(InvalidCandidate(WorkerReportedError("execute: Allocator ran out of space")))', node/core/pvf/tests/it/main.rs:98:14

https://gitlab.parity.io/parity/polkadot/-/jobs/1457003

The heap base is being fetched as the maximum memory size given to the runtime. I think this is related of us using the default allocator and not overwriting the allocator as we do for our runtimes.

Can be reproduced by:

cargo update -p sp-io
cargo test -p polkadot-node-core-pvf --release terminates_on_timeout
@bkchr bkchr added the I3-bug Fails to follow expected behavior. label Mar 23, 2022
@koute
Copy link
Contributor

koute commented Mar 23, 2022

I'm on it.

@koute
Copy link
Contributor

koute commented Mar 23, 2022

Okay, so the problem here is that the PVF executor expects an extra 2048 heap pages allocated which it is not getting, hence the allocator is running out of space.

Since my PR those extra heap pages are not added during the instantiation but are statically added to the WASM blob before it is compiled, and the PVF executor precompiles its WASM blob, and that codepath doesn't add those extra heap pages, so it only allocates whatever is originally requested by the WASM blob itself.

Should be an easy fix; I'll also add a test to substrate for this while I'm at it. I'll have a PR with the fix ready tomorrow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug Fails to follow expected behavior.
Projects
None yet
2 participants