sourcegit icon indicating copy to clipboard operation
sourcegit copied to clipboard

Frequent crashes on Ubuntu

Open DanielSWolf opened this issue 7 months ago • 10 comments

I'm using the AMD64 AppImage of SourceGit 2025.17 on Ubuntu 24.04.2 LTS. It's working great, but about 3-4 times per day, the application window simply disappears and I have to restart it.

  • There is no error message, neither on crashing nor on restarting.
  • I looked in ~/.config/SourceGit but didn't find any recent logs there.
  • I don't see any pattern as to when SourceGit crashes. It doesn't seem to be triggered by any specific action.

Let me know if there's any additional information I can provide.

DanielSWolf avatar May 16 '25 06:05 DanielSWolf

Did you press the Ctrl+Q or Alt+F4?

love-linger avatar May 16 '25 06:05 love-linger

I'm familiar with common keyboard shortcuts; I don't think I'm repeatedly closing the window by accident.

The application crashes on trivial interactions such as clicking a list or simply bringing the window to the foreground.

DanielSWolf avatar May 16 '25 11:05 DanielSWolf

Recently, my Linux device is not with me. I need someone help me to debug with this issue.

love-linger avatar May 16 '25 12:05 love-linger

Let me know if there's anything I can do.

DanielSWolf avatar May 16 '25 14:05 DanielSWolf

Try to turn off syntax-highlighting. Recently, I've found that sometimes TextMateSharp crashes when parsing the grammar.

love-linger avatar Jun 06 '25 02:06 love-linger

I also have the same problem. It started around January 2025. For me, it only happens on Ubuntu Linux 22.04 LTS, x86, Wayland windowing system. SourceGit on MacOS does not have this problem.

I also cannot see any log messages or crash logs that indicate the problem. There is not even the normal system dialog to say that an app has crashed.

The only thing I see is that the SourceGit window has closed unexpectedly, when all my other applications are still open. So I have to relaunch SourceGit.

Is it possible to add some automatic debug logging in SourceGit? For example, the Settings screen should have an option to enable or disable debug logging, and it should display the file path of these logs. And perhaps add an option to automatically delete logs older than 90 days.

ozmium avatar Jun 17 '25 18:06 ozmium

Crash logs are stored in ${APPDATA_DIR}, and you can open it from the main menu:

Image

love-linger avatar Jun 18 '25 01:06 love-linger

Thanks for letting me know 👍. I was not even aware of this option.

There are some problems with the "Open Data Storage Directory" menu:

  • It's difficult to find it or know about this option, because it's in an unusual place.
  • It's unclear what "Data Storage" actually means. It's vague. Therefore, people will not use it because they are unaware of its functionality.
  • The menu doesn't mention that it contains diagnostic data.

Could you please do the following things?

  • Move the option to the Preferences screen, perhaps in the "General" tab.
  • Rename it to "Open App Settings and Diagnostics Folder"
  • Add a short description to the option, something like this: "Open the directory that contains the SourceGit settings and the diagnostic log data. This path is ${APPDATA_DIR}"
    • (Note: The ${APPDATA_DIR} should resolve to show the real path. For example, on Linux, it should display as ~/.config/SourceGit)

I've attached my crash log from Ubuntu Linux, from ~/.config/SourceGit. But I'm not sure if it's showing the correct data. It also only shows 1 crash, even though I have seen several crashes in the last few months.

crash_2025-03-25_16-15-26.log

File contents:

Crash::: System.IndexOutOfRangeException: Index was outside the bounds of the array.

----------------------------
Version: 8.38.0.0
OS: Unix 6.8.0.52
Framework: .NETCoreApp,Version=v8.0
Source: <unknown>
---------------------------

   at Internal.Runtime.CompilerHelpers.ThrowHelpers.ThrowIndexOutOfRangeException() + 0x20
   at Avalonia.Media.GlyphRun.FindNearestCharacterHit(Int32, Double&) + 0x632
   at Avalonia.Media.GlyphRun.GetCharacterHitFromDistance(Double, Boolean&) + 0x125
   at Avalonia.Media.TextFormatting.TextLineImpl.GetRunCharacterHit(TextRun, Int32, Double) + 0x80
   at Avalonia.Media.TextFormatting.TextLineImpl.GetCharacterHitFromDistance(Double) + 0x39b
   at AvaloniaEdit.Rendering.VisualLine.GetVisualColumnFloor(Point, Boolean, Boolean&) + 0x124
   at AvaloniaEdit.Rendering.VisualLine.GetVisualColumnFloor(Point) + 0x68
   at AvaloniaEdit.Rendering.TextView.GetVisualLineElementFromPosition(Point) + 0x43
   at AvaloniaEdit.Rendering.TextView.OnPointerMoved(PointerEventArgs) + 0x4d
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T) + 0xfb
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs) + 0xd4
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive, RoutedEventArgs) + 0xb6
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs) + 0x3d
   at Avalonia.Input.MouseDevice.MouseMove(IMouseDevice, UInt64, IInputRoot, Point, PointerPointProperties, KeyModifiers, Lazy`1, IInputElement) + 0x184
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs) + 0x231
   at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs) + 0x34
   at Avalonia.Controls.TopLevel.<>c.<HandleInput>b__142_0(Object state) + 0xac
   at Avalonia.Threading.Dispatcher.Send(SendOrPostCallback, Object, Nullable`1) + 0xaf
   at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e) + 0xbd
   at Avalonia.X11.X11Window.DispatchInput(RawInputEventArgs args) + 0x71
   at Avalonia.RawEventGrouper.Dispatch(RawInputEventArgs ev) + 0x5d
   at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken) + 0x284
   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl) + 0xff
   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame) + 0xbd
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken) + 0x10c
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[]) + 0x50
   at SourceGit.App.Main(String[] args) + 0x150

ozmium avatar Jun 18 '25 11:06 ozmium

The README.md already provides a detailed introduction about the Data Storage Directory and its contents. There is no further explanation in the software.

https://github.com/sourcegit-scm/sourcegit/blob/74d77ab704d470e78a1ead8368c10f14fd9eb453/README.md?plain=1#L61-L71

The crash log you uploaded indicates that the crash is related to the AvaloniaEdit component. As I mentioned above, it is currently known that enabling syntax highlighting increases the probability of a crash.

I will keep an eye on the updates of the AvaloniaEdit component.

love-linger avatar Jun 18 '25 12:06 love-linger

The crash log you uploaded indicates that the crash is related to the AvaloniaEdit component. As I mentioned above, it is currently known that enabling syntax highlighting increases the probability of a crash.

The crash exception related to AvaloniaEdit.Rendering.VisualLine should have been fixed after AvaloniaEdit version 11.2.0. Since there are no other crash logs available, this is more likely an external exception at the system/desktop environment level that terminated SourceGit.

gadfly3173 avatar Jun 18 '25 12:06 gadfly3173