Bug 12668 - Using breakpoint results in crash (when empty source loc in pdb)
Summary: Using breakpoint results in crash (when empty source loc in pdb)
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger ()
Version: 4.7.x
Hardware: PC Windows
: --- normal
Target Milestone: 4.8 (async)
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2013-06-13 04:20 UTC by Virgile Bello
Modified: 2013-07-12 10:13 UTC (History)
4 users (show)

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

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Virgile Bello 2013-06-13 04:20:57 UTC
I have a project where my assemblies are processed through Mono.Cecil (simple round-trip, load, edit some IL and save).
My problem is that such assemblies, when debugging with Monodroid, cause problem when setting breakpoints.

More specifically, it works fine if I set breakpoint after the program is running, and I can trace, but if breakpoints are set prior launch, it will fails with this error:

Mono.Android.VisualStudio.MonoAndroidPackage Error: 0 : MonoAndroidDebuggerSession
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.Path.GetFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent(Event e)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()

Considering the callstack and after checking the PDB, it seems that somehow the PDB have some additional sourceloc which are empty strings (probably due to async+Cecil?), and this doesn't play nice when calling Path.GetFullPath("").

Could you avoid calling GetFullPath in case string is "" (empty)?

Thanks!
Comment 2 mho 2013-07-06 00:29:12 UTC
I have an slightly different behavior. If I set a breakpoint prior launch, it will
fails immediately after launch with the error below. When i set no breakpoint the App starts but when I set a breakpoint i got the same error. 

The whole thing doesent happen every time but unfortunately very often.

I use the beta 4.7.11

Loaded assembly: Mono.Android.dll [External]
Loaded assembly: System.Core.dll [External]
Loaded assembly: MonoDroidConstructors [External]
Loaded assembly: System.ServiceModel.dll [External]
Loaded assembly: System.dll [External]
Mono.Android.VisualStudio.MonoAndroidPackage Error: 0 : MonoAndroidDebuggerSession
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.Path.GetFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)
   at Mono.Debugging.Soft.SoftDebuggerSession.GetLocFromType(TypeMirror type, String file, Int32 line, Int32 column, Boolean& genericMethod, Boolean& insideTypeRange)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent(Event e)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()
Mono.Android.VisualStudio.MonoAndroidPackage Error: 0 : MonoToolsSession.OnDebuggerException ()
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.Path.GetFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)
   at Mono.Debugging.Soft.SoftDebuggerSession.GetLocFromType(TypeMirror type, String file, Int32 line, Int32 column, Boolean& genericMethod, Boolean& insideTypeRange)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent(Event e)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.Path.GetFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)
   at Mono.Debugging.Soft.SoftDebuggerSession.GetLocFromType(TypeMirror type, String file, Int32 line, Int32 column, Boolean& genericMethod, Boolean& insideTypeRange)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent(Event e)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()
Mono.AndroidTools.AndroidLogger Verbose: 0 : [D:RunShellCommand]:      3535F1B05B4900EC am broadcast -a mono.android.intent.action.SEPPUKU -c mono.android.intent.category.SEPPUKU.xxx.Android -n xxx.Android/mono.android.Seppuku
The program 'Mono' has exited with code 0 (0x0).
Mono.Android.VisualStudio.MonoAndroidPackage Verbose: 0 : Entering OnTargetExited for: Mono.Android.VisualStudio.MonoAndroidDebuggerSession
In mgmain JNI_OnLoad
Mono.AndroidTools.AndroidLogger Verbose: 0 : -- Start Broadcast - 07/06/2013 06:10:26 (4290.0075ms) --
Mono.AndroidTools.AndroidLogger Verbose: 0 : [INPUT] am broadcast -a mono.android.intent.action.SEPPUKU -c mono.android.intent.category.SEPPUKU.xxx.Android -n xxx.Android/mono.android.Seppuku
Mono.AndroidTools.AndroidLogger Verbose: 0 : [OUTPUT]
Broadcasting: Intent { act=mono.android.intent.action.SEPPUKU cat=[mono.android.intent.category.SEPPUKU.xxx.Android] cmp=xxx.Android/mono.android.Seppuku }
Broadcast completed: result=0
Mono.AndroidTools.AndroidLogger Verbose: 0 : -- End Broadcast --

Thanks and greetings from germany.
Comment 4 narayanp 2013-07-12 10:13:22 UTC
I'm trying to verify this bug, but I'm not sure of the steps. Is there a small sample or test case you could provide that demonstrates the issue?