Open yan-zaretskiy opened 3 weeks ago
For context, #9383 is currently blocked on the CI job segfaulting inside a unit test for watcher's handing of asserts (https://github.com/tenstorrent/tt-metal/actions/runs/9495089835/job/26187495213). It prompted me to run those tests with ASAN.
David, can you take a look?
Will take a look once I finish #6430, let me know if this is more important than that
@yan-zaretskiy Is there a specific commit or patch that I can use to repro this issue?
You can pull my branch: yan-zaretskiy/libc++-build. You'd also need to add these to the root CMakeLists.txt
, I put them right after setting the C++ standard:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address,undefined")
It should also reproduce on the main
branch with sanitizers enabled, I just didn't try it myself. I'm gonna give it a try and report here.
Hmm, that's a bummer, I don't get that particular error with libstdc++ on main. I do see unaligned memory loads though from the dprint server.
Oh, I think I know what's going on, we hit SIOF when trying to check the value of the static string watcher::watcher_exception_message
.
Nope, that didn't fix it. Somehow we delete watcher::watcher_exception_message
and then try to write to it afterwards.
ASan reports the heap-use-after-free error coming from watcher: