Bug 9150 - [PATCH] do not crash at unresolved custom attribute
Summary: [PATCH] do not crash at unresolved custom attribute
Status: CONFIRMED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger (show other bugs)
Version: unspecified
Hardware: PC Linux
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2012-12-28 01:15 UTC by Atsushi Eno
Modified: 2017-09-26 19:12 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
fix (1.38 KB, patch)
2012-12-28 01:15 UTC, Atsushi Eno
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 9150 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Atsushi Eno 2012-12-28 01:15:04 UTC
Created attachment 3138 [details]
fix

I encountered this NIE while debugging my code (which is https://github.com/atsushieno/md-typescript/commit/2e4aa00ea, I added explicit commit rev. IF you ever want to reproduce):

System.NotImplementedException: The requested feature is not implemented.
  at Mono.Debugger.Soft.CustomAttributeDataMirror.Create (Mono.Debugger.Soft.VirtualMachine vm, Mono.Debugger.Soft.CattrInfo[] info) [0x0019e] in /svn/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/CustomAttributeDataMirror.cs:140 
  at Mono.Debugger.Soft.MethodMirror.GetCAttrs (Mono.Debugger.Soft.TypeMirror type, Boolean inherit) [0x00059] in /svn/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodMirror.cs:100 
  at Mono.Debugger.Soft.MethodMirror.GetCustomAttributes (Mono.Debugger.Soft.TypeMirror attributeType, Boolean inherit) [0x00012] in /svn/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/MethodMirror.cs:90 
  at Mono.Debugging.Soft.SoftDebuggerBacktrace.CreateStackFrame (Mono.Debugger.Soft.StackFrame frame, Int32 frameIndex) [0x00278] in /svn/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerBacktrace.cs:176 
  at Mono.Debugging.Soft.SoftDebuggerBacktrace.GetStackFrames (Int32 firstIndex, Int32 lastIndex) [0x00027] in /svn/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerBacktrace.cs:85 
  at Mono.Debugging.Client.Backtrace.GetFrame (Int32 n) [0x00029] in /svn/monodevelop/main/src/core/Mono.Debugging/Mono.Debugging.Client/Backtrace.cs:50 
  at Mono.Debugging.Client.Backtrace..ctor (IBacktrace serverBacktrace) [0x00026] in /svn/monodevelop/main/src/core/Mono.Debugging/Mono.Debugging.Client/Backtrace.cs:26 
  at Mono.Debugging.Soft.SoftDebuggerSession.GetThreadBacktrace (Mono.Debugger.Soft.ThreadMirror thread) [0x00001] in /svn/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:707 
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet (Mono.Debugger.Soft.Event[] es, Boolean dequeuing) [0x002fa] in /svn/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1277 
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet (Mono.Debugger.Soft.EventSet es) [0x00076] in /svn/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1163 
  at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler () [0x00032] in /svn/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1097 

I have no idea why it falls to this condition, but this error tells me that there are some *existing* code that prevents debugging for unnecessary reason. It should ignore those attributes rather than just to crash.

The attached patch fixes (or workarounds) it. The patch was created in monodevelop contrib tree but it is actually for Mono.Debugger.Soft.dll.
Comment 1 Rodrigo Kumpera 2017-07-14 23:42:47 UTC
I made a PR out Atsushi's patch: https://github.com/mono/mono/pull/5214


Zoltan, could you review the PR and close this bug if it's good?
Comment 2 Rodrigo Kumpera 2017-07-18 18:04:35 UTC
Zoltan's comment on the PR:

This just silently hides some attributes without any indication that an error occurred, so I don't think its a good idea.


The bug still exists and we should still address it somehow.