Git Product home page Git Product logo

Comments (7)

Ralith avatar Ralith commented on July 28, 2024 1

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.

swolchok avatar swolchok commented on July 28, 2024 1

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:

  1. Install Debugging Tools for Windows following https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/ .
  2. Checkout and build https://github.com/facebookincubator/fastmod, which uses term for colored output.
  3. 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.
  4. 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 a TerminfoTerminal will get created instead of the Windows-specific one.
  5. Start windbg (cmd-r windbg) and use File > Attach to Process to attach to fastmod.exe.
  6. In windbg, run !htrace -snapshot and then g.
  7. In fastmod, press n to reject the first change.
  8. 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. Run g to resume fastmod.
  9. 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.

Stebalien avatar Stebalien commented on July 28, 2024

If @retep998 doesn't beat me to it, I'll get around to fixing this after labor day (thesis deadline).

from term.

TheNain38 avatar TheNain38 commented on July 28, 2024

Is there any news about this?

from term.

Stebalien avatar Stebalien commented on July 28, 2024

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.

Ralith avatar Ralith commented on July 28, 2024

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.

Stebalien avatar Stebalien commented on July 28, 2024

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)

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.