-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Crash on runtime upgrade related to wasmtime (Raspbian only) #12538
Comments
CC @koute |
Technically it's not failing when trying to allocate memory; it's failing to allocate address space. As long as overcommit is enabled the amount of RAM shouldn't actually make a difference whether this fails or not (unless it's mmaped with Can you get the user to run Anyway, if my theory is correct then this isn't really a bug per-se. It is something that we could improve though, once I get through with my executor refactoring. (We currently set quite an excessive maximum number of instances when configuring the executor; that won't be necessary once we'll actually precisely control how many instances can be instantiated in parallel.) |
Host:
Container:
|
That's interesting. It might be a kernel-level limit or something along those lines. It's a little hard to debug this without actually having access to the hardware. I'll see if I can compare Ubuntu and Raspbian's kernel configs and see if there are any differences that pop up related to this. |
I can expose Raspberry PI 3 1G over Internet to you, though it is extremely weak and would probably be frustrating to work with. |
So that would be with the affected Raspbian installed on it? That could help; we could try. Doesn't really matter that the hardware's weak as long as I can poke-and-prod it through SSH with root access and maybe run some test programs; that's usually the fastest way to figure out problems like these. |
Emailed access details to you |
@nazar-pc Thanks for the access. You can now shut it down. I've finished investigating the issue. I've verified that it's only possible to reserve 512GB of address space on your Raspberry Pi and anything more will return an out-of-memory error. This is due to the Raspbian's kernel being configured with only a 3 level virtual memory translation table allowing for pointers only up to 39 bits in size. Ubuntu's kernel is not affected by this, and that's why you don't see this issue on Ubuntu. Apparently this is a known problem: raspberrypi/linux#4375 Also more details here for those interested: https://www.kernel.org/doc/html/v5.8/arm64/memory.html So technically it's not really a bug on our side, although we are kinda wasteful with the address space we reserve and we definitely could do a better job of using less of it. This is something I can improve by the way of my executor refactoring on which I've restarted work recently. Until I'm finished it'd be the best if you'd advise that people don't run their nodes on Raspbian. |
Awesome, thanks for the update! |
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
Initially reported by a user at https://forum.subspace.network/t/failed-to-allocate-bytes-exception-when-running-docker-on-aarch64/606 is a crash that is essentially this:
Steps to reproduce
This happens when node tries to apply runtime upgrade, up until that point node worked fine.
Affected hardware is Raspberry PI 4 8G with 64-bit Raspbian OS.
I tried Rock64 4G and Orange PI 3 2G with sufficient swap, both of which worked fine with Ubuntu 22.04.
Then by my suggestion user tried Ubuntu 22.04 on Raspberry PI 4 and it worked fine too.
There is certainly enough RAM, not to mention there was 8-16G of swap on top of that.
We double checked that memory overcommit was allowed in the kernel on Raspbian, which was indeed the case.
So for now this seems to be Raspbian-specific, but likely reproducible on other distros.
Not sure what happens there exactly, but I think it'll affect many if not all chains and would be good to figure out what it is. Maybe this is upstream wasmtime issue, not 100% sure yet.
The text was updated successfully, but these errors were encountered: