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

OpenFileDialog undefined behavior on linux-distros #4325

Closed
flexxxxer opened this issue Jul 19, 2020 · 4 comments
Closed

OpenFileDialog undefined behavior on linux-distros #4325

flexxxxer opened this issue Jul 19, 2020 · 4 comments

Comments

@flexxxxer
Copy link
Contributor

OpenFileDialog behavior differs from distro to distro. Tested on 4 different distros on different run configs.

Computer configuration:

  • Ryzen 7 1800x
  • RX 5600 XT
  • 24 gb ram

.net core version: 3.1

App publishing options:

  • Win->Lin: Published from windows to linux
  • Lin->Lin: Published from linux to linux

Publish command for Win->Lin and Lin->Lin: dotnet publish -r linux-x64 -c Release /p:PublishSingleFile=true

App used for testing: link

Testing paths:

  1. File selected
    Expected behavior – OpenFileDialog.ShowAsync() returning array with one item – path to file.
  2. File selected canceled
    Expected behavior - OpenFileDialog.ShowAsync() returning array without items (but array is not nullable)
    Expected program behavior: On button click, shows up a file select dialog. If file is selected the expected behavior is: Shows up a messagebox with file path If canceled: Shows up an empty messagebox.
    If ShowAsync() path returned is null it transforms to string containing null If ShowAsync() returned null array messagebox dialog shows up with exception

Below are testing results

Kernel dumps: googledrive
Doesn't load because of that: link

Ubuntu 20.04

Kernel version: 5.4.0-40-generic
Display Manager: Gnome 3.36.1
Display Server: X11

Ubuntu Screenfetch

app build option file manager opened opened canceled
Win->Lin Nautilus 3.36.1-stable Behavior normal Behavior abnormal (null instead of empty array)
Lin->Lin Nautilus 3.36.1-stable Doesn’t load Doesn't load

Fedora 32 Workstation Edition

Kernel version: 5.6.6-300.fc32.x86_64
Display Manager: Gnome 3.36.1
Display Server: Wayland

Fedora Screenfetch

app build option file manager opened opened canceled
Win->Lin Nautilus 3.36.1-f0a929d Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Nautilus 3.36.1-f0a929d Doesn’t load Doesn't load

OpenSUSE Thumbleweed 20200716

Kernel version: 5.7.7-1-default
Display Manager: KDE
Display Server: X11

OpenSUSE Screenfetch

app build option file manager opened opened canceled
Win->Lin Dolphin 20.04.3 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Dolphin 20.04.3 Doesn’t load Doesn't load
Win->Lin Nautilus 3.36.3-stable Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Nautilus 3.36.3-stable Doesn’t load Doesn't load
Win->Lin Thunar 1.8.15 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Thunar 1.8.15 Doesn’t load Doesn't load

Manjaro 20.0.3 Lysia

Kernel version: 5.7.0, 5.6.16, 5.4.44
Display Manager: KDE
Display Server: X11

Manjaro Screenfetch

app build option file manager kernel version opened opened canceled
Win->Lin Dolphin 20.04.1 5.7.0 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Dolphin 20.04.1 5.7.0 Doesn’t load Doesn't load
Win->Lin Nautilus 3.36.3-efc97f8a9 5.7.0 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Nautilus 3.36.3-efc97f8a9 5.7.0 Doesn’t load Doesn’t load
Win->Lin Thunar 1.8.15 5.7.0 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Thunar 1.8.15 5.7.0 Doesn’t load Doesn’t load
Win->Lin Dolphin 20.04.1 5.6.16 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Dolphin 20.04.1 5.6.16 Doesn’t load Doesn't load
Win->Lin Nautilus 3.36.3-efc97f8a9 5.6.16 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Nautilus 3.36.3-efc97f8a9 5.6.16 Doesn’t load Doesn’t load
Win->Lin Thunar 1.8.15 5.6.16 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Thunar 1.8.15 5.6.16 Doesn’t load Doesn’t load
Win->Lin Dolphin 20.04.1 5.4.44 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Dolphin 20.04.1 5.4.44 Doesn’t load Doesn't load
Win->Lin Nautilus 3.36.3-efc97f8a9 5.4.44 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Nautilus 3.36.3-efc97f8a9 5.4.44 Doesn’t load Doesn’t load
Win->Lin Thunar 1.8.15 5.4.44 Segmentation fault (core dumped) Segmentation fault (core dumped)
Lin->Lin Thunar 1.8.15 5.4.44 Doesn’t load Doesn’t load

Currently on most of the distros OpenFileDialog leads to segfault

@kekekeks
Copy link
Member

kekekeks commented Jul 19, 2020

Segfaults are most likely caused by leaked libfreetype symbols from libSkiaSharp. It used to work until distros have rolled a new libfreetype version, so everything began segfaulting.

Consider using managed file dialogs or switching to 0.10-preview.

Also, SFX-archive publishing isn't a supported by our team, so if the problem doesn't occur without PublishSingleFile=true, it should be reported to dotnet/runtime

@kekekeks
Copy link
Member

You can also try to switch to a newer build of SkiaSharp linux library by adding

<ItemGroup>
    <PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="1.68.3" />
    <PackageReference Include="Avalonia.Skia.Linux.Natives" Version="1.68.0.2" ExcludeAssets="all" />
    <PackageReference Include="SkiaSharp" Version="1.68.3" />
</ItemGroup>

to your project (exactly those lines without changes)

@flexxxxer
Copy link
Contributor Author

Yes, changing SkiaSharp version helped, the application works as on ubuntu, tanks. But the problem with null aray is still there (Windows doesn't have that problem, instead of null array it is empty)

When 0.10-preview will be availble in nuget?

@kekekeks
Copy link
Member

But the problem with null aray is still there

Yes, that inconsistency needs to be fixed.

When 0.10-preview will be availble in nuget?

https://www.nuget.org/packages/Avalonia/0.10.0-preview1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants