Skip to content

made VS not crash on invalid dll reference (BadImageFormatException).…#24452

Merged
heejaechang merged 1 commit intodotnet:dev15.6.xfrom
heejaechang:guardCrash
Jan 27, 2018
Merged

made VS not crash on invalid dll reference (BadImageFormatException).…#24452
heejaechang merged 1 commit intodotnet:dev15.6.xfrom
heejaechang:guardCrash

Conversation

@heejaechang
Copy link
Copy Markdown
Contributor

@heejaechang heejaechang commented Jan 25, 2018

… especially for find all reference cache generation

Customer scenario

User adds dlls as references and a few minutes later, VS crashes.

Bugs this fixes

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/557859

Workarounds, if any

no workaround

Risk

VS will no longer crash, but symbol information from such dlls won't be available for find all references.

Performance impact

N/A

Is this a regression from a previous update?

No

Root cause analysis

Metadata symbol reader can throw BadImageFormatException when dll is in invalid format. but the find all reference didn't guard itself from all exception points but only cover some of them. leaving some code path open to the exception.

How was the bug found?

user feedback, watson

@heejaechang heejaechang requested a review from a team as a code owner January 25, 2018 08:12
@heejaechang
Copy link
Copy Markdown
Contributor Author

@dotnet/roslyn-ide can you take a look? @jinujoseph @Pilchie approval?

Copy link
Copy Markdown
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Fine by me. @tmat might want to chime in here too.

@jasonmalinowski
Copy link
Copy Markdown
Member

@heejaechang @jinujoseph Any reason not to take this in 15.6? Not sure where "low risk reliability improvements" are fitting right now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not just directly call FatalError.ReportWithoutCrash?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also catch IOException?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah. yes. I can do that.

Copy link
Copy Markdown
Member

@tmat tmat Jan 25, 2018

Choose a reason for hiding this comment

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

Do we want to report some user-visible diagnostic (to the error list e.g.), so that the customer can understand why things don't work and perhaps check their invalid assembly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we already did this in other places, and we didn't show anything to users. so unless we want to change that, I will leave that up to @jinujoseph

Copy link
Copy Markdown
Member

@tmat tmat Jan 25, 2018

Choose a reason for hiding this comment

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

Perhaps you can file a follow up issue to do so, to minimize this change. I think there is value in letting users know things are wrong. I am doing this in the EnC implementation now. It helps us prevent "it doesn't work and I don't know what's wrong" kind of bug reports.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ya , file a new issue to improvise this
I think we should take this fix for 15.6 and minimize the change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tmat are you creating UI to show it? or info bar or output window? or diagnostics?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

opened issue - #24459

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a diagnostic that goes to the Error List.

Copy link
Copy Markdown
Member

@tmat tmat Jan 25, 2018

Choose a reason for hiding this comment

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

I'm not sure we will get anything useful here. I'd rather we displayed user visible diagnostic and let the user report an issue to us where they can share the offending assembly (if they are willing to do so).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jinujoseph ?

for now, I will remove NFW from it then.

@heejaechang heejaechang changed the base branch from dev15.7.x to dev15.6.x January 25, 2018 22:47
@heejaechang heejaechang changed the base branch from dev15.6.x to dev15.7.x January 25, 2018 22:47
… especially for find all reference cache generation
@heejaechang heejaechang changed the base branch from dev15.7.x to dev15.6.x January 25, 2018 22:50
@heejaechang
Copy link
Copy Markdown
Contributor Author

rebased to dev15.6.x

@heejaechang
Copy link
Copy Markdown
Contributor Author

@dotnet/roslyn-infrastructure test failure -
https://ci.dot.net/job/dotnet_roslyn/job/dev15.7.x/job/windows_debug_vs-integration_prtest/31/

Roslyn.VisualStudio.IntegrationTests.VisualBasic.BasicLineCommit.CommitOnSave

@heejaechang
Copy link
Copy Markdown
Contributor Author

retest windows_debug_vs-integration_prtest please

@heejaechang heejaechang merged commit cd72d61 into dotnet:dev15.6.x Jan 27, 2018
@jinujoseph
Copy link
Copy Markdown
Contributor

Approved to mergelink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants