Clean up MSVC specific files in the test directories
| Bugzilla Link | 21883 |
| Version | unspecified |
| OS | Windows NT |
| Reporter | LLVM Bugzilla Contributor |
| CC | @amccarth-google |
Extended Description
Although we try to compile test executables using clang, sometimes clang can fall back to MSVC. When this happens, MSVC will generate PDBs, ILKs, manifests, and other types of output files. The Makefile should clean these up.
Fair enough. I'll look into 22108 as well. But Comment #3 is no longer a reliable repro for this problem (though it does highlight a different problem with what looks like an off-by-1 in a symbol lookup).
It no longer takes the mutex, but alas, the problem is not so simple. See Issue 22108. Rarely, when running the test suite, I get crashes when an inferior process is exiting. It looks like the Target module has been destroyed by that time. So that race condition is going to need to be fixed somehow, but I'm still not sure how.
The deadlock mentioned in Comment 4 has already been resolved--ProcessWindows::OnExitProcess no longer takes the mutex.
There seem to be a variety of problems. Some are easy fixes in Makefiles. I'm still investigating the others.
More information so I don't forget about the progress I've made. ProcessWindows::DoDestroy acquires a lock on Thread A, then signals the debugger thread (Thread B) to kill its inferior, Thread B then calls back into ProcessWindows::OnExitProcess, which deadlocks because it also tries to acquire the same mutex.
It appears that it is calling make clean, but make clean is failing with an access denied. In function tearDown of lldbtest.py, we attempt to delete the targets from the debugger by first terminating the process, and then deleting the target, but Killing the process fails. So, it's possible that instead of just cleaning up some output files, fixing this bug will actually fix some failing tests.
A standalone repro command line for this scenario is:
D:\python_src\Python-2.7.8\PCbuild\python_d.exe D:\src\llvm\tools\lldb\test/dotest.py -q --arch=i686 --executable D:/src/llvm/build/ninja/bin/lldb.exe -s D:/src/llvm/build/ninja/lldb-test-traces -u CXXFLAGS -u CFLAGS -C D:\src\llvm\build\ninja\bin\clang.exe -p TestCStrings.py d:\src\llvm\tools\lldb\test\lang\c\strings
I was going to close this as fixed after adding some code to the makefile to clean pdb and manifest files, but this seems to be popping back up. But running make clean in the directory works. It seems like there's some cases where make clean isn't actually getting run.
It seems like LLD is invoking link.exe for something. We should probably figure out why, and fix it.
assigned to @amccarth-google