You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
interp: ptrtoint integer size does not equal pointer size #2389
So the answer there is that yes that code still needs to be fixed but also my fix had a bug in it because markRoots already had another load-bearing bug.
This issue is most likely unrelated to any runtime GC that might happen. The interp package intercepts calls to runtime.alloc and replaces them with creating a new global.
I think this error was supposed to be used internally for rollback
No, what it actually shows is that there is a bug somewhere in the interp package. It is usually caused when something stores a pointer in a non-pointer field (such as int, uintptr, [4]byte, etc). It might be fixable by passing a correct layout parameter to runtime.alloc: there are many places where this isn't yet done (for example, in llvmutil.EmitPointerPack).
@deadprogram@dkegel-fastly In the spirit of prioritizing a fix for #2732, does it make sense to go ahead and enable the regression test Dan mentions above and in #2565? I'd suggest the build should fail until the fmt regression is fixed -- not supporting the arduino is not only blocking adoption but may be masking some other issues, like the apparent println() regression I also mention over there.
Got same error with rand.Intn() while building for target=arduino-nano. I'm totally new for LLVM and tinygo, so could be wrong, but there is some clues - code compiles well for target=arduino-mega2560, on smaller platform culprit is global struct math/rand.globalRand and if you disable code generating error (at interp/memory.go:857-862) - you get anoter:
ld: /tmp/***/main section `.data' will not fit in region `RAM'
ld: region `RAM' overflowed by 3644 bytes
So may be this is a bug with correct error reporting?
Activity
dgryski commentedon Dec 15, 2021
Is this the issue that was mentioned in the patch for the conservative collector here: f870ed5 ?
niaow commentedon Dec 15, 2021
No, it is not. Although idk if the patch might impact it.
dgryski commentedon Dec 15, 2021
Is this patch then still something I should create a PR for?
niaow commentedon Dec 15, 2021
I do not know. I will need to look into that again. That should not be related to this issue.
niaow commentedon Dec 15, 2021
So the answer there is that yes that code still needs to be fixed but also my fix had a bug in it because
markRootsalready had another load-bearing bug.niaow commentedon Dec 16, 2021
For future reference, that patch has been turned into #2396
dgryski commentedon Dec 16, 2021
This issue is also happening when trying to build https://github.com/google/open-location-code/, and I'm pretty sure that's a recent failure.
aykevl commentedon Dec 17, 2021
This issue is most likely unrelated to any runtime GC that might happen. The interp package intercepts calls to
runtime.allocand replaces them with creating a new global.No, what it actually shows is that there is a bug somewhere in the interp package. It is usually caused when something stores a pointer in a non-pointer field (such as int, uintptr, [4]byte, etc). It might be fixable by passing a correct layout parameter to
runtime.alloc: there are many places where this isn't yet done (for example, inllvmutil.EmitPointerPack).niaow commentedon Jan 1, 2022
While working on #2458, I found that this can be triggered by
testdata/json.go,testdata/stdlib.go, andtestdata/testing.goon AVR.markoxley commentedon Jan 10, 2022
Not sure if this will help, but I had a similar issue until I removed all fmt and log references from my code
dgryski commentedon Jan 10, 2022
(This is no longer crashing open-location-code/go either wasi or native.)
os: add stubs for Readlink and File.Seek for baremetal targets, with …
dkegel-fastly commentedon Jan 20, 2022
#2565 includes a regression test for this, but doesn't run it yet from Makefile, as it is still failing.
os: add stubs for Readlink and File.Seek for baremetal targets, with …
1 remaining item
os: add stubs for Readlink and File.Seek for baremetal targets, with …
dkegel-fastly commentedon Mar 22, 2022
I reduced one of the above testcases. To reproduce:
where main.go is
stevegt commentedon Mar 22, 2022
@deadprogram @dkegel-fastly In the spirit of prioritizing a fix for #2732, does it make sense to go ahead and enable the regression test Dan mentions above and in #2565? I'd suggest the build should fail until the fmt regression is fixed -- not supporting the arduino is not only blocking adoption but may be masking some other issues, like the apparent println() regression I also mention over there.
dkegel-fastly commentedon Mar 22, 2022
I've marked the two bugs with the 0.23 milestone, that might suffice.
stevegt commentedon Mar 22, 2022
Thanks Dan -- that should help. After I wrote that I realized that all I'm suggesting is TDD, but decided not to press it.
Noticing that this bug is causing some uncertainty in other repos as well -- tinygo-org/drivers#328 for instance.
dkegel-fastly commentedon Mar 22, 2022
Yeah, it's serious, and now that it has a minimal-ish reproducer, the compiler guys have something to chew on...
thanks for making a ruckus.
os: add stubs for Readlink and File.Seek for baremetal targets, with …
dkegel-fastly commentedon Apr 7, 2022
I think I heard this is AVR-specific, and the AVR backend is so unstable we had to disable tests.
See also #2492
Removing 0.23 milestone; who knows, maybe llvm 14 will improve things...?
os: add stubs for Readlink and File.Seek for baremetal targets, with …
os: add stubs for Readlink and File.Seek for baremetal targets, with …
Emreu commentedon Jul 11, 2022
Got same error with
rand.Intn()while building for target=arduino-nano. I'm totally new for LLVM and tinygo, so could be wrong, but there is some clues - code compiles well for target=arduino-mega2560, on smaller platform culprit is global structmath/rand.globalRandand if you disable code generating error (at interp/memory.go:857-862) - you get anoter:So may be this is a bug with correct error reporting?
deadprogram commentedon Oct 10, 2026
This is fixed in 0.43.0. interp now resizes
ptrtointandinttoptrresults to the right width, so this error no longer happens. See 835e0eb (#5745).Closing, but please reopen if you still see it.