Index: sandbox/win/tests/common/controller.cc |
diff --git a/sandbox/win/tests/common/controller.cc b/sandbox/win/tests/common/controller.cc |
index 0033400945295fa6b97a4b4f4ce6121e39c6e82e..738ba14ac65e43cf1c068d0a41ff8d7057af7eb9 100644 |
--- a/sandbox/win/tests/common/controller.cc |
+++ b/sandbox/win/tests/common/controller.cc |
@@ -325,6 +325,13 @@ int DispatchCall(int argc, wchar_t **argv) { |
else if (EVERY_STATE == state) |
command(argc - 4, argv + 4); |
+#if defined(ADDRESS_SANITIZER) |
+ // Bind and leak dbghelp.dll before the token is lowered, otherwise |
+ // AddressSanitizer will crash when trying to symbolize a report. |
+ if (!LoadLibraryA("dbghelp.dll")) |
+ return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; |
+#endif |
+ |
target->LowerToken(); |
} else if (0 != _wcsicmp(argv[1], L"-child-no-sandbox")) { |
return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; |