pietia has quit [Quit: This computer has gone to sleep]
pietia has joined #jruby
pietia has quit [Client Quit]
_whitelogger has joined #jruby
drbobbeaty has quit [Ping timeout: 240 seconds]
drbobbeaty has joined #jruby
_whitelogger has joined #jruby
_whitelogger has joined #jruby
pietia has joined #jruby
pietia has quit [Client Quit]
_whitelogger has joined #jruby
jrafanie has joined #jruby
shellac has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]
pietia has joined #jruby
pietia has quit [Quit: This computer has gone to sleep]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lucasb has joined #jruby
jrafanie has joined #jruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #jruby
jrafanie has quit [Read error: Connection reset by peer]
jrafanie has joined #jruby
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
shellac has joined #jruby
olleolleolle has joined #jruby
olleolleolle has quit [Quit: olleolleolle]
shellac has quit [Quit: Computer has gone to sleep.]
olleolleolle has joined #jruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pietia has joined #jruby
jrafanie has joined #jruby
pietia has quit [Quit: This computer has gone to sleep]
shellac has joined #jruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shellac has quit [Quit: Computer has gone to sleep.]
<headius[m]>
lopex: interesting
<lopex>
headius[m]: the discord one also works
<lopex>
from t2bot.io
<headius[m]>
ahh well I wonder how well that scales but it's certainly an option
<lopex>
havent tried telefram
<headius[m]>
I hope it batches them somehow
<lopex>
well, I guess you can self host any of those
<lopex>
headius[m]: it reminds me jabber smtp transports
<lopex>
that mail one especially
<headius[m]>
ah yeah I suppose
shellac has joined #jruby
<headius[m]>
olleolleolle: trying to reproduce your issue now
<headius[m]>
9.2.6.0 seems to be hanging on some INT signal spec?
<headius[m]>
I do have the ArgumentError in hand though
<headius[m]>
hmm interesting it doesn't seem to error run alone
<olleolleolle>
headius[m]: I began disabling the 2 specs which had issues running on JRuby - INT, TERM signal-related.
<headius[m]>
hmm we can look into that too after this
<headius[m]>
I'm trying to figure out a small reproduction
<olleolleolle>
(Sorry, I now understand you got ahead, further into the thing.)
<headius[m]>
it calls the lambda ok and then the error is wrong
<headius[m]>
so it's not the call to the lambda breaking
<olleolleolle>
I kind of believe (after fiddling with adding more output to the RSpec rspec-mock code) that it’s some part of the RSpec verification code which trips the issue.
<olleolleolle>
And, earlier, there’s a backtrace, which has abort_with_message - abort - puts - write - (RSpec instrumentation code)
<headius[m]>
looking at that line
<headius[m]>
hmm
shellac has quit [Quit: Computer has gone to sleep.]
<headius[m]>
ah-ha
<headius[m]>
AH-HA
<headius[m]>
maybe
shellac has joined #jruby
<headius[m]>
# // In MRI this is used for all multi-arg puts calls to write. Here, we just do it for two
<headius[m]>
if (write.retrieveCache(maybeIO.getMetaClass()).method.getArity() == Arity.ONE_ARGUMENT) {
<headius[m]>
that's supposed to be Java code
<headius[m]>
but it seems like we are trying to detect if the target write method is arity 1, and if it is we break up the argument list into multiple separate calls
<headius[m]>
that check could be defeated by some method wrapping we sometimes do, or by bad logic in figuring out the method's arity, or...by mocks that do weird things
shellac has quit [Quit: Computer has gone to sleep.]
<headius[m]>
I'm willing to be this is it...happened just over a year ago with the 2.5 work for 9.2
<olleolleolle>
Sounds very reasonable!
<headius[m]>
in MRI they don't have much variability in how they represent methods and arity, so it probably always works fine for them
<headius[m]>
for us we're probably getting a mocked method that says it takes any number of args, and then it actually doesn't
<headius[m]>
they shouldn't be using a mock write that doesn't take multiple args
<olleolleolle>
…which trips up the RSpec instrumentation verifier
<headius[m]>
right
<olleolleolle>
“they”, is that rspec-mock?
<headius[m]>
because it's in the middle of handling the exception you expected
<headius[m]>
and then it blows up with something else
<headius[m]>
yeah "they"
<olleolleolle>
ty
<headius[m]>
this is still a theory but I'm betting I can fake this now
<olleolleolle>
Thanks for taking an interest in this anomaly. (I’ve put JRuby in quite a few CI setups, never to have them fail productively, like this.)
<headius[m]>
yeah this is an interesting one
<headius[m]>
they expanded write to take multiple args and introduced this hack to avoid calling older code that still only takes one
<headius[m]>
the hack doesn't appear to be 100% effective in JRuby
<headius[m]>
yeah those INT specs really mess some stuff up
<headius[m]>
I'm betting that's the reason I see it just terminate sometimes
<headius[m]>
uh-huh...pretty sure that's it
<headius[m]>
When it fails, the method it's trying to call there is a org.jruby.internal.runtime.methods.ProcMethod
<headius[m]>
When it works it's calling org.jruby.RubyIO$INVOKER$i$write, which is the actual method object for the real IO#write
<headius[m]>
So I'm guessing what they do is mock an actual IO method and then when they put it back they're putting back some mutilated proc-ified version of it that doesn't take multiple arguments, and we're not detecting that correctly anymore
<olleolleolle>
huh
<headius[m]>
yup, and the arity claims to be "Opt" which would mean there's some number of optional arguments
<headius[m]>
do rb_io_write(io, *argv++); while (--argc);
<headius[m]>
```
<headius[m]>
seriously just make it three lines
<headius[m]>
I have no explanation for why this would work in MRI
<headius[m]>
they should detect varargs too
<headius[m]>
Removing the check fixes it
<headius[m]>
(and doing the individual writes every time)
<olleolleolle>
the == Arity.ONE_ARGUMENT check, yeah?
<olleolleolle>
Would that DESTROY perf?
<headius[m]>
well, only if you are doing multi-arg puts a lot
<headius[m]>
it would perform like 2.4 and earlier
<olleolleolle>
multi-arg puts is not a big thing in the codebases I’ve been puttering around in
<headius[m]>
There's possibly a better hack for JRuby, like only go the varargs route if we can detect it's a "natural" method that couldn't lie about arity
<headius[m]>
interesting
<headius[m]>
MRI fails the same way
<headius[m]>
olleolleolle: you said this test succeeds on MRI 2.5 yeah?
<olleolleolle>
oh no, we opened the hellmouth
<headius[m]>
o = Class.new { def writeme(a); p a; end; define_method(:write) {|*args| method(:writeme).call(*args)}; }.new; $stderr = o; abort "foo"
<headius[m]>
so what it seems like is that the mocking logic tries to verify that the signature of the original method matches the signature of the mock method, or something, and it blows up
<headius[m]>
removing that code may not have fixed it
<headius[m]>
there's some ordering issue that it's messing up IO#write
<headius[m]>
olleolleolle: do you have any specs that might be triggering rspec to mock $stderr?
<headius[m]>
like specs that check for warnings or something
<headius[m]>
so it puts it back using define_method which screws up #parameters
<headius[m]>
I should have this fixed in a jiffy
shellac has joined #jruby
<headius[m]>
omh
<headius[m]>
omg
<headius[m]>
yep this is deep
<headius[m]>
we have a way to encode the parameter description for a method as a string
<headius[m]>
it turns out that native methods (like IO#write) were encoding that string incorrectly
<headius[m]>
so while IO#write would say arity = -1 (any number of args), it would report parameter count as single anonymous required argument
<headius[m]>
which gets rendered as :req in the #parameters list
<headius[m]>
it was a bug in encoding
<headius[m]>
that led to the eventual arity check thinking IO#write had a single argument when it's supposed to be variable
<headius[m]>
oy vey
<headius[m]>
I need to rewrite the binding logic for core methods
<headius[m]>
Olle Jonsson (Gitter): so the bug I thought was a bug is just a weird side effect of that hack in MRI, and they do the same thing we would do for the given proxy method
<headius[m]>
the actual culprit was that IO#write was incorrectly reporting parameters, which messed up the arity-checking when it went to uninstall the proxy method (which it does for whatever reason)
bga57 has quit [Quit: Leaving.]
bga57 has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]