fremag / MemoScope.Net

Dump and analyze .Net applications memory ( a gui for WinDbg and ClrMd )
The Unlicense
693 stars 75 forks source link

Object must be a root directory ("C:\") or a drive letter ("C"). #199

Closed totpero closed 7 years ago

totpero commented 7 years ago

When i press Dump Process Now! button i get this error because i don't have permission on system drive (C:)

System.ArgumentException: Object must be a root directory ("C:\") or a drive letter ("C").
   at System.IO.DriveInfo..ctor(String driveName)
   at MemoScope.Modules.Process.ProcessModule.Dump() in C:\projects\memoscope-net\MemoScope\Modules\Process\ProcessModule.cs:line 163
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
MemoScope
    Assembly Version: 0.9.999.212
    Win32 Version: 0.9.999.212
    CodeBase: file:///F:/kit/MemoScope_x64_Release/MemoScope.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
WinFwk
    Assembly Version: 1.0.4.0
    Win32 Version: 1.0.4.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/WinFwk.DLL
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Assembly Version: 2.13.0.0
    Win32 Version: 2.13.0.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Antlr3.Runtime
    Assembly Version: 3.5.0.2
    Win32 Version: 3.5.0.2
    CodeBase: file:///F:/kit/MemoScope_x64_Release/Antlr3.Runtime.DLL
----------------------------------------
EntityFramework
    Assembly Version: 6.0.0.0
    Win32 Version: 6.1.40302.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/EntityFramework.DLL
----------------------------------------
EntityFramework.SqlServer
    Assembly Version: 6.0.0.0
    Win32 Version: 6.1.40302.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/EntityFramework.SqlServer.DLL
----------------------------------------
ExpressionEvaluator
    Assembly Version: 2.0.4.0
    Win32 Version: 2.0.4.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/ExpressionEvaluator.DLL
----------------------------------------
MemoScopeApi
    Assembly Version: 0.9.999.212
    Win32 Version: 0.9.999.212
    CodeBase: file:///F:/kit/MemoScope_x64_Release/MemoScopeApi.DLL
----------------------------------------
Microsoft.Diagnostics.Runtime
    Assembly Version: 0.8.31.0
    Win32 Version: 0.8.31.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/Microsoft.Diagnostics.Runtime.DLL
----------------------------------------
NLog
    Assembly Version: 4.0.0.0
    Win32 Version: 4.4.4534
    CodeBase: file:///F:/kit/MemoScope_x64_Release/NLog.DLL
----------------------------------------
ObjectListView
    Assembly Version: 2.9.1.1072
    Win32 Version: 2.9.1.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/ObjectListView.DLL
----------------------------------------
ParallelExtensionsExtras
    Assembly Version: 1.2.3.0
    Win32 Version: 1.2.3.2
    CodeBase: file:///F:/kit/MemoScope_x64_Release/ParallelExtensionsExtras.DLL
----------------------------------------
ScintillaNET
    Assembly Version: 3.5.10.0
    Win32 Version: 3.5.10.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/ScintillaNET.DLL
----------------------------------------
System.Data.SQLite
    Assembly Version: 1.0.104.0
    Win32 Version: 1.0.104.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/System.Data.SQLite.DLL
----------------------------------------
System.Data.SQLite.EF6
    Assembly Version: 1.0.104.0
    Win32 Version: 1.0.104.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/System.Data.SQLite.EF6.DLL
----------------------------------------
System.Data.SQLite.Linq
    Assembly Version: 1.0.104.0
    Win32 Version: 1.0.104.0
    CodeBase: file:///F:/kit/MemoScope_x64_Release/System.Data.SQLite.Linq.DLL
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1636.0 built by: NETFXREL3STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.ComponentModel.DataAnnotations
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.DataAnnotations/v4.0_4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll
----------------------------------------
System.ServiceModel
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel/v4.0_4.0.0.0__b77a5c561934e089/System.ServiceModel.dll
----------------------------------------
System.Design
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Data.Entity
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.Entity/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Entity.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Windows.Forms.DataVisualization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.DataVisualization/v4.0_4.0.0.0__31bf3856ad364e35/System.Windows.Forms.DataVisualization.dll
----------------------------------------
System.ServiceModel.Internals
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel.Internals/v4.0_4.0.0.0__31bf3856ad364e35/System.ServiceModel.Internals.dll
----------------------------------------
SMDiagnostics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/SMDiagnostics/v4.0_4.0.0.0__b77a5c561934e089/SMDiagnostics.dll
----------------------------------------
Microsoft.VisualStudio.Diagnostics.ServiceModelSink
    Assembly Version: 4.0.0.0
    Win32 Version: 14.0.23107.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Diagnostics.ServiceModelSink/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Diagnostics.ServiceModelSink.dll
----------------------------------------
System.IdentityModel
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.IdentityModel/v4.0_4.0.0.0__b77a5c561934e089/System.IdentityModel.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
fremag commented 7 years ago

Hi,

If I understand, you tried to dump a process in a folder where you don't have write permission. Did the application just crashed or did you get an error dialog box ?

fremag commented 7 years ago

Ok, I could configure MEmoScope so I have the same exception. It happens when trying to dump to a UNC path (\machine\shareddrive) Then call to DriveInfo constructor (to check disk space) throws an exception not caught by MemoScope so it crashed with out any error dialog box.

=> I've added a basic check for UNC paths and won't check disk space => I've added a try/catch too so MemoScope won't crash but display an error dialog box

RahmanM commented 6 years ago

I get the same error with the latest version. Its copied in the C:\MemoScope_x86_Release and the process is a local process.

fremag commented 6 years ago

Do you have a stacktrace or a screenshot with an error message ?