Skip to content

8353365: TOUCH_ASSERT_POISON clears GetLastError() #24435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
@@ -2600,6 +2600,7 @@ static inline void report_error(Thread* t, DWORD exception_code,
//-----------------------------------------------------------------------------
JNIEXPORT
LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
PreserveLastError ple;
if (InterceptOSException) return EXCEPTION_CONTINUE_SEARCH;
PEXCEPTION_RECORD exception_record = exceptionInfo->ExceptionRecord;
DWORD exception_code = exception_record->ExceptionCode;
11 changes: 11 additions & 0 deletions test/hotspot/gtest/utilities/test_vmerror.cpp
Original file line number Diff line number Diff line change
@@ -28,6 +28,17 @@

#ifdef ASSERT

#ifdef _WINDOWS

#include <windows.h>

TEST_VM_ASSERT_MSG(vmErrorTest, fatalWithError,
"fatal error: GetLastError should be 6 - actually: 6") {
SetLastError(6);
fatal("GetLastError should be 6 - actually: %lu", GetLastError());
}
#endif // WINDOWS

TEST_VM_ASSERT_MSG(vmErrorTest, resourceMark,
"fatal error: memory leak: allocating without ResourceMark") {