AvalonStudio icon indicating copy to clipboard operation
AvalonStudio copied to clipboard

Crash on "Open Solution"

Open Jedi-Mind-Tricks opened this issue 3 years ago • 12 comments

Environment:

  • Manjaro Linux x86_64, Kernel: 5.8.11-1-MANJARO
  • netcore 3.1
  • Stock AvalonStudio, commit 83364de2b415a66afab113aeda8805679b819fbb (HEAD -> develop, origin/develop, origin/HEAD) Merge: 79e9b682 5be2aa33

To reproduce:

  1. Start Avalon Studio
  2. File -> Open Solution

Result:

  • crash
  • stack trace:
Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path '/run/media/george/HDD\04064'.
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetFiles(String path)
   at Avalonia.Dialogs.ManagedFileChooserSources.<>c.<DefaultGetFileSystemRoots>b__17_0(MountedVolumeInfo x)
   at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Avalonia.Dialogs.ManagedFileChooserSources.DefaultGetFileSystemRoots()
   at Avalonia.Dialogs.ManagedFileChooserSources.DefaultGetAllItems(ManagedFileChooserSources sources)
   at Avalonia.Dialogs.ManagedFileChooserSources.GetAllItems()
   at Avalonia.Dialogs.ManagedFileChooserViewModel.RefreshQuickLinks(ManagedFileChooserSources quickSources)
   at Avalonia.Dialogs.ManagedFileChooserViewModel..ctor(FileSystemDialog dialog, ManagedFileDialogOptions options)
   at Avalonia.Dialogs.ManagedFileDialogExtensions.ManagedSystemDialogImpl`1.Show(SystemDialog d, Window parent, ManagedFileDialogOptions options)
   at Avalonia.Dialogs.ManagedFileDialogExtensions.ManagedSystemDialogImpl`1.ShowFileDialogAsync(FileDialog dialog, Window parent)
   at AvalonStudio.Controls.Standard.SolutionExplorer.SolutionExplorerViewModel.OpenSolution() in /home/george/AvalonStudio/AvalonStudio/AvalonStudio.Controls.Standard/SolutionExplorer/SolutionExplorerViewModel.cs:line 181
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
   at Avalonia.Threading.AvaloniaSynchronizationContext.<>c__DisplayClass8_0.<Post>b__0()
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority)
   at Avalonia.X11.X11Window.<ScheduleInput>b__120_0()
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority)
   at Avalonia.X11.X11PlatformThreading.HandleX11(CancellationToken cancellationToken)
   at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at AvalonStudio.Shell.Shell.StartShellApp[TAppBuilder](TAppBuilder builder, String appName, ShellAppMainDelegate main, String[] args, IFactory layoutFactory) in /home/george/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Shell.cs:line 17
   at AvalonStudio.Program.Main(String[] args) in /home/george/AvalonStudio/AvalonStudio/AvalonStudio/Program.cs:line 32
Aborted (core dumped)

Details: stack trace contain the path '/run/media/george/HDD\04064' '/run/media/george/HDD 64' is a path to my additional HDD. ~But this HDD never had 04064 folder.~ Edited: see below, the directory name was not HDD but HDD 64 with a space.

Jedi-Mind-Tricks avatar Oct 11 '20 14:10 Jedi-Mind-Tricks

I assume that this('\04064') is not a folder, but a part of a name of your HDD. Could you please do ls -l /run/media/george to verify that there is something with naming and better identify problem?

FlaviusHouk avatar Oct 11 '20 14:10 FlaviusHouk

Oh, you're right!

The name is HDD 64 with a space.

Jedi-Mind-Tricks avatar Oct 11 '20 15:10 Jedi-Mind-Tricks

And does cd '/run/media/george/HDD 64' works as well?

FlaviusHouk avatar Oct 11 '20 15:10 FlaviusHouk

And does cd '/run/media/george/HDD 64' works as well?

Yep, no problems with that.

Jedi-Mind-Tricks avatar Oct 11 '20 15:10 Jedi-Mind-Tricks

More info: if I unmount this HDD, open dialog works.

Jedi-Mind-Tricks avatar Oct 11 '20 15:10 Jedi-Mind-Tricks

As for some path with the space (tried both in $HOME and on external partition) everything works fine. So I think there is something with special characters in paths I suppose.

FlaviusHouk avatar Oct 11 '20 15:10 FlaviusHouk

Okay, I reproduced the bug with another device:

  • HDD 64 disk was UNmounted
  • a USB stick which have label with a space (UBUNTU 18) was mounted

Stack trace: Could not find a part of the path '/run/media/george/UBUNTU\04018'. ...

Yeah, path with a space works, but not a Disk Label with a space.

Jedi-Mind-Tricks avatar Oct 11 '20 15:10 Jedi-Mind-Tricks

My guess: it crashes while creating the list of disk drives (on the left side of the Open Dialog).

Jedi-Mind-Tricks avatar Oct 11 '20 15:10 Jedi-Mind-Tricks

I looked through the code for openingn and it looks like that is the bug in Avalonia's managed open file dialog Avalon Studio uses.

FlaviusHouk avatar Oct 11 '20 15:10 FlaviusHouk

Should I open the issue there (AvaloniaUI repo) and close this one then?

Jedi-Mind-Tricks avatar Oct 11 '20 16:10 Jedi-Mind-Tricks

You can open an issue there and paste a link for this issue (to preserve all information). And this issue, as for me, should be closed when Avalon Studio will receive update (new version of Avalonia with fixed issue), but not now when functionality is not working well.

FlaviusHouk avatar Oct 11 '20 16:10 FlaviusHouk

It happens on windows 10 also.

jcbritobr avatar Nov 08 '20 23:11 jcbritobr