-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
SIGSEGV Segmentation fault when loading data URIs using import
#44438
Comments
thank you for filing the issue @manen ! I get the mentioned
it will eventually fail as you will run out of memory, as
I would imagine |
@dnalborczyk thanks for the response!
i only tested it in the repl, i don't know if it would reproduce in a script. sadly i'm not near my computer so i can't confirm.
wouldn't garbage collection take care of this? besides, i don't think that's the case because i originally stumbled upon this issue while trying to load the also ESM index script for one of my side projects, if the repl allocates a small chunk of memory for modules by default, that would explain it. i'll be sure to test it as soon as i'm near my computer again. |
just to clarify, I meant if you run your code snippet (creating endless modules) in a loop. that failure tho is unrelated to your described
no, every imported module remains in memory. the only thing being collected is any code (with potential side effects) in the top scope of the module which runs when you load a module. but even if your modules contain nothing but top level code with no exports you would run eventually out of memory, because of the module cache creating enough entries to hit the memory limit eventually.
you might be indeed hitting the above linked issues . if the REPL runs in the |
Fixed by #48510. The script in OP can successfully run until out of memory. |
Version
v18.8.0
Platform
Linux manen 5.19.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 17 Aug 2022 13:48:51 +0000 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
node
repl,this will load bigger and bigger modules using
import
, eventually failingHow often does it reproduce? Is there a required condition?
nope. will fail eventually
What is the expected behavior?
counting higher and higher, not failing at any number
What do you see instead?
this code will start counting up, and based on my experience it will fail somewhere around
2800
-3400
.running the
node
repl usinggdb
:Additional information
couldn't test it in raw chromium because
Refused to load the script 'data:text/javascript;charset=utf-8,const a = "";export default a;' because it violates the following Content Security Policy directive: "script-src chrome://resources chrome://test chrome://webui-test 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
tested it in
deno
, it counted really slow, i let it count to ~5000 and it didn't fail.not sure at all, but might be related to #35889, #43083, #44219. (yes i did just look
import sigsegv
up in the open issues)The text was updated successfully, but these errors were encountered: