Comments (7)
bugging intensifies
edit: For the record, the weird behavior turned out to be caused by unrelated buffering errors, but this amount of leakage still makes me uncomfortable.
from term.
I'm not familiar with Windows debugging tools, so I had a really "fun" time reproing this on Windows 10. I wasn't able to get UMDH to work, so I followed https://blogs.technet.microsoft.com/yongrhee/2011/12/19/how-to-troubleshoot-a-handle-leak/ .
Condensed steps I took, not all of which I'm sure are necessary:
- Install Debugging Tools for Windows following https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/ .
- Checkout and build https://github.com/facebookincubator/fastmod, which uses
term
for colored output. - Launch Application Verifier (installed via Debugging Tools for Windows). Enable "Basics" for fastmod.exe by pressing Ctrl-A, navigating to
fastmod\target\debug\fastmod.exe
, and then making sure "Basics" is checked in the right pane of Application Verifier. - From fastmod's root directory, run
target\debug\fastmod.exe fn fun
. It's important to use cmd.exe and not bash or something, because otherwise aTerminfoTerminal
will get created instead of the Windows-specific one. - Start windbg (cmd-r windbg) and use File > Attach to Process to attach to fastmod.exe.
- In windbg, run
!htrace -snapshot
and theng
. - In fastmod, press
n
to reject the first change. - In windbg, select Break from the Debug Menu and then run
!htrace -diff
. Note that there are about 2 outstanding handles since the last snapshot, indicating a leak. Rung
to resumefastmod
. - Repeat steps 7 and 8 a few times and note that the number of outstanding handles grows.
I have a local patch that creates a wrapper struct that calls CloseHandle
and stops the number of outstanding handles from growing, as suggested in the original issue. I hope to send a PR sometime in the near future. The irritating thing about patching this is that auto-dereferencing for the wrapper I wrote didn't quite work (perhaps because HANDLE
is a raw pointer?), so I had to write *handle
instead of handle
everywhere.
from term.
If @retep998 doesn't beat me to it, I'll get around to fixing this after labor day (thesis deadline).
from term.
Is there any news about this?
from term.
Other than it completely fell off my radar? No, sorry. I'll try to fix it tomorrow. If I don't fix it in a few days, please bug me.
from term.
Any updates on this? I'm seeing some weird behavior on windows, and it'd be nice to eliminate this as the cause.
from term.
I'm unlikely to get around to fixing this any time soon as I don't have access to a windows machine and debugging with wine is a real pain. If anyone has a Windows machine, I'd be happy to review a patch.
from term.
Related Issues (20)
- Please relase a new version HOT 3
- Support parsing termcap HOT 11
- Check isatty == false before coloring HOT 11
- tag version v0.4.0? HOT 2
- How to fall back on std::io::stderr() if term::stderr() fails? HOT 8
- Better MSYS2 support HOT 14
- WinConsole's tty check is inaccurate HOT 1
- better support for multithreaded programs HOT 9
- Use `el` not `dl` to erase a line?
- How to store and pass around `Terminal` of any type. HOT 3
- `Terminal` should probably buffer
- panic with operation not supported by the terminal while libterm works fine HOT 3
- Term crashes on FreeBSD HOT 7
- No output to stdout when no TTY attached in Docker container HOT 2
- term::stdout() returns None unexpectedly HOT 3
- terminfo problem while using rogcat HOT 2
- Write plain text when running under a start/stop daemon like systemd ?
- [LFM] Looking For Maintainer HOT 11
- Last release was in February 2018 HOT 1
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 term.