-
Notifications
You must be signed in to change notification settings - Fork 30.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
crash in repl mode by vm async timeout #38503
Comments
It can be reproduced in v16.0.0.
|
@Ayase-252 I don't think so, #38145 is queueMicrotask()-specific and related to domains not catching errors properly, this one is not tied to queueMicrotask() in any way and causes a C++ assertion failure/abort. |
I wrote a test case and inserted some log to backtrace the push and pop operations on async context stack. The possible reason may be as following: IIUC, creating a In this case, a microtask However, I really don't get an idea how to fix it probably. It seems impossible to "clear" all pending microtasks to pop their Related CodeTest case 'use strict';
const common = require('../common');
const ArrayStream = require('../common/arraystream');
const repl = require('repl');
// Refs: https://github.com/nodejs/node/issues/38503
const putIn = new ArrayStream();
const testSuite = repl.start('', putIn);
putIn.run([
'const a = vm.createContext({}, { microtaskMode: \'afterEvaluate\' })',
]);
putIn.run([
// eslint-disable-next-line max-len
'vm.runInContext(\'Promise.resolve().then(() =>{while(1){}})\', a,{ timeout: 5 })',
]);
// it should not abort
testSuite.close();
testSuite.on('close', common.mustCall(() => {})); Output with verbose log on push/pop operation
|
What steps will reproduce the bug?
The text was updated successfully, but these errors were encountered: