Comments (22)
I've sent a mail to find someone who owns this area. Stay tuned. We appreciate your patience.
from windows-dev-performance.
@ClosetBugSlayer & @TechnikEmpire - Thanks for investigating at your end.
Since this may have become a heisenbug with no repro, I'll close this issue for now to get it off our radar. If you ever do manage to create a repro, please feel free to ping this thread, share your repro case, and request that the bug be reopened.
from windows-dev-performance.
@ClosetBugSlayer & @TechnikEmpire - Thanks for investigating at your end.
Since this may have become a heisenbug with no repro, I'll close this issue for now to get it off our radar. If you ever do manage to create a repro, please feel free to ping this thread, share your repro case, and request that the bug be reopened.
TADAAAAAA I attached a repro. I hope the comments in the .CPP file guide you through the repro successfully. Please reopen this bug and crush it mercilessly!
from windows-dev-performance.
Seeing this also in 1909 18363.1256
from windows-dev-performance.
Any update on this or suggested workaround?
from windows-dev-performance.
I'm beginning to wonder if this was the most effective forum to report this but it doesn't seem like anyone is watching. I don't know where else to go with it, the bug is pretty obvious.
from windows-dev-performance.
Yeah I was a little shocked to have to google my way into this random ticket to find anything about it. It was completely ruining a simple app I made that just transcodes files.
Perhaps report it in developercommunity.visualstudio.com under c++. That seems to be the bin where someone from Microsoft will pick it up and (hopefully) route it to the correct team.
from windows-dev-performance.
@ValZapod Do you have more info to add to your comment? If we can track down this issue in Chromium then we could possibly work around it?
from windows-dev-performance.
@ValZapod .... do you have a link to the patch or? What I'm asking is how did they fix it, because for the rest of us out here running into this windows bug, since Microsoft seems uninterested in fixing it, it would be nice to be able to work around it like others have.
from windows-dev-performance.
@bitcrazed can you shed any light on this issue please?
from windows-dev-performance.
Ok, maybe @mattwojo or @zooba ?
from windows-dev-performance.
Hey @TechnikEmpire & @ClosetBugSlayer
I've spoken with some of our engineers re. this issue. They've tried but failed to repro the issue you describe using the following code. Could you try this on your end and see if it works for you?
Alternatively, please share your repro case so our devs can take a look and see if there's anything they can suggest.
auto startingHandleList = PrintAndReturnProcessHandleList(); // 👈 Base line open handles, no file
{
auto coInit = wil::CoInitializeEx(COINIT_MULTITHREADED);
RETURN_IF_FAILED(MFStartup(MF_VERSION));
unique_call<decltype(&::MFShutdown), ::MFShutdown> mfshutdown;
{
ComPtr<IMFSourceReader> sourceReader;
RETURN_IF_FAILED(MFCreateSourceReaderFromURL(L"Dichterliebe Op. 48- Im wunderschönen Monat Mai.flac", nullptr, &sourceReader));
DWORD streamIndex = 0;
DWORD streamFlags = 0;
LONGLONG timestamp = 0;
ComPtr<IMFSample> sample;
sourceReader->ReadSample(MF_SOURCE_READER_ANY_STREAM, 0, &streamIndex, &streamFlags, ×tamp, &sample);
auto middleList = PrintAndReturnProcessHandleList(); // 👈 This is while we are reading I see the file handle
auto midDifference = startingHandleList.Diff(middleList);
midDifference.PrintHandles();
}
}
auto endingHandleList = PrintAndReturnProcessHandleList(); // 👈 Final list of handles, the file handle is no longer there.
auto differenceHandleList = startingHandleList.Diff(endingHandleList);
differenceHandleList.PrintHandles();
// Note: `PrintAndReturnProcessHandleList()` queries the handles with NtQuerySystemInformationFunction and so should list all of them.
from windows-dev-performance.
Thanks for the update. A puzzle indeed, I'll try to get a repro. However from your given example, I suspect that fully shutting down MF before checking the handles is hiding the issue, but I may be wrong.
from windows-dev-performance.
@ClosetBugSlayer It's really difficult to help diagnose a problem without a repro case. Please create and share a minimal repro and share so we can take a look.
from windows-dev-performance.
@ClosetBugSlayer Do you have a specific file you were able to repro on? I'm unable so far to reproduce but where I originally observed this was a sort of drag-net, scooping up thousands of files. I'll try to hunt one of those streams down but thought I'd ask in the meantime.
from windows-dev-performance.
OK I had it slightly wrong. After testing, MFCreateSourceReaderFromURL() isn't leaking FLAC handles. IMFSourceResolver.CreateObjectFromURL() is where my leak is happening, and I get the interface from MFCreateSourceResolver().
This C# interop chunk from my project doesn't directly compile but it should be very easy to follow:
Win32Api.MFCreateSourceResolver(out IMFSourceResolver sourceResolver).TryThrowError();
sourceResolver.CreateObjectFromURL(
_strFileSystemPath,
MediaFoundationSourceResolverFlags.MF_RESOLUTION_MEDIASOURCE
| MediaFoundationSourceResolverFlags.MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE
| MediaFoundationSourceResolverFlags.MF_RESOLUTION_READ,
null,
out MF_OBJECT_TYPE type,
out IUnknown objMediaSource)
.TryThrowError()
Marshal.ReleaseComObject(objMediaSource);
Marshal.ReleaseComObject(sourceResolver);
from windows-dev-performance.
@bitcrazed I'm not sure what happened, but I'm no longer able to reproduce this even in the original software where it was first observed. I also created a standalone example with full HW support etc, no repro. Sorry to take up your time for nothing!
from windows-dev-performance.
Should be noted though that I observed this issue with MFCreateSourceReaderFromURL
, not MFCreateSourceResolver
.
from windows-dev-performance.
Should be noted though that I observed this issue with
MFCreateSourceReaderFromURL
, notMFCreateSourceResolver
.
I could have sworn it was MFCreateSourceReaderFromURL but last night changed things. We're in the twilight zone now.
from windows-dev-performance.
@ClosetBugSlayer nice, will run this. @bitcrazed
from windows-dev-performance.
Thanks for sharing the repro case @ClosetBugSlayer - re-opening while we take a look. I and a bunch of people are OOF on vacation at the moment, so there may be a delay in replying, but we are looking. Stay tuned.
from windows-dev-performance.
Hey @ClosetBugSlayer & others on this thread: Summarizing some feedback from the team:
The handle leak is due to a subtle API usage bug. In both samples Shutdown()
is not being called on the media source created by the source resolver.
The documentation clearly states that it’s the application’s responsibility to shutdown the media source and not doing so can lead to resource leaks:
“If the application creates the media source, either directly or through the source resolver, the application is responsible for calling Shutdown to avoid memory or resource leaks.”
Note: The sample above, uses WIL's unique_call<...>
on line 5 which ensures MFShutdown()
is called when it falls out of scope.
unique_call<decltype(&::MFShutdown), ::MFShutdown> mfshutdown;
Hope this helps resolve the issues reported.
from windows-dev-performance.
Related Issues (20)
- PROCESSOR_POWER_INFORMATION.CurrentMhz no longer shows CurrentMhz HOT 7
- Throttling detection needed in Windows HOT 5
- Symbol server PE files are being overwritten with different versions HOT 13
- WinDbg's `dU` command is painfully slow HOT 4
- Merge module validation in Orca fails on well-formed merge module
- NT heap scales horrendously in some cases HOT 2
- Set up your dev environment on Windows for Rust HOT 2
- PrefetchVirtualMemory does not prefetch virtual memory (windows api bug) HOT 1
- Explorer leaks resources over a long time HOT 2
- Configuring RDP with MSA is impossible using the RDP Developer Menu HOT 1
- Argon containers use only weak cores on systems with heterogeneous CPUs HOT 4
- Extremely slow Context Menu launch in Windows Explorer HOT 2
- Unexpected Sleep(1) Precision with Different Clock Interrupt Frequencies (Timer Resolution) HOT 3
- Dev drive has vanished HOT 3
- Windows incorrectly schedules utility QoS threads exclusively to E-cores when running on AC power
- Alt + Tab Sometimes Skips over the Last Window
- Alt+tab issue when in full-screen app HOT 2
- Can't Pinpoint What to do with Error PR175 with Visual Studio HOT 2
- "Must define a target architecture" issue from winnt.h when included by `.rc` files HOT 7
- Consistent CPU performance for benchmarking HOT 6
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 windows-dev-performance.