detecting leaks or invalid/uninitialized accesses... but not both
When I do an analysis with only "detect memory leaks" and "detect resource leaks" selected ... it detects the leaks just fine. However if I also select "detect invalid/uninitialized accesses" it then only detects invalid/uninitialized accesses and no longer detects leaks.
I tried the same steps with two different projects, but couldn't reproduce your issue. If I add "detects invalid/uninitialized accesses" in addition to "detect memory leaks" and "detect resource leaks", all works as expected. Invalid access issues are found alongwith memory leaks.
If you can provide a sample reproducer project, I can test and diagnose it on my side. Also could you please provide more details about your setup: - OS type and version - Intel Inspector XE version (if it's not the latest update 4, you can consider to upgrade) - Command line of your analysis. To get command line from GUI press "Show command line" button in the right bottom corner of the Inspector XE window. - Any additional settings of your analysis, etc.
I tried an extremely simplified project and Inspector worked as expected finding both access errors and leaks.
I was however able to produce another simplified project more closely resembling my real one that exhibits the same issue. I'm guessing it may have something to do with the fact that it uses a dll and/or is mfc based. I attached the example project to this reply.
In case the attachment doesn't work ... it is basically just a mfc application linked to a plain dll. Both are built by us and have debug info etc.
I was also incorrect stating that it didn't find any leaks ... it does find leaks, but only memory leaks in the main executable and not in the dll and no gdi leaks. (this is in leaks + access errors analysis)
So in summary...
Leaks only analysis : finds both memory and gdi leaks in exe and dll
Leaks + access errors : find access errors in both exe and dll, memory leaks in exe but not in dll, and no gdi leaks at all.
exe and dll should both have 1 access error, 1 gdi leak, and 1 memory leak.
OS: win7 pro 64-bit
Inspector version: update 4
Analysis settings are pretty much all default - just copied the memory leak analysis and checked the access errors as well.
So you can see that all problems found in test1 are found in test2 as well. The way I run your test program: - configure and start analysis - wait until program window appear - wait for 5 seconds - close the test program window
My setup is similar to yours: Windows* 7 64-bit, VS2008.
Good idea to compare the logs. My logs look very similar except one thing: Application exit code is 0 in my results. Yours is -1073741819 that doesn't seem correct. However message in the middle of the trace says your application exited with code 0, and there is mismatch.
Noticed odd dll's in mine ... one which was related to some service that was running - flvsrvc.exe or something like that. So I did a selective startup and disabled most services and startup apps. I can now get a 0 exit code for the test app and it reports all the issues. However my real project still doesn't report all the issues and has that odd exit code.
So it seems like it is definitely something to do with my machine and other installed/running software. Going to do a full virus scan and see what else I can disable in startup and see if I can't get to a 0 exit code for my real project. Hopefully can get a handle on what specifically is causing the issue and let you know.
I wonder ... since it looks like the executable itself is exiting with a 0 ... is that odd exit code coming from the unloading of the other dlls? Maybe the collector messages could be changed to show the exit/unloading result for each dll rather than just the final one to make debugging these types of issues easier?
Well I still haven't had any luck getting my real project to be analyzed correctly. I think I know how you can reproduce the issue though with the project I provided. If you install freecorder4http://www.applian.com/freecorder4/ and then do the test2 again you should get that odd exit code and not see the gdi leaks or memory leaks in the dll.
Uninstalling freecorder4 will make the test app analyze correctly again. Though this doesn't fix my real project, I'm guessing it's a similar issue (something in the dll unloading sequence possibly?). Hopefully though this will give you something to work with.
edit: another thing to note ... comparing the collector messages for when freecorder4 is installed vs when it isn't... freecorder4 loads the non-debug vc90.crt dll. Maybe loading both the debug and non-debug crt causes problems?
Yes, I'm able to reproduce the issue with the freecoder. The collector messages can't be extended to show what dll breaks the application. This is not what Inspector XE does, this is internal application logic.
Loading both debug and release dlls can cause the problem - e.g. there are can be same symbols in both dlls and some mess up which one to call. I'm not sure about certain way how to find the problem dll on your real app. You may try to remove directories from %PATH% - but not default system ones. Maybe absence of some path can cut off the problem dll and give you a promtp. Try to find other dlls that are loaded in debug and release versions both.
So is this issue something that is going to be looked into further and hopefully fixed in Inspector now that you can reproduce it?
Because the main issue isn't that Inspector can't find the leaks -- it can, it just doesn't find them when access error checking is also enabled.
One other thing I'm not sure I really understand ... why does the access error analysis have to go through the dll unload stuff that apparently a leaks only analysis doesn't? (or at least it doesn't emit any collector messages)