RudjiGames / MTuner

MTuner is a C/C++ memory profiler and memory leak finder for Windows, PlayStation 4 and 3, Android and other platforms
BSD 2-Clause "Simplified" License
2.62k stars 145 forks source link

file may be corrupted #111

Open gjaegy opened 2 months ago

gjaegy commented 2 months ago

Hi Milos,

I hope you are well.

I'm using MTuner again, but I'm facing some random issues, where the capture file gets sometimes corrupted (and sometimes not).

I've uploaded the capture file (it seems two files are always created).

http://www.imagine3d.fr/_temp/MTuner.rar

I'm using the latest 4.8 version of MTuner.

Any idea what's causing that ?

thanks a lot !

milostosic commented 2 months ago

Hello, I'm off to vacation today - let's revisit this in ~2 weeks.

gjaegy commented 2 months ago

Thanks for your prompt answer, enjoy your time off then !

gjaegy commented 2 months ago

After some furhter investigations, it seems the issue is likely due to a concurrency issue.

We compile our shaders using multiple threads. With the original code (multiple threads), the capture file is corrupted most of the time (5-10% of the times it's not), and I have some false positive memory leaks.

When compiling the shaders in a single thread, the corruption doesn't occur, as the false positives.

milostosic commented 2 months ago

Thanks! It's been a long time suspicion that there's a threading issue which would almost certainly be in rmem project if you'd like to chase this further while I'm away

gjaegy commented 2 months ago

I'm afraid I won't have enough time, I'll be on vacation starting from tomorrow and hence have to complete a few things before I leave :/