-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Outstanding issues for the interpreter on Windows #12396
Comments
Perhaps we need a custom low-level implementation that supports only a subset of C's |
This snippet keeps spawning fibers that do nothing: while true
spawn do
end
p GC.stats.heap_size
sleep 0.05
end On Windows only, sometimes this would commit multiple GBs of memory at once:
This would continue until the GC heap reaches around 32 GB and fails to expand any further, even though the actual memory usage is only slightly above 2 GB. This is currently breaking Interpreted code currently crashes on |
This issue has been mentioned on Crystal Forum. There might be relevant details there: |
These are the biggest issues I could identify after successfully building the interpreter on Windows, in case I forget about them.
EDIT: All the issues in this comment have been resolved, but there are more to follow below.
printf
functions inLibC
are defined inline inlegacy_stdio_definitions.lib
, which means they are inaccessible via the dynamic loader. It seems there is no way to reimplement them in Crystal, since their definitions rely on other internal state that is not exported. Solving this might require definingprintf
as an interpreter primitive so that the compiler's own statically linked versions may be used. However, not using thoseLibC
functions at all is also a possible end goal for Functions that depend on the current C locale #11952.exit
calls theat_exit
handlers, which bail out withCrystal::System.print_error
in case of an unhandled exception, callingexit
produces anundefined reference to `snprintf'
error. Subsequent calls toexit
produceUnhandled case: enum value outside of defined enum members
.String#%
is also subject to this, and the only way to exit a REPL session is by pressing Ctrl+C.bin\crystal i file.cr
) always ends with callingCrystal.exit
, so again the above error appears all the time.print_error
does not help either, as now a different error shows up:at_exit
handler inCrystal::System::FileDescriptor.from_stdio
. It suggests there might be some other bytecode generation issue despite the workaround in the given to-do.Crystal::System::Path.home
:run
fails with 0xC0000135STATUS_DLL_NOT_FOUND
. (This might be related to-Dpreview_dll
rather than the interpreter per se)The text was updated successfully, but these errors were encountered: