Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

[Crash] COMException in OnClipboardContentChanged (maybe Remote Desktop/RDP/mstsc related?) #379

Open
aziraphale opened this issue Dec 18, 2018 · 5 comments

Comments

@aziraphale
Copy link

Hiya,

First of all, great work on this application! No, it's not perfect in a few areas, but it's incredibly functional and very useful once you figure out the quirks, so for something that appears to have been developed almost entirely in one person's free time, I'm impressed! 😸

Of course, I'm writing this because the program crashed on me yesterday, in a way that was quite annoying, but which I'm hopeful can be fixed nice and easily - perhaps just by adding a try/catch block, I dunno!

The reason it was rather annoying is because the crash was "at random" while processing the queue, so I didn't notice it until quite some time later, and once I did notice it I had to delete and re-add the unfinished blogs in order to get their blog data to be repopulated (which I think is a known bug). Also I don't recall seeing any kind of "this program has crashed" dialog box when it crashed - I just suddenly noticed that TumblThree was no longer running!

Please see the attached Windows Event Viewer saved event files (zipped) for details of the two crashes I experienced. They both seem to be pretty much identical, occurring during the TumblThree.Applications.Controllers.ManagerController.OnClipboardContentChanged method.

I had previously had this application running for quite a while without it crashing, and the only notable difference that I can think of and which could be at all relevant is that at the time of both crashes, I was logged into the PC running TumblThree via Microsoft's Remote Desktop (aka RDP/RDC/mstsc/etc.) from my PC at work (the RDP session was minimised, which is why I didn't immediately notice the crash).

My Remote Desktop session was configured with clipboard sharing enabled, and my completely wild guess is that, at a point where I copied something to the clipboard on my work PC (the Remote Desktop client), RDP synchronised that clipboard content with my home PC (the Remote Desktop host), and then RDP's attempt to write to the clipboard interfered with TumblThree's attempt to read from the clipboard.

Hopefully the actual content of my clipboard isn't relevant, as I couldn't exactly tell you what that would have been! Given what I'm normally doing at work, it's likely to have been either text copied from JetBrains' PhpStorm (which also copies a rich-text version of copied code, so that I can paste code samples complete with colouring into HTML contexts such as emails), or some random image data. I couldn't tell you more accurately than that!

Thanks again for this tool, and good luck fixing this! 😺

@johanneszab
Copy link
Owner

Wow!

First off, thanks a lot for these great bug reports! They are detailed, containing instructions to reproduce the error and logs. Thanks a lot also for gathering all the relevant information and putting it together into this well written issue!

I have to say, I've had notice similar crashes while I was using TumblThree with a local instance of TeamViewer. But the problem was that I couldn't really pinpoint the crash to the correct spot within the code, and the issue seemed to only happen sometimes. Whenever I was using TeamViewer with TumblThree in Visual Studio in debug mode, then of course, nothing ever happened.
Then however I went to the next more important bug in the hope that not too many people would use TumblThree constantly with TeamViewer. But I see that I has to be very annoying if someone uses RDP regularly.

I'll definitely take a look at it, but It probably will not happen within the next two weeks. This year is really chaotic for me. Way too much traveling for my taste, also at work.

But thanks already for creating this issue!

@aziraphale
Copy link
Author

No worries at all about not being able to fix it quickly - if I'm right about what causes this crash, at least I know how to avoid it! :)

Besides, I know what "super busy life" is like 😉 As this is my final week at work this year, I've got tons of work that I'm being expected to do in the next 3 days and it's going to be a close call! (So I probably shouldn't be replying to non-work-related github issues during work hours... 😸)

I'm just glad that I could provide you with a detailed bug report! All too often I've been on the receiving end of unhelpfully-vague reports from colleagues at work so I try to be better than that myself, but even so, sometimes I just don't know what caused it, so all I can do is create a report that at least acknowledges that something bad happened, and hope that the developer(s) have more insight than me (I only recently learnt that Event Viewer contains stack traces of crashed applications - as per my other issue report, I'm not a Windows application developer, so I've never had to look there to debug my own code; plus, most of the code I write ends up running on Linux machines [or the Windows Subsystem for Linux thing, which is a complete godsend for those of us who love the Linux command-line, but prefer a Windows desktop!], so I mostly know how to debug things on Linux 😁).

Thanks again :)

@elipriaulx
Copy link
Contributor

@johanneszab when you tried debugging this were you debugging a debug build or release build? I wonder if a release version with a remote debugger attached would be of use?

I'll try to get onto this this weekend if no one beats me to it. I should be able to RDP to a VM and try to reproduce. I might add some better logging, even if no where uses it yet, just to log global exceptions and such. Maybe anything that causes a crash or ungraceful termination could raise a dialogue and prompt to send an error report. EG capture logs, blog list etc, and send somewhere.

Thoughts?

@johanneszab
Copy link
Owner

@gpriaulx: I think I've had a debug build started within Visual Studio. Then I started a TeamViewer connection on the same machine to a remote host. Over this remote view/connection, I was randomly copying things into the clipboard.

It probably would have been better to simply attach the debugger, true. I was trying to (re-)produce the error this way, because I've had TumblThree locally crashing while I was fixing remote machines over TeamViewer.
At that time I was thinking that maybe the clipboard returns some blobs/objects which I improperly handle, but actually it sounds more like a PInvoke/access(race-condition issue now.

@johanneszab
Copy link
Owner

Yes! Feel free to look into this, You can (re-)write/fix the clipboard monitor as you wish. It's not even my code IIRC.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants