When calling Windows APIs you often need fetch the error code by calling GetLastError(). So, it is quite common to write code like the following:
fatal(msg ": " PTR_FORMAT " %zuM (%d)", (addr), (size) / M, GetLastError())
However, the last time I hit one of these errors the error code was returned as 0:
# fatal error: Failed to unreserve memory: 0x0000040000200000 2M (0)
The expected error code in that run was 87, not 0.
I've pin-pointed it down to be caused by the TOUCH_ASSERT_POISON mechanism that causes this:
#define fatal(...) \
do { \
TOUCH_ASSERT_POISON; \
report_fatal(INTERNAL_ERROR, __FILE__, __LINE__, __VA_ARGS__); \
} while (0)
If I remove the TOUCH_ASSERT_POISON I get the expected error code.
fatal(msg ": " PTR_FORMAT " %zuM (%d)", (addr), (size) / M, GetLastError())
However, the last time I hit one of these errors the error code was returned as 0:
# fatal error: Failed to unreserve memory: 0x0000040000200000 2M (0)
The expected error code in that run was 87, not 0.
I've pin-pointed it down to be caused by the TOUCH_ASSERT_POISON mechanism that causes this:
#define fatal(...) \
do { \
TOUCH_ASSERT_POISON; \
report_fatal(INTERNAL_ERROR, __FILE__, __LINE__, __VA_ARGS__); \
} while (0)
If I remove the TOUCH_ASSERT_POISON I get the expected error code.
- links to
-
Commit(master) openjdk/jdk/3951a8e0
-
Review(master) openjdk/jdk/24435