Comments (9)
The problem with that code is:
Whatever limit we choose, it's wrong...
I tried quite a lot variants to get it right...
If it runs into an SO depends on quite a few factors like the combined width of the nodes, the depth, if a debugger is attached or not...
So even lowering it to 45, to cover your case, won't work for everyone.
Adding a check for indent makes no sense as indent is just depth * 12. ;-)
So i don't know how to solve this issue properly...
from snoopwpf.
Good point, i got distracted by the depth being fixed to the selected node.
Yeah, not great. Perhaps the depth could be configurable, and we might even be able to capture the failing value during SO.
from snoopwpf.
How do you feel about increasing the fixed stack size?
from snoopwpf.
Good point, i got distracted by the depth being fixed to the selected node.
The depth there is relative to the current root node and as the root node gets swapped when reducing it's ok to use a fixed limit there.
we might even be able to capture the failing value during SO.
Most of the time you can't recover from an SO. I think most processes will just crash.
How do you feel about increasing the fixed stack size?
Is that possible?
from snoopwpf.
You can't recover from SO but you might be able to note down the depth at which it happened. This would have to be done without any stack allocations obviously. - also it might be possible in .NET Framework only.
Yeah you can have a post-build step of calling editbin from MSVC tools... https://learn.microsoft.com/en-us/cpp/build/reference/stack?view=msvc-170
from snoopwpf.
You can't recover from SO but you might be able to note down the depth at which it happened. This would have to be done without any stack allocations obviously. - also it might be possible in .NET Framework only.
The problem is that there isn't a fixed size/depth at which the issues happens.
Previously the limit was 100 and worked for years until it started to happen at around 75 even though I have seen it happening at 45, but only when I was debugging with Rider (didn't happen when debugging with Visual Studio).
If 45 would be the magic number I would happily change the limit to that, but it's, sadly, dynamic/random...
Yeah you can have a post-build step of calling editbin from MSVC tools
That won't have any effect for Snoop then, as Snoop injects itself into foreign processes and does not start or own those.
Or would it work for single libraries?
from snoopwpf.
Snoop injects itself into foreign processes
🤦 Of course! Nevermind then. From top of my head I don't have a good answer. I can see if you can estimate the available stack size, but maybe the ultimate solution would be to not rely on nested UI elements.
from snoopwpf.
but maybe the ultimate solution would be to not rely on nested UI elements.
I don't know how to achieve that with a tree view.
Actually that's possible, but would require porting code from one of my private projects.
I have code there that can display hierarchical data in a DataGrid
, just by changing the type of CollectionView
being used (and a custom cell template of course). But it's quite slow when expanding a lot of items at once, as it doesn't do so differential.
Either I port that or find a way to just get rid of element nesting, as you suggested.
I won't have time to try that before my vacation, but will try afterwards (mid July).
from snoopwpf.
OK so we can PInvoke GetCurrentThreadStackLimits
to get the memory range of the stack, and then we can get an address of stackalloc'ed memory in the filter method and check if there is enough memory left in the stack. The threshold will have to be an educated estimate, but it should not be as random as the current limits.
The downside of this is that getting stackalloc to return a pointer requires enabling unsafe code.
Is that a solution you would be interested in exploring?
from snoopwpf.
Related Issues (20)
- tracking options "Highlight Selected Item" not working HOT 2
- Missing TextBlock.LineHeight HOT 4
- This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread. HOT 1
- Light mode broken HOT 22
- Cannot attach the snoop to the .net framework 4.5 single app HOT 8
- Save the Current Preview to file does not work all the time HOT 5
- Crash when try to edit the any Property in snoop HOT 5
- Snoop does not show version HOT 1
- After upgrading my app to .net 8 snoop no longer works with it
- Change key for Ctrl-Shift-MouseOver HOT 4
- Add mention about SignPath Foundation and free code certificate in Readme.md HOT 2
- Feature Request: Option to snoop without activating snoop on global shortcut HOT 5
- Unable to build if ARM MSVC tools not installed HOT 3
- keyboard not working in snoop window HOT 3
- Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.Object,System.EventHandler]' to type 'System.Collections.Hashtable'. HOT 1
- Unable to attached snoop to application: unauthorized access exception HOT 2
- [Feature request] show current version
- [Feature Request] Tab with names in scope for binding parameter ElementName HOT 1
- Unable to compile from source code HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snoopwpf.