FriendsOfCADability/CADability

BSpline deadlock

Closed this issue · 0 comments

dsn27 commented

In rare conditions it seems to be possible that the BSpline is locking itself.
Each lock seems to be waiting for the other one.

https://github.com/SOFAgh/CADability/blob/b31f7bb60e65540e23aadaa2ce0010caeb3cb72c/CADability/BSpline.cs#L89-L93
https://github.com/SOFAgh/CADability/blob/b31f7bb60e65540e23aadaa2ce0010caeb3cb72c/CADability/BSpline.cs#L2933-L2937

[Waiting on lock owned by Thread 43304, double-click or press enter to switch to thread]	

CADability.dll!CADability.GeoObject.BSpline.CADability.GeoObject.ICurve.GetPlane() Line 2935 C#
CADability.dll!CADability.GeoObject.BSpline.CADability.GeoObject.ICurve.Approximate(bool linesOnly, double maxError) Line 3143 C#
CADability.dll!CADability.GeoObject.BSpline.GetCashedApproximation(double precision) Line 96 C#
CADability.dll!CADability.GeoObject.BSpline.PaintTo3D(CADability.IPaintTo3D paintTo3D) Line 1804 C#
CADability.dll!CADability.Model.RecalcDisplayLists(CADability.IPaintTo3D paintTo3D) Line 393 C#
CADability.dll!CADability.ProjectedModel.Paint(CADability.IPaintTo3D paintTo3D) Line 1305 C#
CADability.dll!CADability.ModelView.CADability.IView.OnPaint(CADability.Substitutes.PaintEventArgs e) Line 800 C#
LogiCal.exe!LogiCal.CADModule.CadControl2.CadCanvas.OnPaint(System.Windows.Forms.PaintEventArgs e) Line 321 C#
System.Windows.Forms.dll!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e, short layer) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m) Unknown
DevExpress.Utils.v21.2.dll!DevExpress.XtraEditors.XtraUserControl.BaseWndProc(ref System.Windows.Forms.Message m) Line 569 C#
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
DevExpress.Utils.v21.2.dll!DevExpress.Utils.Drawing.Helpers.Win32SubclasserFactory.Win32Subclasser.SubClassProcInner(System.IntPtr hWnd, System.IntPtr Msg, System.IntPtr wParam, System.IntPtr lParam, System.IntPtr uIdSubclass, System.IntPtr dwRefData) Line 3349 C#
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Unknown
LogiCal.exe!LogiCal.Program.Main() Line 67 C#

[Waiting on lock owned by Thread 3452, double-click or press enter to switch to thread]	

CADability.dll!CADability.GeoObject.BSpline.GetCashedApproximation(double precision) Line 91 C#
CADability.dll!CADability.GeoObject.BSpline.PrepareDisplayList(double precision) Line 1815 C#
CADability.dll!CADability.Model.RecalcGeoObject(object state) Line 143 C#
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980 C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928 C#
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Line 1252 C#
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Line 820 C#