Giter VIP home page Giter VIP logo

Comments (8)

randomascii avatar randomascii commented on July 28, 2024

I have contacts at Intel so I can pass it along. Does it happen even if the DLL is unloaded? I take it there is no uninitialize function?

Avoiding resource leaks at shutdown is a hassle and sometimes not worth the trouble, but I can report it.

from uiforetw.

ariccio avatar ariccio commented on July 28, 2024

Does it happen even if the DLL is unloaded?

Eh, you mean not loaded? No, I don't think so.

I take it there is no uninitialize function?

Nope, no documented function, and no exported function.

Reporting would be nice :)

from uiforetw.

randomascii avatar randomascii commented on July 28, 2024

I meant does it happen even if the DLL is loaded and then unloaded.

If you want the Intel developers to investigate you probably need to create a minimal repro (preferably a single source file or a very small project) and precise instructions on how to repro the problem. For instance, specifying where to get App verifier, how to use it, and having something simpler than all of UIforETW to reproduce the problem.

from uiforetw.

ariccio avatar ariccio commented on July 28, 2024

I meant does it happen even if the DLL is loaded and then unloaded.

No, if I do a LoadLibrary followed only by a FreeLibrary, then there's no leak.

If you want the Intel developers to investigate you probably need to create a minimal repro (preferably a single source file or a very small project) and precise instructions on how to repro the problem. For instance, specifying where to get App verifier, how to use it, and having something simpler than all of UIforETW to reproduce the problem.

Good idea, seems obvious in retrospect (duh on my part!). I've got a really simple minimal repro already thrown together. Shall I simply paste it into a comment?

from uiforetw.

randomascii avatar randomascii commented on July 28, 2024

Pasting into a comment could work, but might be unwieldy by the time you have repro instructions and the necessary build commands. A .zip file with instructions and .vcxproj/.sln files would be one good option, or a github repo to allow tweaking it (I can test the instructions to make sure they work and provide feedback).

Be aware that a handle leak may be by design or at least not treated as high priority. Perfect cleanliness during shutdown is often pointless or not practical (see for example crbug.com/490716 which explicitly recommends calling TerminateProcess rather than paying the cost for a theoretically ideal but sometimes expensive shutdown).

from uiforetw.

ariccio avatar ariccio commented on July 28, 2024

Be aware that a handle leak may be by design or at least not treated as high priority. Perfect cleanliness during shutdown is often pointless or not practical (see for example crbug.com/490716 which explicitly recommends calling TerminateProcess rather than paying the cost for a theoretically ideal but sometimes expensive shutdown).

Oh I totally agree, for application-level code, that is. The Intel Power Gadget API is third party code, and this is nowhere documented. If a program loads the library, initializes it, and frees it, then it's dealing with a mystery leak. It's quite easy to make my repro trigger this problem. Here it is leaking 6,730 handles:

energylibleak

6,730, next to Normal is Task Manager's Handles column.

...and all it took was:

    const size_t maxEnergyLib = 10000u;
    for ( size_t i = 0u; i < maxEnergyLib; ++i ) {
        doEnergyLib( );
        }

By leaking thousands of handles, we don't need Application Verifier to demonstrate the presence of a leak, but using Application Verifier will (of course) point to the offending HANDLE's allocation stack.

from uiforetw.

ariccio avatar ariccio commented on July 28, 2024

Here's a repo: https://github.com/ariccio/EnergyLibLeak

from uiforetw.

randomascii avatar randomascii commented on July 28, 2024

Thanks. I've passed it along. Good work.

from uiforetw.

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.