mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 03:54:33 +02:00
8170548: VM may crash at startup because StdoutLog/StderrLog logging stream can be badly aligned
Reviewed-by: stuefe, mlarsson, clanger, dholmes
This commit is contained in:
parent
9a80c66078
commit
7092ff6b91
1 changed files with 10 additions and 4 deletions
|
@ -29,11 +29,17 @@
|
|||
#include "memory/allocation.inline.hpp"
|
||||
|
||||
static bool initialized;
|
||||
static char stdoutmem[sizeof(LogStdoutOutput)];
|
||||
static char stderrmem[sizeof(LogStderrOutput)];
|
||||
static union {
|
||||
char stdoutmem[sizeof(LogStdoutOutput)];
|
||||
jlong dummy;
|
||||
} aligned_stdoutmem;
|
||||
static union {
|
||||
char stderrmem[sizeof(LogStderrOutput)];
|
||||
jlong dummy;
|
||||
} aligned_stderrmem;
|
||||
|
||||
LogStdoutOutput &StdoutLog = reinterpret_cast<LogStdoutOutput&>(stdoutmem);
|
||||
LogStderrOutput &StderrLog = reinterpret_cast<LogStderrOutput&>(stderrmem);
|
||||
LogStdoutOutput &StdoutLog = reinterpret_cast<LogStdoutOutput&>(aligned_stdoutmem.stdoutmem);
|
||||
LogStderrOutput &StderrLog = reinterpret_cast<LogStderrOutput&>(aligned_stderrmem.stderrmem);
|
||||
|
||||
LogFileStreamInitializer::LogFileStreamInitializer() {
|
||||
if (!initialized) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue