Skip to content

Commit 2ca24e3

Browse files
committed
8284072: foreign/StdLibTest.java randomly crashes on MacOS/AArch64
Reviewed-by: jvernee, mcimadamore
1 parent 52ccacb commit 2ca24e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hotspot/share/prims/upcallLinker.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -72,6 +72,10 @@ JavaThread* UpcallLinker::on_entry(UpcallStub::FrameData* context) {
7272
// clear any pending exception in thread (native calls start with no exception pending)
7373
thread->clear_pending_exception();
7474

75+
// The call to transition_from_native below contains a safepoint check
76+
// which needs the code cache to be writable.
77+
MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread));
78+
7579
// After this, we are officially in Java Code. This needs to be done before we change any of the thread local
7680
// info, since we cannot find oops before the new information is set up completely.
7781
ThreadStateTransition::transition_from_native(thread, _thread_in_Java, true /* check_asyncs */);

0 commit comments

Comments
 (0)