SimpsonGSD / P4EditVS

Simple, lightweight Visual Studio plugin to run various Perforce commands on files, such as checkout and revert. Includes optional auto-checkout feature.
https://marketplace.visualstudio.com/items?itemName=ScottSimpson.p4editvs
MIT License
32 stars 8 forks source link

Crash when using Open in P4V #21

Closed Malrog closed 2 years ago

Malrog commented 2 years ago

As reported on the VS marketplace, I'm getting a crash when I use Open in P4V on a file in my solution (.h or .cpp). P4V opens up fine, and selects the appropriate file but almost immediately after, VS locks up, and about 10s later force closes and reloads the solution. I'm then informed that image

I'm using VS Pro 2019 (Version 16.9.6). It crashes whether I use Open in P4V on the tab context menu, or on the main menu option. I do not have it set up as a keyboard shortcut. I enabled devenv logging, but annoyingly nothing appeared in the log.

Happy to help debug this, if needed.

SimpsonGSD commented 2 years ago

Thanks for reporting here.

At the moment I can't reproduce it in Microsoft Visual Studio Community 2019 Version 16.10.4 using v2.6.1.

Does this occur 100%? Can you try a different solution? Do you have any spaces in your files paths or non-standard ASCII characters? Do all the other commands work fine?

Malrog commented 2 years ago
Malrog commented 2 years ago

I've just checked the Windows Event Viewer and there are two error events generated there when this happens, which I will copy here:, in case it's of any use...

Source: .Net Runtime Event ID: 1026 Level: Error Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException at P4EditVS.Runner.ThreadProc() at P4EditVS.Runner.ThreadProcThunk(System.Object) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Source: Application Error Event ID: 1000 Level: Error Faulting application name: devenv.exe, version: 16.9.31313.79, time stamp: 0x609d6610 Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000 Exception code: 0xc0000005 Fault offset: 0x1f23a27b Faulting process ID: 0x63dc Faulting application start time: 0x01d82cbd5b8e69bc Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe Faulting module path: unknown Report ID: 7e397350-6f92-41b0-a207-6c6e72156187 Faulting package full name: Faulting package-relative application ID:

SimpsonGSD commented 2 years ago

Ok that narrows it down a bit but I'm not clear where the exception is coming from. Any chance you're able to clone the repro, build and run debug in visual studio? There's instructions for running/debugging in the readme.

SimpsonGSD commented 2 years ago

Oh wait, I've just reproduced it. It looks like P4EditVS is still running the command for as long as P4V is open. I'll get this sorted.

Malrog commented 2 years ago

Well done for solving it! How come it wasn't happening for you originally? Was there something different in our environment settings?

SimpsonGSD commented 2 years ago

I think I just tried it and closed P4V straight away before the command timeout kicked in. I don't use that option much so haven't found it until now, thanks for reporting. v2.6.2 is on the release page and will be on marketplace soon. Once it's updated let me know if this issue is fixed for you and I'll close it. Thanks.

Malrog commented 2 years ago

I have updated to v2.6.2 and this has fixed my crashing problem. Thank you very much - that is top notch customer service, right there! 🥇 PS. You should update your Changelog.md. ;)

SimpsonGSD commented 2 years ago

Excellent 👍 I'll close this now. ....yes I always forget to update changelog before I push the new version.. thanks for the reminder 😁