Skip to content
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

fix: CreateFile ERROR_FILE_NOT_FOUND from crashpad handler #116252

Merged
merged 1 commit into from
Feb 10, 2021

Conversation

deepak1556
Copy link
Contributor

Fixes #115874
Fixes #112216

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this could possibly improve. To give some background, the first startup will get a process.env from here:

private patchEnvironment(environmentService: IEnvironmentMainService): IProcessEnvironment {
const instanceEnvironment: IProcessEnvironment = {
VSCODE_IPC_HOOK: environmentService.mainIPCHandle
};
['VSCODE_NLS_CONFIG', 'VSCODE_PORTABLE'].forEach(key => {
const value = process.env[key];
if (typeof value === 'string') {
instanceEnvironment[key] = value;
}
});
Object.assign(process.env, instanceEnvironment);
return instanceEnvironment;
}

This will end up as initialUserEnv into each window as you can see here:

configuration.userEnv = { ...this.initialUserEnv, ...options.userEnv };

The userEnv will overwrite anything and thus probably leading to CHROME_CRASHPAD_PIPE_NAME getting the bad value for the window.

Now, instead of patching the environment in the launch main service, I would rather suggest to fix it centrally where we define the environment for the window itself, here:

load(config: INativeWindowConfiguration, { isReload, disableExtensions }: { isReload?: boolean, disableExtensions?: boolean } = Object.create(null)): void {

We already have code to change the userEnv. I would suggest to overwrite CHROME_CRASHPAD_PIPE_NAME with the value from process somewhere there so that we make sure no other code path of opening a window would hit the same issue.

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that looks better to me. Not sure why we would need to check this:

if (process.env['CHROME_CRASHPAD_PIPE_NAME'] !== config.userEnv['CHROME_CRASHPAD_PIPE_NAME']) {

I think we could always assign the value over, no?

@deepak1556
Copy link
Contributor Author

I think we could always assign the value over, no?

Yup we can, was trying to avoid object.assign when not needed but there is no value here. Fixed.

@deepak1556 deepak1556 enabled auto-merge (squash) February 10, 2021 07:29
@deepak1556 deepak1556 merged commit 3d9f13e into master Feb 10, 2021
@deepak1556 deepak1556 deleted the robo/fix_crashpad_connection branch February 10, 2021 07:39
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants