-
Notifications
You must be signed in to change notification settings - Fork 285
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
execSync failed without any message #4518
Comments
Hi, thanks for the report. Could you please provide a minimal repro case? Without it is very hard to debug. |
@juanarbol |
3221225477 = 0xC0000005 (access violation). If this child runs independently and through a sample code without any issues but only crashes within your asynchronous code, a probable cause is the arguments. is there a way you can log all the input what was passed to the child? another probable cause is the environment variables. is there a way you can log all the env variables available to the child in both the cases? |
@gireeshpunathil It can only be reproduced on some people's devices, and it may not appear in different projects, so it is certain that it is not a problem with arguments. As for the environment variables you mentioned, can you explain it in more detail? |
It can only be reproduced on some people's devices, and it may not appear in different projects, so it is certain that it is not a problem with arguments. As for the environment variables you mentioned, can you explain it in more detail? |
When I have an asynchronous task, A is the main thread I manually copied the command line into the operating system and it ran successfully and ended correctly, but an exception was thrown in the node child process and there was no information. |
you can print with |
It seems that this exe program does not involve some environmental variables. I also compared it and there is no difference. |
if the child is identical in both external factors such as command line input and the environment, then the crash reason should be debugged using a dump debugging tool. it is not easy to help on dump diagnostics through this channel. if you are familiar with the process, then try that. or else, refer to this manual: https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/getting-started-with-windbg |
thanks,i will have a try. |
i find that the nodeProcessAborted function will return this code,right? i don;t know much about node source code,it may caused by another signal? or what,we think it was broken by another program. |
If I remember, |
const child = this.triggerAsync(() => {
eventGenAbc = createAndStartEvent(parentEvent, 'generate merged abc by es2abc (async)', true);
return childProcess.exec(genAbcCmd, { windowsHide: true });
});
child.on('close', (code: any) => {
if (code === SUCCESS) {
stopEvent(eventGenAbc, true);
this.triggerEndSignal();
this.processAotIfNeeded();
if(this.projectConfig.isBcObfuscatorEnabled){
BytecodeObfuscator.getInstance().execute(this.moduleInfos);
}
return;
}
for (const logData of logDataList) {
this.logger.printError(logData);
}
if (errMsg !== '') {
this.logger.error(`Error Message: ${errMsg}`);
}
const errInfo: LogData = LogDataFactory.newInstance(
ErrorCode.ETS2BUNDLE_EXTERNAL_ES2ABC_EXECUTION_FAILED,
ArkTSErrorDescription,
'Failed to execute es2abc.',
'',
["Please refer to es2abc's error codes."]
);
this.logger.printErrorAndExit(errInfo);
}); public execute(moduleInfos: Map<String, ModuleInfo>): void {
this.collectSkipModuleName();
this.convertAbstractPathToRecordName(moduleInfos);
this.collectAnnotationWhiteList();
fs.writeFileSync(this.configPath, JSON.stringify(this.bytecodeObfuscateConfig, null, 2));
this.generateObfCmd();
this.createWarnings();
const outPutABC: string = this.projectConfig.widgetCompile ? WIDGETS_ABC : MODULES_ABC;
const abcPath = path.join(this.projectConfig.aceModuleBuild, outPutABC);
//backup abc file
fs.copyFileSync(abcPath, this.bytecodeObfuscateConfig.abcFilePath);
const result = childProcess.spawnSync(this.arkConfig.bcObfuscatorPath, this.cmdArgs)
if (result.status !== 0) {
const errInfo: LogData = LogDataFactory.newInstanceFromBytecodeObfuscation(result.stderr.toString(), result.status);
BytecodeObfuscator.instance.logger.printErrorAndExit(errInfo);
}
fs.copyFileSync(this.bytecodeObfuscateConfig.obfAbcFilePath, abcPath);
if (this.projectConfig.widgetCompile) {
return;
}
this.updateAfterObfuscation();
} it is our code. and childProcess.spawnSync return 3221225477 .but if we run it by cmd.it can run correctly.when we run a exe by node,th momery was asigned by operating system,so why it occured? |
Version
No response
Platform
Subsystem
No response
What steps will reproduce the bug?
When I execute an exe program in the close event of an asynchronous task, sometimes the program throws an exception, but I can't get the exception information. I don't know what caused it. Is my process killed?How often does it reproduce? Is there a required condition?
sometimes
What is the expected behavior? Why is that the expected behavior?
Should be executed successfully, or fail with information
What do you see instead?
throw an error,and the error msg is null
Additional information
No response
The text was updated successfully, but these errors were encountered: