-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Crashes on transform and parse (from assertion/debug failures) #58924
Comments
Could you try to narrow it down? It's almost impossible to fix this without knowing what source files lead to the problem. |
Yes, one thing you could try is to keep deleting files until you've found a culprit. Then when you've narrowed things down to as few files as possible, try to delete as many lines of code as you can. |
I have filtered out the ts files that can cause the above problem and located the code lines in the files that may cause errors. I have provided configuration files, TS source files, and specific error messages in this repository:https://github.com/Roise-yue/tscFuzz |
Thank you so much for finding these @Roise-yue! I'm copying those files into this comment to make it easier to follow - the transform crash is from the use of the
And the other error I haven't been able to verify independently, but I'm pasting it here. // @importHelpers: true
// @target: es5
// @module: commonjs
// @moduleResolution: classic
// @experimentalDecorators: true
// @emitDecoratorMetadata: true
// @filename: external.ts
export * from "./other";
export class A { }
export class B extends A { }
declare var dec: any;
@dec
class C {
method(@dec x: number) { // Error location
}
}
const o = { a: 1 };
const y = { ...o };
const { ...x } = y;
// @filename: other.ts
export const x = 1;
// @filename: script.ts
class A { }
class B extends A { }
declare var dec: any;
@dec
class C {
method(@dec x: number) {
}
}
// @filename: tslib.d.ts
export {} |
I summarized some of the details from the previous comments to help others follow along:
Hope this helps in organizing information for anyone looking into it! |
🔎 Search Terms
Debug Failure,modifierVisitor
🕗 Version & Regression Information
⏯ Playground Link
No response
💻 Code
I did not use tsc to execute any ts programs, but instead used the command "node --max-old-space-size=10240 $(which tsc)" to increase the memory of node.js.
When the version of tsc is between 5.3 and 5.4.5, the debugging error message is in “error message 1 "of "Actual behavior", and when the version of tsc is between 4.7 and 5.2, the debugging error message is in "error message 2" of "Actual behavior". I did not test versions before version 4.7
(The relevant version and configuration information are written in "Additional information about the issue")
🙁 Actual behavior
error message 1:
/usr/lib/node_modules/typescript/lib/tsc.js:118651
throw e;
^
Error: Debug Failure. Use
modifierVisitor
instead.at visitor (/usr/lib/node_modules/typescript/lib/tsc.js:90424:22)
at visitArrayWorker (/usr/lib/node_modules/typescript/lib/tsc.js:85608:49)
at visitNodes2 (/usr/lib/node_modules/typescript/lib/tsc.js:85579:19)
at visitEachChildOfVariableStatement (/usr/lib/node_modules/typescript/lib/tsc.js:86379:7)
at visitEachChild (/usr/lib/node_modules/typescript/lib/tsc.js:85796:33)
at visitVariableStatement (/usr/lib/node_modules/typescript/lib/tsc.js:90639:25)
at visitor (/usr/lib/node_modules/typescript/lib/tsc.js:90435:16)
at visitArrayWorker (/usr/lib/node_modules/typescript/lib/tsc.js:85608:49)
at visitNodes2 (/usr/lib/node_modules/typescript/lib/tsc.js:85579:19)
at visitLexicalEnvironment (/usr/lib/node_modules/typescript/lib/tsc.js:85635:16)
error message 2:
/usr/lib/node_modules/typescript/lib/tsc.js:2099
throw e;
^
Error: Debug Failure. Expected 23 <= 22
at attachFileToDiagnostic (/usr/lib/node_modules/typescript/lib/tsc.js:15670:30)
at Object.attachFileToDiagnostics (/usr/lib/node_modules/typescript/lib/tsc.js:15684:42)
at parseSourceFileWorker (/usr/lib/node_modules/typescript/lib/tsc.js:25347:46)
at Object.parseSourceFile (/usr/lib/node_modules/typescript/lib/tsc.js:25183:26)
at Object.createSourceFile (/usr/lib/node_modules/typescript/lib/tsc.js:25087:29)
at Object.getSourceFile (/usr/lib/node_modules/typescript/lib/tsc.js:95276:44)
at compilerHost.getSourceFile (/usr/lib/node_modules/typescript/lib/tsc.js:101685:53)
at findSourceFileWorker (/usr/lib/node_modules/typescript/lib/tsc.js:97446:29)
at findSourceFile (/usr/lib/node_modules/typescript/lib/tsc.js:97364:26)
at /usr/lib/node_modules/typescript/lib/tsc.js:97318:85
🙂 Expected behavior
Expand the memory of node.js without any errors.
Additional information about the issue
node.js:v20.14.0 and 14.21.3(tried two versions and the result is the same)
tsc:Version 4.7.2-5.4.5
package.json
{
"name": "tscfuzz",
"version": "1.0.0",
"main": "index.js",
"directories": {
"lib": "lib"
},
"scripts": {
"test": "nyc --reporter=text --reporter=lcov mocha "
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.24.7",
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"jshint": "^2.13.6",
"mocha": "^10.4.0",
"nyc": "^15.1.0"
},
"dependencies": {},
"description": ""
}
tsconfig.json
{
"compilerOptions": {
"incremental": true,
"target": "es6",
"lib": ["es2022"],
"module": "commonjs",
"sourceMap": true,
"inlineSourceMap": true,
"inlineSources": true,
"strict": true,
"skipLibCheck": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
}
}
The text was updated successfully, but these errors were encountered: