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

EventPipeController ctor potentially throws ArgumentNullException? #12512

Closed
stephentoub opened this issue Apr 17, 2019 · 1 comment
Closed

Comments

@stephentoub
Copy link
Member

EventPipeController's ctor accesses AppContext.BaseDirectory and passes the result to Path.Combine, which will throw an ArgumentNullException if BaseDirectory returns null. BaseDirectory returns the result of GetBaseDirectoryCore, which calls Assembly.GetEntryAssembly()?.Location. GetEntryAssembly may return null, in which case GetBaseDirectoryCore will return null, in which case Path.Combine will throw and the EventPipeController ctor will throw. This will be eaten in the Initialize method by a catch-all block, but it seems like it'd be better not to throw in the first place.

@josalem
Copy link
Contributor

josalem commented Apr 17, 2019

The file-based configuration invocation of EventPipe is meant to silently fail if something goes wrong--as you mentioned, this logic is wrapped in a try/catch/finally block. Since the file-based configuration invocation of Eventpipe is going to be removed entirely in an upcoming change, I'm going to leave this as-is for now.

@josalem josalem closed this as completed Apr 17, 2019
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the 3.0 milestone Jan 31, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants