Giter Site home page Giter Site logo

Comments (19)

cplotts avatar cplotts commented on May 17, 2024 1

https://github.com/cplotts/snoopwpf/compare/master...tiesmaster:88/investigate?expand=1

Ooooh. Interesting. Maybe we missed something here. I'll look into this.

Your bad news sounds like good news for you. lol. :)

from snoopwpf.

alhalama avatar alhalama commented on May 17, 2024 1

I don't believe LoadWindowPlacement is actually relevant to the issue in this case since it also happened when the settings weren't present on the machine. LoadWindowPlacement seems to just give us an idea of the time frame base don the call stack provided since it happens in OnSourceInitialized which is before the window is activated/shown for the first time.

The actual exception happens within CriticalHandleWMGetobject which has to do with UI Automation and seems to happen in response to the Window placement whether set explicitly by Snoop or not. To better understand what is happening it would still be useful to see the missing frames from the call stack where "[30+ frames]" is present.

Note that I am assuming that the NullReferenceException that you are seeing in the debugger is the same as what was logged in the event viewer. If that isn't the case, then there may still be something else happening.

If the issue comes back, maybe you want to try to get a memory dump (See What is a dump, and how do I create one? for how to create a dump) when it happens and share it and I can take a look.

On debugging, you may want to try using Visual Studio to launch the Snoop executable (by opening the .exe in Visual Studio) in debug mode with it set to break on on thrown exceptions including Win32 exceptions.

from snoopwpf.

batzen avatar batzen commented on May 17, 2024

There should be two eventlog entries. One in System and one in Software.
The one you attached does only contain exception name.
If there is nothing you could try to start snoop with a debugger attached and try to extract some information that way.

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

@batzen Thnx for the swift reply!

I just started to continue the investigation, and wanted fresh entries in the event viewer, for easy searching, and now snoop is showing up straight away 😌

I guess reinstalling, and turning off Windows and starting it again after the weekend did its trick. Again, thnx for the help.

from snoopwpf.

cplotts avatar cplotts commented on May 17, 2024

Glad it finally worked for you @tiesmaster. Some people were reporting issues with Windows 10 blocking Snoop's files (#76) ... I wonder if it was that. However, restarting your machine shouldn't have fixed that issue ... I believe most people had to manually go unblock the files.

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

Indeed, that cannot be the case ;)

I thought the rebooting fixed the issue (for good), but it comes back (now and again). I just tried starting Snoop with the debugger, and that gave an interesting stack trace:

>	PresentationCore.dll!System.Windows.Interop.HwndTarget.CriticalHandleWMGetobject(System.IntPtr wparam, System.IntPtr lparam, System.Windows.Media.Visual root, System.IntPtr handle)	Unknown	Non-user code. Skipped loading symbols.
 	PresentationCore.dll!System.Windows.Interop.HwndTarget.HandleMessage(int msg, System.IntPtr wparam, System.IntPtr lparam)	Unknown	Non-user code. Skipped loading symbols.
        [30+ frames]
 	snoop.exe!Snoop.SnoopWindowUtils.LoadWindowPlacement(System.Windows.Window window, Snoop.WINDOWPLACEMENT? windowPlacement)	Unknown	Non-user code. Skipped loading symbols.
 	snoop.exe!Snoop.AppChooser.OnSourceInitialized(System.EventArgs e)	Unknown	Non-user code. Skipped loading symbols.
        [20+ frames]
 	PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window)	Unknown	Non-user code. Skipped loading symbols.
 	snoop.exe!Snoop.App.Main()	Unknown	Non-user code. Skipped loading symbols.

I can't run the project from Visual Studio, since I'm missing the Windows 8.1 SDK, though the stack trace revealed to me that placing the Snoop toolbar at the previous location failed (and I have a 3 monitor setup, including a laptop display. So it must be related to that. I'm now going to find out if I can locate the place where Snoop stores it's placement, and what happens if I delete that ;)

Update
Removed the user settings from C:\Users\...\AppData\Local\Cory_Plotts\Snoop.exe_Url_svr3ea1awr4rmikpujw0xmksr1tpt4kp\2.9.0.0, but that didn't fix the problem. It just removed the 2 snoop.exe stack frames in the middle of the stack trace . Any idea what can be going on here?

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

Alright, I checked the building instructions, and saw it should build out of the box, so spend some time getting it working on my machine (latest Windows 10 machine), and I needed to do this. I'm guessing you're running Windows 8?

Anyhow, that builds the solution, and actually runs snoop without the exception, so bad news is: I cannot investigate this further, good news: I can continue debugging my weird issue in our legacy WPF app 😂

from snoopwpf.

jogibear9988 avatar jogibear9988 commented on May 17, 2024

maybe you can debug using dnspy

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

@jogibear9988 Sure. What is dnspy?

from snoopwpf.

alhalama avatar alhalama commented on May 17, 2024

dnSpy is a debugger and assembly editor. There are more details on dnSpy on Github.

from snoopwpf.

alhalama avatar alhalama commented on May 17, 2024

@tiesmaster The CriticalHandleWMGetobject has to do with UI automation and it is would seem that this is happening anytime the window position is set whether it is set by Snoop or not. It might be helpful to see the full call stack including the missing frames.

Is there anything different that you noticed about when it worked versus when it didn't? By any chance did you use a screen reader, touch screen, or something else that would have used UI Automation when it failed?

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

@alhalama Thnx. dnSpy looks really awesome, that's exactly the tool I could have used to investigate this problem. However, snoop is not crashing anymore, at all (so far). I don't have the full stack anymore, so it's a dead end, from that perspective...

As for the background, my laptop has a touch screen, and although I usually don't have the Snoop toolbar on the touch screen monitor, I might have had it the last time I used it...

Funny thing, is that I stumbled upon dnSpy a while ago, so the name already looked familiar. I know I was think: this is really awesome, can be useful in certain situations ;)

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

@alhalama It started crashing for me again (after switching my laptop to use a different screen, a big TV for a demo). I'm debugging the app now, and I'm in SnoopWindowUtils.LoadWindowPlacement(), with the following values. When I press F10 at that point, I throw. Do you see something weird here?

image

from snoopwpf.

batzen avatar batzen commented on May 17, 2024

LoadWindowPlacement should not be able to crash the app as it's wrapped in a try/catch.
What happens if you hit F10 again?

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

Sorry, forgot all about your question. Pressing F10 here, will throw the exception. Indeed, it's really weird that the app crashes, but thinking about it, I think it ends, not crashes, because I don't get a Windows screen like "this app crashes", Snoop just doesn't start up (which is what you'd expect from looking at the code).

Further, the popup from dnSpy about the exception actually talked about "unhandled" exception, so that makes it more curious (but might be related to how dnSpy works, and how it presents stuff to the user, I don't have any experience with dnSpy, obviously). That leads to the thought: this is not a normal CLR exception, but Win32, so that might also influence things...

TL;DR Many mysterious things for me, however, Snoop is starting up again, so can't investigate now 😕

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

@alhalama Alright, it's crashing again 🎉 😉 and I ran procdump to capture the crash, I've uploaded it here.

Happy Hackin'

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

BTW I'm curious to your results (and how you're investigating this ;)). Keep me posted please.

from snoopwpf.

batzen avatar batzen commented on May 17, 2024

Could you try to reproduce your issue with snoop 2.10 or the current source build from the master branch? Your memory dump doesn't even contain snoop in the crash path...

from snoopwpf.

tiesmaster avatar tiesmaster commented on May 17, 2024

Ah, there is a newer version out, didn't noticed that ;) I've installed that one, and it's still breaking there, but in a weirder way 😕 (the main toolbar pops-up, but completely black, and disappears really quickly).

However, it does show up when I build from latest source 🎉 So at this stage, I think it's more related to some weird stuff happening on my machine, and since I'm going to switch jobs in a couple weeks anyhow, and hence, also machines, and also no WPF more, I'm going to close down this issue, to save everyone some time ;)

from snoopwpf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.