Closed andyarvanitis closed 3 years ago
Thanks for the detailed bug report @andyarvanitis
At a high level what is going on is that during our code optimization phase the variable in the following call:
(close-input-port fp$211$534)
is being replaced with an inlined call to the open-input-file
primitive:
(close-input-port (open-input-file dir$208$533))
Obviously not what we want as this prevents the original port from being closed. Let me take a closer look at the optimizer...
Thanks!
Alright, this has been fixed on the master
branch. It would probably be easiest to rebuild from source using cyclone-bootstrap
and then recompile your code using those binaries.
Thanks again for reporting this @andyarvanitis !
Awesome, thanks! I'll try it tonight!
Works great, thanks again
I believe I'm seeing a bug where import files are being opened but never closed during compilation. As a result, I think my code is crashing due to hitting process limits on open files (the macos
ulimit -n
defaults to 256).The initial symptom was simply getting a
'Error: Unable to open file:'
on one of my imports. I modifiedruntime.c
to printfopen
andfclose
debug info:Resulting in:
And I've counted 253 "closing" occurences before the "Unable to open file" error, which seems to jibe with my theory. Bumping up the process limit delays the failure.
I've dug around the codebase a bit, but unfortunately didn't spot any obvious cause. I'd be happy to look more if you have any suspicions, or if you think I'm on the wrong track.