Pinta 2.2-dev constantly crashing on Windows

Bug #2047920 reported by grofaty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Fix Committed
Undecided
Unassigned

Bug Description

I have downloaded latest Pinta 2-2-dev on Windows 10: https://github.com/PintaProject/Pinta/actions/runs/7378423225/artifacts/1141941547

I get pretty constant crashes of Pinta and all of the crashes are completely not-reproducible.

What I see:
1. Just do something in Pinta.
2. Suddenly without any reason, Pinta just closes down.

I even started Pinta from cmd and no error is displayed when crash appears.

It is currently pretty annoying to use Pinta 2.2-dev on Windows, because I never know when I will lose some pictures.

Sorry, I just can't reproduce any of the issue and error is displayed of any kind.

Revision history for this message
grofaty (grofaty) wrote :

The last time crash appeared:
a) In Pinta I have pressed CTRL+W to close image, but Pinta just closed down without any error.

Revision history for this message
grofaty (grofaty) wrote :

Another crash:
b) Pressed CTRL+ALT+V to paste in another image and Pinta just closed down.

Revision history for this message
Cameron White (cameronwhite91) wrote :

I've hit (and eventually fixed) a couple issues like this before - generally it's from some issue in the C# bindings for GTK that causes a crash eventually. It's not exactly Windows specific, but often the crashes appear much more reliably there.

I had some debugging code that runs the garbage collector more frequently (https://github.com/PintaProject/Pinta/blob/master/Pinta/Main.cs#L100) which can make some types of issues appear much sooner after the original action that triggered them. Would it be useful to expose that behind some command line switch or environment variable if you're not compiling from source?

Revision history for this message
grofaty (grofaty) wrote :

Sure, what ever makes easier to debug this crashing problem. If I understand correctly, debugging is saving debug info to console or some log file or something, isn't it? When crash appears, I could just copy the debug info for further diagnoses.

May I suggest to mark this bug as Pinta 2.2 milestone, because frequent crashing will turn away users from using Pinta.

Revision history for this message
grofaty (grofaty) wrote :

Another crash:
c) Opened Pinta, pasted some image, that I needed for reference what was at the moment of screenshot visible on screen. Then I haven't performed and action for a while, clicked on Pinta and then clicked on some other tool and Pinta disappeared.

Revision history for this message
Cameron White (cameronwhite91) wrote :

From https://github.com/PintaProject/Pinta/discussions/654#discussioncomment-8013710, you might also be able to get some error messages from the Windows event viewer?

Changed in pinta:
milestone: none → 2.2
Revision history for this message
Cameron White (cameronwhite91) wrote :

I've added a "--debug" command line option in https://github.com/PintaProject/Pinta/commit/13ebeda256fb5d9241374498fceaaeb3369b98c6 which might help make the crashes more reproducible

Revision history for this message
grofaty (grofaty) wrote :

I have downloaded latest Pinta 2.2-dev from master repository https://github.com/PintaProject/Pinta/actions/runs/7418394253/artifacts/1149268867

1. On Windows 10 I have started Pinta from cmd using command: Pinta.exe --debug
2. Playing around. The last thing I did is using Rectangle object multiple times and then Pinta just disappeared.
3a) Looked at the cmd and there is no output in cmd.
3b) I also can't see any file created since started the Pinta.

Note: Bellow command: dir /A-D /OD /S | find "2024"
- switch: /A-D dislpay only files wihout directories
- switch: /OD display files sorted by modified time
- switch: /S display all files including subdirectories
- switch: /find "2024" in output I am searching for files created in current year.

C:\Programs\Pinta\bin>dir /A-D /OD /S | find "2024"
01/01/2024 11:36 60.798 libwinpthread-1.dll
05/01/2024 05:35 12.596 Pinta.Resources.pdb
05/01/2024 05:35 30.208 Pinta.Resources.dll
05/01/2024 05:35 35.949 Pinta.Resources.deps.json
05/01/2024 05:35 156.684 Pinta.Core.pdb
05/01/2024 05:35 40.543 Pinta.Core.deps.json
05/01/2024 05:35 20.108 Pinta.Gui.Addins.pdb
05/01/2024 05:35 36.864 Pinta.Gui.Addins.dll
05/01/2024 05:35 411.648 Pinta.Core.dll
05/01/2024 05:35 100.101 Pinta.Gui.Addins.deps.json
05/01/2024 05:35 41.229 Pinta.Effects.deps.json
05/01/2024 05:35 37.212 Pinta.Gui.Widgets.pdb
05/01/2024 05:35 57.112 Pinta.Tools.pdb
05/01/2024 05:35 90.112 Pinta.Gui.Widgets.dll
05/01/2024 05:35 133.632 Pinta.Tools.dll
05/01/2024 05:35 40.850 Pinta.Gui.Widgets.deps.json
05/01/2024 05:35 136.704 Pinta.Effects.dll
05/01/2024 05:35 63.116 Pinta.Effects.pdb
05/01/2024 05:35 14.824 Pinta.Docking.pdb
05/01/2024 05:35 40.885 Pinta.Docking.deps.json
05/01/2024 05:35 13.824 Pinta.Docking.dll
05/01/2024 05:35 40.875 Pinta.Tools.deps.json
05/01/2024 05:35 124.928 Pinta.dll
05/01/2024 05:35 46.728 Pinta.pdb
05/01/2024 05:35 150.528 Pinta.exe
05/01/2024 05:35 98.711 Pinta.deps.json
05/01/2024 05:35 371 Pinta.runtimeconfig.json

Any help how to send debug info, would be much appreciated.

Revision history for this message
Cameron White (cameronwhite91) wrote :

If you open the "Event Viewer" program, are you able to find any logs from Pinta? From the discussion thread on Github, the user there was able to find some stack traces there.

Revision history for this message
grofaty (grofaty) wrote :
Download full text (15.9 KiB)

I have searched the Event Viewer | Windows Logs | Application and yesterday I have two errors.

EVENT 2024-05-01 10:54:29 Source: .NET Runtime

Application: Pinta.exe
CoreCLR Version: 8.0.23.53103
.NET Version: 8.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
   at Gio.Internal.Application.Run(IntPtr, Int32, System.String[])
   at Gio.Internal.Application.Run(IntPtr, Int32, System.String[])
   at Gio.Application.Run(Int32, System.String[])
   at Gio.Application.RunWithSynchronizationContext(System.String[])
   at Pinta.MainClass.OpenMainWindow(Int32, System.Collections.Generic.IEnumerable`1<System.String>, Boolean)
   at Pinta.MainClass+<>c.<Main>b__0_1(Int32, System.String[], Boolean)
   at System.CommandLine.Handler+<>c__DisplayClass4_0`3[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<SetHandler>b__0(System.CommandLine.Invocation.InvocationContext)
   at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(System.CommandLine.Invocation.InvocationContext)
   at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_0+<<BuildInvocationChain>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_0+<<BuildInvocationChain>b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<BuildInvocationChain>b__0>d ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_0+<<BuildInvocationChain>b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<BuildInvocationChain>b__0>d ByRef)
   at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_0.<BuildInvocationChain>b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_2.<BuildInvocationChain>b__3(System.CommandLine.Invocation.InvocationContext)
   at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass17_0+<<UseParseErrorReporting>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass17_0+<<UseParseErrorReporting>b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseParseErrorReporting>b__0>d ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass17_0+<<UseParseErrorReporting>b__0>d, System.CommandLine, Version=2.0.0.0, Cultur...

Revision history for this message
grofaty (grofaty) wrote :

Today I have started Pinta and did not work with it yet. Then I have noticed there is no Pinta window anymore. I have looked at the Event Viewer and the following event appeared:

Faulting application name: Pinta.exe, version: 2.2.0.0, time stamp: 0x65410000
Faulting module name: libglib-2.0-0.dll, version: 2.78.3.0, time stamp: 0x6571a073
Exception code: 0x40000015
Fault offset: 0x00000000000b9c05
Faulting process id: 0x5494
Faulting application start time: 0x01da41f85a51e5b8
Faulting application path: C:\Programs\Pinta\bin\Pinta.exe
Faulting module path: C:\Programs\Pinta\bin\libglib-2.0-0.dll
Report Id: d7a40e4d-810a-4db8-a8e5-765d07ea3257
Faulting package full name:
Faulting package-relative application ID:

Revision history for this message
grofaty (grofaty) wrote :

Crash again... and this time there are two events in Event Monitor. I clicked on "Rectangle Select", then "Eclipse Select" and "Lasso Select" and crash appeared.

EVENT Source: .Net Runtime

Application: Pinta.exe
CoreCLR Version: 8.0.23.53103
.NET Version: 8.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
   at GObject.Internal.Object.RemoveToggleRef(IntPtr, GObject.Internal.ToggleNotify, IntPtr)
   at GObject.Internal.Object.RemoveToggleRef(IntPtr, GObject.Internal.ToggleNotify, IntPtr)
   at GObject.Internal.ObjectMapper.Unmap(IntPtr)
   at GObject.Internal.ObjectHandle.ReleaseHandle()
   at System.Runtime.InteropServices.SafeHandle.InternalRelease(Boolean)
   at System.Runtime.InteropServices.SafeHandle.Finalize()

EVENT Source: Application
Faulting application name: Pinta.exe, version: 2.2.0.0, time stamp: 0x65410000
Faulting module name: coreclr.dll, version: 8.0.23.53103, time stamp: 0x65411660
Exception code: 0xc0000005
Fault offset: 0x00000000001e337a
Faulting process id: 0x5538
Faulting application start time: 0x01da42002702103f
Faulting application path: C:\Programs\Pinta\bin\Pinta.exe
Faulting module path: C:\Programs\Pinta\bin\coreclr.dll
Report Id: abdccb73-9c2d-409a-8d87-54a47dedb904
Faulting package full name:
Faulting package-relative application ID:

Revision history for this message
grofaty (grofaty) wrote :

I started Pinta and pointed mouse (did not click, because I needed exact names from help tip for previous report) to "Rectangle Select", then "Eclipse Select" and when pointing to "Lasso Select" and crash appeared. Pinat was opened only a few second and crashed without any action other then pointing mouse to tools icons.

EVENT Source: .Net Runtime

Application: Pinta.exe
CoreCLR Version: 8.0.23.53103
.NET Version: 8.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
   at GObject.Internal.Object.RemoveToggleRef(IntPtr, GObject.Internal.ToggleNotify, IntPtr)
   at GObject.Internal.Object.RemoveToggleRef(IntPtr, GObject.Internal.ToggleNotify, IntPtr)
   at GObject.Internal.ObjectMapper+ToggleRef.Dispose()
   at GObject.Internal.ObjectMapper.Unmap(IntPtr)
   at GObject.Internal.ObjectHandle.ReleaseHandle()
   at System.Runtime.InteropServices.SafeHandle.InternalRelease(Boolean)
   at System.Runtime.InteropServices.SafeHandle.Finalize()

EVENT Source: Application Error
Faulting application name: Pinta.exe, version: 2.2.0.0, time stamp: 0x65410000
Faulting module name: coreclr.dll, version: 8.0.23.53103, time stamp: 0x65411660
Exception code: 0xc0000005
Fault offset: 0x00000000001e337a
Faulting process id: 0x50c0
Faulting application start time: 0x01da420540a3be34
Faulting application path: C:\Programs\Pinta\bin\Pinta.exe
Faulting module path: C:\Programs\Pinta\bin\coreclr.dll
Report Id: 42e3589b-8b78-4ea4-8c21-14b8f2ad68e2
Faulting package full name:
Faulting package-relative application ID:

Revision history for this message
grofaty (grofaty) wrote :

Crashed again few minutes after start. It looks the same error in last three reports.

EVENT Source: .Net Runtime

Application: Pinta.exe
CoreCLR Version: 8.0.23.53103
.NET Version: 8.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
   at GObject.Internal.Object.RemoveToggleRef(IntPtr, GObject.Internal.ToggleNotify, IntPtr)
   at GObject.Internal.Object.RemoveToggleRef(IntPtr, GObject.Internal.ToggleNotify, IntPtr)
   at GObject.Internal.ObjectMapper+ToggleRef.Dispose()
   at GObject.Internal.ObjectMapper.Unmap(IntPtr)
   at GObject.Internal.ObjectHandle.ReleaseHandle()
   at System.Runtime.InteropServices.SafeHandle.InternalRelease(Boolean)
   at System.Runtime.InteropServices.SafeHandle.Finalize()

EVENT Source: Application Error
Faulting application name: Pinta.exe, version: 2.2.0.0, time stamp: 0x65410000
Faulting module name: coreclr.dll, version: 8.0.23.53103, time stamp: 0x65411660
Exception code: 0xc0000005
Fault offset: 0x00000000001e337a
Faulting process id: 0xe0
Faulting application start time: 0x01da42062ffd04d7
Faulting application path: C:\Programs\Pinta\bin\Pinta.exe
Faulting module path: C:\Programs\Pinta\bin\coreclr.dll
Report Id: 0db41809-4246-45b7-8133-24230ac678d4
Faulting package full name:
Faulting package-relative application ID:

Revision history for this message
Cameron White (cameronwhite91) wrote :

Thanks! There is definitely some sort of memory corruption in the gir.core GTK bindings, or in our own manual GTK bindings in Pinta.

I haven't had much luck reproducing this on my Windows machine yet, which is weird given how frequent it seems for you and the bug reporter on Github

Revision history for this message
grofaty (grofaty) wrote :

I get crash with "coreclr.dll" very often. Probably no need to paste the same logs to this bug tracker, because I can't see anything new.

Revision history for this message
grofaty (grofaty) wrote :

Because of so frequent crashes like every few minutes, I was forced to downgrade on Windows back to Pinta 2.1.1, so I can't give any feedback at the moment for Pinta/Windows.

Maybe related to this issue (garbage collector error). Today I have downloaded latest Pinta 2.2-dev from master repository: https://github.com/PintaProject/Pinta/actions/runs/7523870398/artifacts/1168806389 and after few seconds Pinta crashed on Ubuntu 23.10. In terminal:
==============
Unhandled exception. System.Exception: Could not toggle reference to strong. It is garbage collected.
   at GObject.Internal.ObjectMapper.ToggleRef.ToggleReference(IntPtr data, IntPtr object, Boolean isLastRef)
Aborted (core dumped)
==============
I am not able to reproduce a problem.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Also mentioned on the GitHub bug report - there is a new release of the 'gobject' library which has some improvements that maybe could fix this issue.
Could you try the latest Windows build if you have a chance? (https://github.com/PintaProject/Pinta/issues/674#issuecomment-2028469540)

Revision history for this message
grofaty (grofaty) wrote :

I downloaded Pinta from your link tested it a lot, like opening a new image, coping, draw line, etc and after about 5 min application just disappeared as in January's version this year. Problem still remains.

Revision history for this message
Cameron White (cameronwhite91) wrote :

OK, thanks for testing. I've still been unable to hit this, but I'll keep trying..

Revision history for this message
James Carroll (james-carroll) wrote :

I've done about 10 minutes of testing on the Windows branch and for me this crash occured during the File > Save as operations (and also resulted in https://github.com/PintaProject/Pinta/issues/766 being noticed, whether that's related or not I wouldn't know though).

Revision history for this message
Cameron White (cameronwhite91) wrote :
Changed in pinta:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.