New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code runs as expected but kernel shows "no enough memory for the allocation" #4151
Comments
I am new to tinygo as well, but there is no much to go on with the information you provided. From my understanding this go code is translate to c and recompiled with "gcc" ... so this might be a bug withing c library and nothing to do with tinygo... also might be related to go stack escape that embedded programming might not tolerate and you need to find out the problem lines within your go code. Hard to say. last time over 30 yrs ago I was doing embedded in c ... program running just fine on linux would not work in embedded since hardware or embedded library coded for the specific chip set would not allow to exceed physical hardware limitation that library was coded for. |
It's probably this code: tinygo/src/runtime/runtime_unix.go Lines 220 to 237 in 6384eca
I'm surprised it prints a warning. Maybe the kernel really doesn't like an 1GB allocation? (It should just return an error if it is too big).
It is not, we use LLVM as a compiler toolchain (and don't use GCC anywhere in the process). |
Perhaps this kernel patch is relevant https://lore.kernel.org/linux-mm/18dc0807-5596-3aad-350d-3673a033bca8@redhat.com/T/ Edit: This thread too https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031520
|
I compiled my small tool using tinygo because I'm targeting a Raspberry Pi first generation with 256MB of RAM, so every byte counts :) It works just fine. However I just noticed that it generates the following kernel error every time it runs.
[33719.335172] __vm_enough_memory: pid: 7816, comm: mystuff, no enough memory for the allocation
If I compile it using
GOOS=linux GOARCH=arm GOARM=6 tinygo build mystuff.go
. If I run the same code but compiled it usinggo
the kernel doesn't seem to complain.For my tests I'm using:
The text was updated successfully, but these errors were encountered: