-
Notifications
You must be signed in to change notification settings - Fork 932
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
Unable to get the Whistle compiler to run under TinyGo latest dev #3771
Comments
I noticed an optimized build panics in macro.go line 240 but an unoptimized build (-opt=0) does a lot of recursion in runtime.alloc -> runtime.runGC ...
|
I don't think that's necessarily the issue here, although highly recursive types don't play nicely with the garbage collector. However, building with |
Did I do it correctly? |
|
@dgryski could you elaborate on "don't play nicely..."? is this the address seems so perfectly aligned that seems as if it hit an unmapped stack guard page or something: 0x141000000, or it chased a pointer to some forbidden area.
|
Using a minimal modification to macro.go to not rely on anon funcs or closures. Panic is upon first evaluation of a macro. The problem is earlier, during parsing: I think the global macro map never gets properly populated, but it is also not empty (since that would more gracefully fail). If I understand @dgryski correctly, the above shows that there is a GC issue? Which is then further obscured by compiler optimisations; the above difference doesnt show when leaving |
Perhaps experiment with how you init that map https://github.com/deosjr/whistle/blob/main/lisp/macro.go#L13-L31 Perhaps try an |
@deadprogram I've been investigating this issue by trying to create a minimal program to replicate the error. Interestingly, adding a debugging fmt.Printf line seems to cause the tinygo compiler to crash. Here is the code that causes the crash:
|
@deadprogram this change fixes the issue with whistle (at least for the examples/datalog.lisp case) awmorgan/whistle@e75b728 the issue has something to do with running the initialization before main. |
Thank you @awmorgan , took over those changes in deosjr/whistle@2a80ffc |
Trying to get the Whistle compiler to run under TinyGo. Seems like a possible problem related to reflection?
Please see deosjr/whistle#11
The text was updated successfully, but these errors were encountered: