lucasb has quit [Quit: Connection closed for inactivity]
throsturt has joined #jruby
throstur has quit [Ping timeout: 240 seconds]
enebo[m] has quit [Remote host closed the connection]
JulesIvanicGitte has quit [Read error: Connection reset by peer]
brometeo[m] has quit [Remote host closed the connection]
headius[m] has quit [Read error: Connection reset by peer]
MattPattersonGit has quit [Read error: Connection reset by peer]
rdubya[m] has quit [Read error: Connection reset by peer]
JesseChavezGitte has quit [Remote host closed the connection]
sillymob[m] has quit [Read error: Connection reset by peer]
OlleJonssonGitte has quit [Read error: Connection reset by peer]
KarolBucekGitter has quit [Read error: Connection reset by peer]
ChrisSeatonGitte has quit [Read error: Connection reset by peer]
kares[m] has quit [Read error: Connection reset by peer]
lopex[m] has quit [Remote host closed the connection]
FlorianDoubletGi has quit [Read error: Connection reset by peer]
RomainManni-Buca has quit [Read error: Connection reset by peer]
BlaneDabneyGitte has quit [Read error: Connection reset by peer]
asp_ has quit [Read error: Connection reset by peer]
CharlesOliverNut has quit [Read error: Connection reset by peer]
liamwhiteGitter[ has quit [Read error: Connection reset by peer]
TimGitter[m]1 has quit [Read error: Connection reset by peer]
ThomasEEneboGitt has quit [Read error: Connection reset by peer]
XavierNoriaGitte has quit [Read error: Connection reset by peer]
TimGitter[m] has quit [Read error: Connection reset by peer]
MarcinMielyskiGi has quit [Read error: Connection reset by peer]
UweKuboschGitter has quit [Read error: Connection reset by peer]
KarolBucekGitter has joined #jruby
lopex[m] has joined #jruby
asp_ has joined #jruby
CharlesOliverNut has joined #jruby
ThomasEEneboGitt has joined #jruby
enebo[m] has joined #jruby
MattPattersonGit has joined #jruby
rdubya[m] has joined #jruby
MarcinMielyskiGi has joined #jruby
JulesIvanicGitte has joined #jruby
OlleJonssonGitte has joined #jruby
headius[m] has joined #jruby
TimGitter[m] has joined #jruby
liamwhiteGitter[ has joined #jruby
JesseChavezGitte has joined #jruby
FlorianDoubletGi has joined #jruby
XavierNoriaGitte has joined #jruby
kares[m] has joined #jruby
UweKuboschGitter has joined #jruby
brometeo[m] has joined #jruby
BlaneDabneyGitte has joined #jruby
ChrisSeatonGitte has joined #jruby
sillymob[m] has joined #jruby
RomainManni-Buca has joined #jruby
TimGitter[m]1 has joined #jruby
JulesIvanicGitte has quit [*.net *.split]
ThomasEEneboGitt has quit [*.net *.split]
OlleJonssonGitte has quit [*.net *.split]
liamwhiteGitter[ has quit [*.net *.split]
asp_ has quit [*.net *.split]
OlleJonssonGitte has joined #jruby
asp_ has joined #jruby
liamwhiteGitter[ has joined #jruby
JulesIvanicGitte has joined #jruby
ThomasEEneboGitt has joined #jruby
throsturt has quit [Ping timeout: 245 seconds]
rusk has joined #jruby
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:7103c22 by Karol Bucek): The build was broken. https://travis-ci.org/jruby/jruby/builds/585928175 [198 min 46 sec]
travis-ci has left #jruby [#jruby]
throsturt has joined #jruby
sagax has quit [Remote host closed the connection]
drbobbeaty has joined #jruby
sagax has joined #jruby
<headius[m]> kares those failures look suspiciously like jit
<headius[m]> Did not fail for me but your changes may have exposed some bug in mine
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kares[m]> headius hmm think I saw these before ...
<kares[m]> so it might be coming from the branch
<headius[m]> The regexp /o could easily be a race
<headius[m]> The already initialized...unsure, maybe not properly creating a new regexp
<headius[m]> I don't know how the numeric one would happen
<headius[m]> Actually nevermind, only the already initialized one is weird..other two probably races
<headius[m]> My thought was somehow your changes allow something to jit that didn't...is that possible?
<kares[m]> well if that is the case it would have been due an uncaught exception during jit
<kares[m]> okay core:jit failed a few times on the branch - maybe 30% of time
<kares[m]> callCount used to be volatile for MixedModeIRMethod let's see
<headius[m]> Hmm maybe
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:6a0d754 by Charles Oliver Nutter): The build has errored. https://travis-ci.org/jruby/jruby/builds/585744090 [210 min 7 sec]
travis-ci has left #jruby [#jruby]
sathomsen has joined #jruby
<sathomsen> Hey folks! This might be an old issue, but I'm hitting an issue trying to render templates. `no such file to load -- erb`
<sathomsen> Does that mean something to anyone?
sathomsen has quit [Ping timeout: 240 seconds]
<headius[m]> Gah
<headius[m]> Gotta give us more than 5 minutes to reply
<headius[m]> sathomsen: still here?
<headius[m]> Hmm riot seems to allow name completion of people that left?
drbobbeaty has joined #jruby
sathomsen has joined #jruby
<headius[m]> sathomsen: you left so quickly before
<headius[m]> that error would mean it can't find the JRuby standard library...need more details on your app
<headius[m]> kares: I'm looking into test_regexp because that's probably a race
<headius[m]> I had a to-do to make /o regexp use indy (guaranteed once-only linking of the call site) which would eliminate the race
<sathomsen> sorry, just went for lunch :)
<headius[m]> enebo convinced me it's rare enough not to bother but we don't want a flaky test
<headius[m]> sathomsen: no worries, glad you returned 😀
<sathomsen> headius: we are using the jruby-core 9.2.0.0 to render some templates
<sathomsen> Unfortunately the templating engine complains that it is missing ERB.
<headius[m]> 9.2.0.0 is pretty old, but go on
<headius[m]> how are you running this?
<headius[m]> "erb" is a standard Ruby library shipped with JRuby in most forms
<sathomsen> 2 sek
throsturt is now known as throstur
<sathomsen> Yeah that was also my impression. 9.2.8.0 seems to be the newest no ?
<sathomsen> I tried the jruby-complete version as well.
<sathomsen> According to mvnrepository atleast.
<headius[m]> as well as what?
<headius[m]> jruby-compilete would include the standard library, jruby-core would not
<headius[m]> 9.2.8.0 is newest, yes
<sathomsen> Okay, it appears that ERB is not included in 9.1...
<headius[m]> 😳
<headius[m]> where do you see (or rather not see) that?
<sathomsen> Compiling with 9.0.5.0 works
<sathomsen> Interesting.
<headius[m]> gist some output when you get a chance, I suspect it's just something about how JRuby is being launched
<headius[m]> hmm, well that's rvm doing something odd with our packaging...are you using rvm?
<sathomsen> Tbh I'm not really sure, I was just given the package that I'm working on and jruby is a dependecy 2 layers deep :)
<sathomsen> Let me try and read the code a bit closer.
<headius[m]> ok
<headius[m]> kares: /o was broken in indy
<headius[m]> I have a patch
<headius[m]> unclear why this didn't fail on my branch though
<headius[m]> or ever before
sathomsen has quit [Ping timeout: 265 seconds]
<kares[m]> was away, okay I wont be looking than
<kares[m]> yeah maybe the changes such as less sync + volatility avoided caused the issue to be happening more sporadically
<headius[m]> I may have a new theory
<headius[m]> did you change how threshold=0 works?
<kares[m]> kind of ... possibly
<headius[m]> I think this may be kicking off the jit but then going ahead and executing the interpreter
<headius[m]> so the interpreter evaluates one //o and then the jit evaluates another
<headius[m]> it's a different race
<kares[m]> and this is with threshold=0 ... the suite is run with that?
<headius[m]> for :jit yeah
<headius[m]> at one point I made threshold=0 also turn off background jit, so it would wait for it
<headius[m]> that just hides the race though
<headius[m]> the JIT does check whether the interpreter already cached the value but it can't do that atomically
<headius[m]> that's about as close as it can get without having a separate place to store the regexp that both jitted code and interpreter can see
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:adbc029 by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/586020887 [190 min 5 sec]
travis-ci has left #jruby [#jruby]
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:adbc029 by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/586020887 [205 min 53 sec]
travis-ci has left #jruby [#jruby]
<headius[m]> The race is a known issue I forgot but the failure is new...probably some subtle change in your PR that's allowing it to interpret once
<headius[m]> kares: any thoughts before I dig into it?
<headius[m]> nevermind I see it
<headius[m]> you removed the logic to call the jitted method if the tryJit runs
<headius[m]> er not removed...you moved the tryJit after the check for jittedMethod
<headius[m]> 2f1f286f54884e710c446c9e90b2985102dec116
<headius[m]> that's the one
<headius[m]> I should have noticed this
<headius[m]> kares: should be fixed on master now
<headius[m]> we can talk about the original race but it should only happen now if there's truly two threads hitting a method that happens to JIT at that moment and has a //o
<headius[m]> enebo: race!
lucasb has joined #jruby
sathomsen has joined #jruby
sathomsen has quit [Ping timeout: 258 seconds]
<enebo[m]> nice!
<headius[m]> enebo: the race this exposed is still there
<headius[m]> because the IR stores its //o regexp in one place and the JIT stores its in another there's no way to guarantee it's the same one across a JIT boundary
<headius[m]> link up there a ways shows that JIT does check if IR has already cached it but that's obviously not atomic
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:966205d by Charles Oliver Nutter): The build was fixed. https://travis-ci.org/jruby/jruby/builds/586051174 [209 min 49 sec]
travis-ci has left #jruby [#jruby]
throstur has quit [Ping timeout: 258 seconds]
<headius[m]> 👍
<enebo[m]> headius: seems like that should be very rare
<enebo[m]> headius: as in threshold=0 rare
<headius[m]> pretty rare indeed
<headius[m]> but how critical is it when it happens
<headius[m]> 🤷🏻‍♂️
<enebo[m]> at 50 call counter I don't see it hhappening ever
<enebo[m]> it would need to be an insanely fast compile and a slow interp
<headius[m]> hmm
<enebo[m]> With that said //o being the same instance is not probably super important either
<headius[m]> at >1 I don't think it's possible at all
<headius[m]> because it won't trigger jit until a second call
<headius[m]> I guess if 50 threads all come in at once and one triggers jit before any of them run interp
<headius[m]> so threshold = N can break if N threads all call it at once
<enebo[m]> It violates semantics but it generally should not be harmful that two regexps are in flight for a short period of time?
<enebo[m]> yeah large # of threads could cause it
<headius[m]> it broke after kares patch only because threshold = 0 was actually threshold = 1 but triggered JIT immediately
<headius[m]> the fix would be ugly but maybe simple enough to do: cache //o regexps somewhere else
<enebo[m]> how does //o even work on MRI
<headius[m]> runtime.cacheRegexpOnce(someKindOfKey, re)
<enebo[m]> I should clarify
<headius[m]> with according leak, softref, whatever hassles
<enebo[m]> Can they collect
<headius[m]> they cache it in the instruction most likely
throstur has joined #jruby
<headius[m]> in the iseq
<enebo[m]> yeah that would be a reasonable solution
<enebo[m]> if that code goes away then //o can go away
<enebo[m]> Otherwise they would need to pin it forever
<headius[m]> the semantics are definitely to caches it at at the site
<enebo[m]> we could store them in IRScope as regexp[] sort of thing but that is icky
<enebo[m]> AOT could still work but we would need to persist that
<headius[m]> ah yeah scope was the other option
<enebo[m]> I mean icky in the sense that this problem does not feel like it is worth the effort of fixing
<headius[m]> I think AOT wouldn't need anything special because presumably you would not be mixed mode then
<headius[m]> the only race is when we have a transition
<enebo[m]> well the index of ther array would be set up on load so it should just find it. With deopt we need to fall back to full interp so AOT should consider that
<enebo[m]> OTOH long term AOT will not be the AOT of today either
<headius[m]> I agree with you tbh but I have no idea how bad it could be if a //o produces two results
<enebo[m]> My mind is fuzzy in how bad it can be? In my mind atm I just seem to think object identity comparison would say they are not the same regexp
<headius[m]> btw JDK13 appears to add a dynamic CDS similar to J9 -Xshareclasses...it might be possible to start caching jit output in a CDS archive and have it already verified and ready to go at startup
<enebo[m]> but the regions captured from two is already thread separate data
<headius[m]> possible smaller memory/meatspace too
<enebo[m]> nice
<headius[m]> well it's not just object identity that's a problem
<headius[m]> you'd potentially get two different regexp patterns
<enebo[m]> oh at different times
<headius[m]> e.g. /#{Time.now}/o
<enebo[m]> ok got it. I knew there was more
<enebo[m]> but fwiw if you are doing that in 50 threads you have no idea what is happening
<enebo[m]> although you would clearly match on 2 different things
<headius[m]> we do not guarantee the dynamic bits will run once
<headius[m]> we won't guarantee that because it would require locking around evaluating them
<enebo[m]> yeah we would need to add a lock and who knows how hairy that could get
<headius[m]> so the minimal guarantee is that whatever's at a //o site will always be the same regexp pattern and object
<enebo[m]> if recurses on itself!
<headius[m]> in that case above it would be any one of random Time.now but always that one
<enebo[m]> def foo; /#{foo}/o; end
<headius[m]> hah
<headius[m]> I considered locking and realized quickly that would never work
<enebo[m]> yeah I get the problem but I just don't think people are doing at some particular time generation of the regexp contents
<headius[m]> so it really just comes down to having one atomic memory location to store it at
<headius[m]> no, probably not...that's my sense as well
<headius[m]> BUT WHAT IF
<enebo[m]> well even pointing out it is not atomically calling is a pretty big semantic difference
<headius[m]> I still find it a really odd feature
<enebo[m]> in fact probably more likely then the contents being different
<enebo[m]> Still not important in real life most likely
<headius[m]> like if you want it dynamic why isn't it always dynamic
<headius[m]> and if you want it static why is it dynamic
<enebo[m]> configuration single value setting
<enebo[m]> stuff where it is actually static but not code static
<headius[m]> well I guess that's the other thing
<headius[m]> usually it's in a class body or something
<headius[m]> in that case it's just FOO = Regexp.compile("#blah") really
<enebo[m]> so the non-atomic expansion is actually a bigger problem in the sense of side-effects but I doubt it is really
<headius[m]> do people do it in a method body?
<headius[m]> if they do I hate you
<enebo[m]> @@my_regexp ||= /gotohell/o
<enebo[m]> I love the ambiguity of reading thatl ine
<enebo[m]> Am I telling you off or making a joke about goto?
<headius[m]> the biggest issue would certainly be side effects but I don't think even MRI guarantees that the dynamic bits won't run again
<headius[m]> in fact, I filed an issue about this
<enebo[m]> yeah if they hit a syscall who knows what will run
<headius[m]> so again I say 🤷🏻‍♂️
<enebo[m]> you know what would improve that exclude...a wontfix issue which explains why we it is excluded
<headius[m]> it's possible that MRI prevents or limits thread switching during the dynamic bits or it might just get lucky
<enebo[m]> In fact it might be a good idea to add a tag incompatibility or something where people can figure out that it is a semantic difference for us
<headius[m]> yeah good call...linking to this and to our wontfix
<enebo[m]> we could probably generate a document from that
<headius[m]> well excludes don't have tags but I can explain it there
<enebo[m]> no I meant in github issues
<headius[m]> I don't thikn there's a similar spec
<headius[m]> heh, specs don't even appear to have /o in language/regexp_spec.rb
<enebo[m]> but we just put in GH#666 in exclude string text
<headius[m]> ah yeah
<enebo[m]> maybe "wontfix: GH#666"
<headius[m]> ok there's like three /o specs total in language and none test threading
<headius[m]> good thing we don't just rely on spec
jrafanie has joined #jruby
<headius[m]> I did see this instr just now...so basically they use the equivalent of a CAS to only run the instructions downstream of the dregexp once
<headius[m]> what's unclear to me is how they guarantee another thread waits for the first one to finish running those iseqs
<headius[m]> I bet they just disable context switching within a "once" iseq zone
<headius[m]> I bet I can DOS Ruby this way
<headius[m]> hmm it did reschedule main thread
<headius[m]> so what if main thread reencounters the /o regexp?
<enebo[m]> yes!
<kares[m]> headius: nice fix ... so I am to blame
<kares[m]> did moved 'bellow' the jittedMethod read as callCount was also a volatile check
<headius[m]> yeah I guess I didn't notice the semantic change there
<headius[m]> minor issue though and the real bug is the race that still exists
<headius[m]> your change would still have been fine for threshold > 0
sathomsen has joined #jruby
sathomsen has quit [Client Quit]
KeyJoo has joined #jruby
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (jit-max-pp:7270e7a by kares): The build passed. https://travis-ci.org/jruby/jruby/builds/586094531 [193 min 19 sec]
<headius[m]> I do wonder what guarantees Hotspot makes about transitions from interpreter to compiled
<headius[m]> we know they submit the code to a background compiler threads, and at some point they flip some switch and it no longer enters the interpreter for a given method
throsturt has joined #jruby
<enebo[m]> OSR may help
<headius[m]> yeah they do have the ability to transition back and forth at any time
<headius[m]> I think the only real equivalent right now would be how they lazily bind lambdas
travis-ci has joined #jruby
<travis-ci> jruby/jruby (jit-max-pp:7270e7a by kares): The build passed. https://travis-ci.org/jruby/jruby/builds/586094531 [209 min 3 sec]
travis-ci has left #jruby [#jruby]
<headius[m]> but the lambda class that results will be basically identical
<headius[m]> there's nothing visible to show it generated it twice (which I am pretty sure it could do, but they have indy semantics like //o)
throstur has quit [Ping timeout: 265 seconds]
throsturx has joined #jruby
throstur` has joined #jruby
throsturt has quit [Ping timeout: 240 seconds]
throsturx has quit [Ping timeout: 276 seconds]
knu has quit [Quit: Reboot...]
KeyJoo has quit [Ping timeout: 246 seconds]
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
subbu is now known as subbu|afk
rusk has quit [Remote host closed the connection]
subbu|afk is now known as subbu
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
throstur_ has joined #jruby
throstur` has quit [Ping timeout: 268 seconds]
jrafanie has joined #jruby
throstur_ has quit [Ping timeout: 265 seconds]
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
throstur_ has joined #jruby
<headius[m]> enebo: I updated the exclude to explain wontfix and link to that issue above
<headius[m]> I am going to try to figure out how it works in CRuby though, if ko1 gets back to me
<headius[m]> aha I I may have found it...it deschedules the second thread and tries again
<headius[m]> that doesn't explain to me how it didn't loop forever in my DOS attempt though
<headius[m]> hah ok
<headius[m]> so yeah I did manage to DOS any threads that try to execute this //o that never returns
<headius[m]> this case is contrived of course because even if the once didn't guarantee once execution for everything inside the regexp, it would still hang in the main thread
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<headius[m]> enebo: I just had a desire to see the expanded options from .java_opts files so I'm going to add that
throstur_ has quit [Ping timeout: 240 seconds]
throstur_ has joined #jruby