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

No source/line info for unhandled exceptions displayed on the console. #6158

Closed
mikem8361 opened this issue Jun 16, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@mikem8361
Copy link
Member

When an exception goes unhandled, the exception call stack doesn't include the source line numbers. On the other hand, the source line numbers are included when Exception.ToString() or Exception.StackTrace is called on an exception object.

The fix is going to be interesting (difficult) because all of this happens in native coreclr code (DefaultCatchHandlerExceptionMessageWorker).

@mikem8361 mikem8361 self-assigned this Jun 16, 2016
@mikem8361
Copy link
Member Author

The fix is as simple as removing the code below in Exception.InternalToString() because it is called from the vm native code for unhandled exceptions except for the comment about AppDomains being sandboxed and watson bucket generation. I’m pretty sure that doesn’t apply to xplat but it may still be a problem with coreclr on Windows.

        // Get the current stack trace string.  On CoreCLR we don't bother
        // to try and include file/line-number information because all AppDomains
        // are sandboxed, and so this won't succeed in most (or all) cases.  Therefore the
        // Demand and exception overhead is a waste.
        // We currently have some bugs in watson bucket generation where the SecurityException
        // here causes us to lose saved bucket parameters.  By not even doing the demand
        // we avoid those problems (although there are deep underlying problems that need to
        // be fixed there - relying on this to avoid problems is incomplete and brittle).
        bool fGetFileLineInfo = true;

#if FEATURE_CORECLR
fGetFileLineInfo = false;
#endif
return ToString(fGetFileLineInfo, true);

mikem8361 referenced this issue in mikem8361/coreclr Jun 16, 2016
mikem8361 referenced this issue in dotnet/coreclr Jun 19, 2016
* Fix no source/line info for unhandled exceptions.

Issue #5828.

* Remove comment.
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the 1.1.x milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 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

2 participants