This project is read-only.


Fix crash after PC awake from sleep/hibernate


h13Bishop wrote:
How about to fix crash after PC is awake from sleep or hibernate? =)
Faulting application name: DropBoxLinker.exe, version:, time stamp: 0x4e012e53
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4e211319
Exception code: 0xe0434352
Fault offset: 0x0000b9bc
Faulting process id: 0x414
Faulting application start time: 0x01cd8e9f69d34b29
Faulting application path: C:\programs\DropBoxLinker.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: 6c71cfc6-faa8-11e1-ac9a-001fc6e64fd3
Application: DropBoxLinker.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
at System.Windows.Clipboard.CriticalSetDataObject(System.Object, Boolean)
at System.Windows.Clipboard.SetDataInternal(System.String, System.Object)
at System.Windows.Clipboard.SetText(System.String, System.Windows.TextDataFormat)
at System.Windows.Clipboard.SetText(System.String)
at DropBoxLinker.App+<>c__DisplayClass4.b__3()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at DropBoxLinker.App.Main()

file attachments


sersel wrote Sep 10, 2012 at 9:06 PM

Wow, that's very interesting! It seems to me that the problem is associated with Clipboard operating while being not logged in to a user account. This would only appear if the synced content was changed outside, while the PC with DropBox Linker was asleep/hibernated. Could you confirm this? Or the problem is shown regardless of changes? And additionally, does the problem occur every time you wake up your PC from sleep/hibernate, or eventually?

wrote Sep 10, 2012 at 9:07 PM

wrote Sep 10, 2012 at 9:07 PM

wrote Sep 10, 2012 at 10:49 PM

h13Bishop wrote Sep 10, 2012 at 10:49 PM

What do you mean "synced content was changed outside"? If mean that other computer copied some files to public folder when PC that gets error is sleeping then I'm not changing my public folder when error occurs.
This error occurs sometimes but I couldn't determine any dependence. Sometimes right after I'm waking up my PC (can't tell for sure sleep or hibernate), sometimes after I wake up my PC and copy something to clipboard I guess.
A few more logs of error in attachment.

Can I do anything special to track this bug?

sersel wrote Sep 11, 2012 at 12:34 AM

Thank you for the details and the log! I've googled a bit and found an estimated cause of this issue. Thanks to Andrew Smith, we can state that this exception fires on concurrent clipboard operating. Probably, you have some other application that tries to access clipboard the same time DropBox Linker does:

I will try to fix this problem by upgrading clipboard operating functions with try...catch blocks. Thus the failing concurrent access will be safely skipped with the start of the next attempt.

In a day or two I will publish an updated version for you to test it in the real life!

h13Bishop wrote Sep 11, 2012 at 7:47 AM

Thank you. I will be glad to test new version.

sersel wrote Sep 11, 2012 at 12:46 PM

I have published probably fixed version of the application.
Please have a look, whether it solves the crashes.

P.S. Additionally, I have moved to ClickOnce technology for more standardized install/uninstall and automatic updates from CodePlex server.

wrote Sep 20, 2012 at 7:33 PM

wrote Feb 14, 2013 at 12:42 AM

wrote May 16, 2013 at 6:34 AM

wrote May 16, 2013 at 6:34 AM

wrote Jun 14, 2013 at 8:43 AM