Skip to content

Commit 41c2f89

Browse files
committed
[GR-23507] Move VM warnings to stderr
1 parent 0a738c0 commit 41c2f89

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tool/jt.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,8 +1082,21 @@ def rebuild(*options)
10821082
vm_args << "--core-load-path=#{TRUFFLERUBY_DIR}/src/main/ruby/truffleruby"
10831083
end
10841084

1085-
if ci? and truffleruby_jvm?
1086-
vm_args << '--vm.Xlog:os+thread=off' # GR-23507: prevent thread warnings on stdout to break specs/tests
1085+
if ci?
1086+
# GR-23507: prevent thread warnings on stdout to break specs/tests/programs using execve().
1087+
# The problem happens if one thread is calling execve() and the other about the same time is calling pthread_create().
1088+
# In such case, pthread_create() can return EAGAIN "just because there is a concurrent execve()".
1089+
# See https://bugs.openjdk.org/browse/JDK-8268605?focusedCommentId=14473665#comment-14473665
1090+
# To solve this we move VM warnings to stderr instead of stdout to avoid breaking specs, and logging should be on stderr anyway.
1091+
# '--vm.Xlog:os+thread=off' '--vm.Xlog:gc+task=off' would also be a possibility, but unfortunately
1092+
# these flags don't seem to combine with moving all warnings to stderr so we have to pick one approach.
1093+
# Example warnings:
1094+
# JVM:
1095+
# [11.028s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 2048k, guardsize: 0k, detached.
1096+
# SVM with G1:
1097+
# [0.094s][warning][os,thread] Failed to start thread "GC Thread#1" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 4k, detached.
1098+
# [0.094s][error ][gc,task ] GC(0) Failed to create worker thread
1099+
vm_args << '--vm.Xlog:all=warning:stderr'
10871100
end
10881101

10891102
[vm_args, ruby_args + args, options]

0 commit comments

Comments
 (0)