8175342: assert(InstanceKlass::cast(k)->is_initialized()) failed: need to increase java_thread_min_stack_allowed calculation
authorcjplummer
Fri, 17 Mar 2017 15:41:14 -0700
changeset 46846 292be53258b7
parent 46845 9c029ec7c296
child 46847 3720a014bb74
child 46848 8b053ca26d6a
8175342: assert(InstanceKlass::cast(k)->is_initialized()) failed: need to increase java_thread_min_stack_allowed calculation Summary: Remove the pthreads stack guard page from the thread created in ContinueInNewThread0 Reviewed-by: dholmes, dsamersoff
jdk/src/java.base/macosx/native/libjli/java_md_macosx.c
jdk/src/java.base/unix/native/libjli/java_md_solinux.c
--- a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c	Fri Mar 17 08:40:12 2017 -0400
+++ b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c	Fri Mar 17 15:41:14 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -886,6 +886,7 @@
     if (stack_size > 0) {
       pthread_attr_setstacksize(&attr, stack_size);
     }
+    pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threads
 
     if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
       void * tmp;
--- a/jdk/src/java.base/unix/native/libjli/java_md_solinux.c	Fri Mar 17 08:40:12 2017 -0400
+++ b/jdk/src/java.base/unix/native/libjli/java_md_solinux.c	Fri Mar 17 15:41:14 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -899,6 +899,7 @@
     if (stack_size > 0) {
       pthread_attr_setstacksize(&attr, stack_size);
     }
+    pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threads
 
     if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
       void * tmp;