Rick Brewster Posted August 23, 2021 Share Posted August 23, 2021 For that second error, it looks like that's just a bug in the plugin. Nothing for me to do there. The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 24, 2021 Share Posted August 24, 2021 Okay, new build pushed. Should fix Shape3D, and the FileType plugins that use OptionBasedLibrary. 1 The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 30, 2021 Share Posted August 30, 2021 BrushFilter actually needs to be blocked for 4.3 and will need an update. See my comment here: 1 The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 1, 2021 Share Posted September 1, 2021 btw @midora are you aware that your OptionBasedLibrary is basically broken because it assumes effect loading is single-threaded? You should probably switch to ConcurrentDictionary for your next update of OBL Name: Graph Paper Type: GraphPaperEffect.GraphPaperEffectPlugin Version: 2.1.0.0 Author: Copyright © toe_head2001 Copyright: Graph Paper Website: http://www.getpaint.net/redirect/plugins.html System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct. at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value) at OptionControls.OptionContext.GetContext(String id, Assembly assembly, String dlcName) at OptionControls.OptionContext.GetContext(String id, Assembly assembly) at OptionBased.Effects.OptionBasedEffect..ctor(Type type, Image image, EffectFlags flags) --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor) at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type) at PaintDotNet.Effects.EffectsCollection.TryGetEffectInfoFromType(Type effectType) in D:\src\pdn\src\PaintDotNet\Effects\EffectsCollection.cs:line 454 1 The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
midora Posted September 1, 2021 Share Posted September 1, 2021 Thanks for the hint Rick. I'm sure there are more flaws in OBL (like just using the old effect flags). Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 3, 2021 Share Posted September 3, 2021 For now it'll work fine because all plugins are now loaded into separate AssemblyLoadContexts, which means each plugin gets its own "copy" of your library. But, in general, just don't make assumptions like that. The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
midora Posted September 3, 2021 Share Posted September 3, 2021 4 hours ago, Rick Brewster said: For now it'll work fine because all plugins are now loaded into separate AssemblyLoadContexts, which means each plugin gets its own "copy" of your library. But, in general, just don't make assumptions like that. I'm pretty sure this was not an assumption 😉. But nobody respects all possible context changes during development. If all plugins are getting a copy it may be more difficult to write a configuration plugin for OBL. May be not. I don't know in the moment. Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 16, 2021 Share Posted September 16, 2021 Three more plugins that weren't working that have been successfully shimmed in the next update: Stickman by @Ego Eram Reputo TR's Morpher Soft Proofing v1.1.0.1 by @null54 1 1 The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
AndrewDavid Posted September 19, 2021 Author Share Posted September 19, 2021 Just installed this one for the first time Move the slider 3 - 5 times and Paint just crashes - no crash file.https://forums.getpaint.net/topic/116703-mathlatex-plugin/ 1 Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 19, 2021 Share Posted September 19, 2021 2 hours ago, AndrewDavid said: Just installed this one for the first time Move the slider 3 - 5 times and Paint just crashes - no crash file.https://forums.getpaint.net/topic/116703-mathlatex-plugin/ I was unable to get that one to crash. I suspect it's just a bug in the plugin. If PDN is just "disappearing" without a crash log, it may be an access violation. You can (maybe) get an actual stack trace and crash log by launching the app with the /setenv:COMPlus_legacyCorruptedStateExceptionsPolicy=1 command-line parameter The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
AndrewDavid Posted September 19, 2021 Author Share Posted September 19, 2021 (edited) I managed to get the trace with the switch. You can read the trace. Paint did not exit, only disappeared. Here's the trace MathLax.zip Edited September 19, 2021 by AndrewDavid Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 19, 2021 Share Posted September 19, 2021 A trace doesn't actually provide information regarding a crash though, it's for performance analysis The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
AndrewDavid Posted September 19, 2021 Author Share Posted September 19, 2021 (edited) So the switch was to try and get it to generate a crash log? If so, it didn't. Edited September 19, 2021 by AndrewDavid Link to comment Share on other sites More sharing options...
null54 Posted September 19, 2021 Share Posted September 19, 2021 1 hour ago, Rick Brewster said: I was unable to get that one to crash. It appears to be somewhat random, I just kept moving the slider until it breaks into the debugger. Buffer.MemoryCopy is throwing an ExecutionEngineException. Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 19, 2021 Share Posted September 19, 2021 48 minutes ago, null54 said: It appears to be somewhat random, I just kept moving the slider until it breaks into the debugger. Buffer.MemoryCopy is throwing an ExecutionEngineException. Do you have a callstack? Even just a screenshot from the debugger, although I think you can select the callstack rows and Copy them too The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
null54 Posted September 19, 2021 Share Posted September 19, 2021 13 minutes ago, Rick Brewster said: Do you have a callstack? PaintDotNet.Base.dll!PaintDotNet.BufferUtil.Copy(void* dst, void* src, ulong byteCount) Line 67 C# PaintDotNet.Core.dll!PaintDotNet.Rendering.SurfaceUtil.RenderImpl<PaintDotNet.Rendering.ISurface<PaintDotNet.ColorBgra>, PaintDotNet.Rendering.ISurface<PaintDotNet.ColorBgra>, PaintDotNet.ColorBgra>(ref PaintDotNet.Rendering.ISurface<PaintDotNet.ColorBgra> src, ref PaintDotNet.Rendering.ISurface<PaintDotNet.ColorBgra> dst, PaintDotNet.Rendering.Point2Int32 renderOffset) Line 187 C# PaintDotNet.Core.dll!PaintDotNet.Rendering.SurfaceUtil.RenderImpl<PaintDotNet.ColorBgra>(PaintDotNet.Rendering.ISurface<PaintDotNet.ColorBgra> src, PaintDotNet.Rendering.ISurface<PaintDotNet.ColorBgra> dst, PaintDotNet.Rendering.Point2Int32 renderOffset) Line 153 C# PaintDotNet.Core.dll!PaintDotNet.Surface.CopySurface(PaintDotNet.Rendering.ISurface<PaintDotNet.ColorBgra> source) Line 985 C# PaintDotNet.Core.dll!PaintDotNet.Surface.CopySurface(PaintDotNet.Surface source) Line 973 C# [External Code] PaintDotNet.Effects.dll!PaintDotNet.Effects.Effect.SetRenderInfo(PaintDotNet.Effects.EffectConfigToken parameters, PaintDotNet.RenderArgs dstArgs, PaintDotNet.RenderArgs srcArgs) Line 195 C# Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 19, 2021 Share Posted September 19, 2021 Okay, that helps. Looks like there's a potential buffer overflow in RenderImpl if the destination surface is taller than the source. Although it looks like a very old bug, so this should also happen in 4.2.16. The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
null54 Posted September 19, 2021 Share Posted September 19, 2021 19 hours ago, Rick Brewster said: Looks like there's a potential buffer overflow in RenderImpl if the destination surface is taller than the source. That may be it, looking up the call stack I see that the destination surface height is 600 and the source surface height is 302. After looking at the 4.2.16 CopySurface implementation in dotPeek, it appears that you missed a srcHeight == dstHeight statement at line 183 in the RenderImpl class. 2 Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 20, 2021 Share Posted September 20, 2021 20 hours ago, null54 said: That may be it, looking up the call stack I see that the destination surface height is 600 and the source surface height is 302. After looking at the 4.2.16 CopySurface implementation in dotPeek, it appears that you missed a srcHeight == dstHeight statement at line 183 in the RenderImpl class. I ended up doing it this way: if (srcStride == dstStride && dstStride == (dstWidth * bytesPerPixel) && srcWidth == dstWidth && renderOffset.IsZero) { int copyHeight = Math.Min(srcHeight, dstHeight); // <-- clip height to shorter of the two ulong bytes = (ulong)copyHeight * (ulong)dstWidth * (ulong)bytesPerPixel; BufferUtil.Copy(dstScan0, srcScan0, bytes); } else The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
BoltBait Posted September 23, 2021 Share Posted September 23, 2021 On 8/13/2021 at 5:58 PM, AndrewDavid said: BoltBait's Charts and Graphs v 0.2 https://forums.getpaint.net/topic/114530-boltbaits-charts-and-graphs-plugin-v02-updated-jun-22-2019/@BoltBait will be providing an updated version Maybe. Does anyone actually use this thing? Anyway, I started working on this last night. I was able to build a new version, but ran into a problem when it was running under Paint.NET: Exception details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. File name: 'System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Windows.Forms.DataVisualization.Charting.ChartImage.DataBind() at System.Windows.Forms.DataVisualization.Charting.ChartPicture.Paint(Graphics graph, Boolean paintTopLevelElementOnly) at System.Windows.Forms.DataVisualization.Charting.ChartImage.GetImage(Single resolution) at System.Windows.Forms.DataVisualization.Charting.Chart.SaveImage(Stream imageStream, ImageFormat format) It looks like part of the .NET 5.0 that Paint.NET runs under is missing? @Rick Brewster? Researching... Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 23, 2021 Share Posted September 23, 2021 That DLL isn't part of the Desktop Runtime. It appears to be part of the ASP.NET Runtime (https://dotnet.microsoft.com/download/dotnet/5.0). What happens if you also install this nuget package? (you did install System.Windows.Forms.DataVisualization into your solution/project via nuget, right?) https://www.nuget.org/packages/System.Data.SqlClient The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
BoltBait Posted September 23, 2021 Share Posted September 23, 2021 20 minutes ago, Rick Brewster said: you did install System.Windows.Forms.DataVisualization into your solution/project via nuget, right? I did this, which allowed me to compile the DLL. 20 minutes ago, Rick Brewster said: What happens if you also install this nuget package? https://www.nuget.org/packages/System.Data.SqlClient I haven't done this yet. It was late, I was frustrated, and was about to delete the entire project... but, decided to go to bed instead. I'll try tonight. 1 Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted September 24, 2021 Share Posted September 24, 2021 9 hours ago, BoltBait said: 10 hours ago, Rick Brewster said: What happens if you also install this nuget package? https://www.nuget.org/packages/System.Data.SqlClient I haven't done this yet. It was late, I was frustrated, and was about to delete the entire project... but, decided to go to bed instead. I'll try tonight. Grrrr.... I tried this. It builds fine, however, I can't get VS to put the necessary DLL files in the build directory. I had to hunt all over the system for them. But, I did get it working. Now to see if I can use ILRepack to combine all 3 DLLs into 1. Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 24, 2021 Share Posted September 24, 2021 I think @toe_head2001 solved something similar based on an Issue that I filed for CodeLab when I did the AssemblyLoadContext stuff The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
BoltBait Posted September 24, 2021 Share Posted September 24, 2021 42 minutes ago, BoltBait said: Now to see if I can use ILRepack to combine all 3 DLLs into 1. Well, that was a fail. Here's the update: https://forums.getpaint.net/topic/114530-boltbaits-charts-and-graphs-plugin-v02-updated-jun-22-2019/?tab=comments#comment-586630 It works on my system, but is 3 separate files. Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Recommended Posts