laverdet / isolated-vm

Secure & isolated JS environments for nodejs
ISC License
2.19k stars 154 forks source link

Free and malloc related issues after upgrade #508

Open ErkoKnoll opened 4 days ago

ErkoKnoll commented 4 days ago

Hi,

I know it's not much to go on, and cannot be reproduce easily, but I just wanted to flag this. We're running untrusted user code using isolated-vm within AWS Lambdas. We recently upgraded isolated-vm from 4.7.2 to 5.0.1 and from Node 18 to Node 20 Lambda runtime and started noticing occasional errors related to memory cleanup or allocations, which seem to be happening at the tail end of the script execution, in the cleanup phase. They are quite infrequent, couple of times per 100k executions or so, so not a massive issue, but seems to indicate a bug in the C++ side of the business.

We have observed following errors:

Unfortunately these native errors don't come with a stack trace, so it is difficult to say in which part the error is originating from, whether it is Node's, V8's or isolated-vm's native code that is causing these errors.