You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Race condition between ENV modification and backticks causes array out of bounds exception #10031
When I run Hanami tests in the CI, every once in a while I see an array out of bounds exception raise. For example here. This goes away after retrying, usually.
I narrowed it down to a race condition between ENV modification and backticks and I'm able to reliably reproduce it with this two-liner:
Unhandled Java exception: java.lang.ArrayIndexOutOfBoundsException: Index 559 out of bounds for length 559
java.lang.ArrayIndexOutOfBoundsException: Index 559 out of bounds for length 559
buildEnvp at org/jruby/util/io/PopenExecutor.java:1199
execargParentStart1 at org/jruby/util/io/PopenExecutor.java:1174
execargParentStart at org/jruby/util/io/PopenExecutor.java:1122
execargFixup at org/jruby/util/io/PopenExecutor.java:1117
pipeOpen at org/jruby/util/io/PopenExecutor.java:613
pipeOpen at org/jruby/util/io/PopenExecutor.java:296
backquote at org/jruby/RubyKernel.java:1796
️❤ {} \=\^main\_ #2 at repro.rb:1
yieldDirect at org/jruby/runtime/CompiledIRBlockBody.java:151
yieldSpecific at org/jruby/runtime/IRBlockBody.java:74
yieldSpecific at org/jruby/runtime/Block.java:160
times at org/jruby/RubyFixnum.java:338
call at org/jruby/RubyInteger$INVOKER$i$0$0$times.gen:-1
call at org/jruby/internal/runtime/methods/JavaMethod.java:559
performIndirectCall at org/jruby/ir/targets/indy/InvokeSite.java:875
invoke at org/jruby/ir/targets/indy/InvokeSite.java:786
️❤ script at repro.rb:2
run at repro.rb:-1
invokeWithArguments at java/lang/invoke/MethodHandle.java:733
load at org/jruby/ir/Compiler.java:114
runScript at org/jruby/Ruby.java:1221
runNormally at org/jruby/Ruby.java:1133
runFromMain at org/jruby/Ruby.java:978
internalRun at org/jruby/Main.java:282
run at org/jruby/Main.java:227
main at org/jruby/Main.java:199
Unfortunately, I'm not really sure how to proceed from this reproduction to a fix, so I'm opening an issue.
Activity