<lopex> headius: anyways spring is going strong
<headius> phoenix is the Rust framework?
<headius> I wonder why we don't see localized POSIX error descriptions
<headius> maybe you have to call a separate API for that
<headius> huh...looks like they just might be localized on some systems...that will be fun where we're matching the error description
<headius> we can clean that up though
KeyJoo has quit [Ping timeout: 240 seconds]
rdubya has quit [Read error: Connection reset by peer]
<headius> of course I go and break something again
<lopex> headius: elixir
<headius> yeah I wonder if that could be counted as a Ruby
<headius> it started out going toward that goal but quickly just became Ruby syntax for Erlang
<lopex> syntax wise only
<lopex> but it has some selling points
<headius> yeah
<headius> if I had a need to run on that VM I sure wouldn't use Erlang :-)
<lopex> headius: imagine openning a file spawns a new erlangvm green thread
<lopex> essentialy everything spawns a microthread
<headius> yeah I wonder if project Loom will be able to do something like that
<headius> we need to try hooking that up
<lopex> headius: so there seems to be multiple MxN policies
<lopex> not sure how loom aplies to erlangvm
<headius> I suppose you'd need MxN to work against Loom coroutines/continuations
<lopex> I'm not even sure how they relate to cooperativeness
<lopex> I guess the N should be cooperative right ?
<headius> hmm
<headius> yeah I dunno
<headius> I guess yielding control from a coroutine is cooperative
<lopex> I just spit words, dont take my words seriously
<headius> hah
<lopex> headius: but that's within a system thread right ?
<lopex> or well
<headius> well I'm just wondering now, on what boundaries would Erland microthreads be descheduled
<headius> Erlang
<lopex> er, the simple model for MxN is that N is green within a native right ?
<headius> yeah I suppose generally so, or there's some way to involuntarily deschedule one of those N thread things at any time?
<lopex> headius: but they N might no essentially be cooperative ?
<headius> yeah I guess that really still is green threaded
<headius> but you have M possible native threads that can drive the green ones
<lopex> depends on the model
<lopex> er, M is system right ?
<headius> yeah green threaded in my mind somehow got combined with interpreted
<headius> or non-stack-deepening
<headius> like MRI was "green threaded" but the C stack actually did deepen
<headius> they just kept swapping the C stack and the VM state out
<lopex> I thought it was just swapping the stacks
<lopex> well, 1.8
<headius> well according to wikipedia it's a thread that's scheduled by a runtime library rather than by the OS thread scheduler
<headius> all state for the Ruby thread is in globals, so they swap that too
<lopex> so another pthread ?
<headius> but yeah, swapping C stacks...you could still blow out the C stack like any other program
<headius> well it's multiple pthreads now
<headius> so now you actually have N threads that the OS tries to schedule but they re-impose their own scheduling on it
<headius> so isn't that the definition of green threading too? :-D
<lopex> dont ask me
<headius> ha
<lopex> for me green just is internal schedule on some criteria
<lopex> timewise or the like
<lopex> even counting instructions
<lopex> headius: or not ?
<lopex> I'm really misinformed on that I guess
<lopex> but I hope I have some intuitions
<lopex> headius: so how did 1.8 schedule worked ?
<headius> they periodically pinged a status bit set by a signal handler on a timer
<headius> I tink it was 10ms
<headius> rb_check_ints I think it was called
<lopex> so within a native thread a microone would what ?
<lopex> noncooperative
<headius> at various points during interpretation it would check if some of those bits were set
<headius> if so the thread voluntarily deschedules itself and schedules someone else
<lopex> headius: do my questions make sanse actually ?
<headius> do my answers make sense? :-D
<lopex> yeah
<headius> it was cooperative schedule
<headius> you could write an extension that would never give up the thread
<lopex> so I'm sonfusing cooperative with yield then
<headius> in fact most extensions never gave up the thread, which was a problem if they blocked and did a lot of work
<lopex> if I yield I'm cooperative right ?
<headius> yeah
<lopex> or not
<headius> well so this was cooperative from the C level but not avoidable in Ruby
<headius> there were several AST nodes for which they'd ping those bits
<headius> more than you'd think necessary really
<headius> nil, true, false
<lopex> but you could imagine another MxN model where green was based on time right ?
<headius> well that's what I'm wondering about Erlang
<lopex> both M and N non cooperative
<headius> therre are ways to just yank the thread out from under executing code, but it's obviously hard if it's using real registers and stack
<headius> if on the other hand it's all in an interpreter you could really schedule an instruction at a time from each one if you wanted
<headius> seems like there's this really broad sliding scale of MxN boundaries possible
<lopex> I think the N is cooperative on erlang
<headius> well you're encouraged to write small functions right?
<lopex> headius: actor model demands it I guess ?
<headius> yeah right, actor model
<lopex> with in a thread I pass a message within green schedule
<headius> so is it really MxN
<headius> if the context switch is only at actor message boundary
<lopex> so wrt akka ith's java threads and actor queues
<lopex> or am I confusing this
<headius> yeah
<headius> I mean yeah akka
<headius> but this is what I don't know: can an executing Erlang function/actor whatever be suspended at any time
<lopex> no idea
<lopex> I hate this stuff, so I want to understand it
<lopex> headius: so actually it's all about green thread suspension ?
<lopex> within native thread ?
<headius> I don't know it's fuzzy to me too
<headius> if all that's required is that you have your own scheduler, then any actor framework could be called MxN
<lopex> headius: it always reminds mi python yield
<lopex> just suspend stack but with syntax
<headius> yeah
<headius> it's yield in Fiber too
<lopex> and with arbitrary memory model things can get very messy
<headius> if you had hidden yield calls in Ruby it would basically be like having a 1.8 threading model inside each 1.9 thread
<lopex> blows my ming wrt reasoning aready
<lopex> mind
<lopex> ok, so erland seems to separate many things it seems
<lopex> and it just blocks for resourses
<lopex> all that seems to be variations of https://en.wikipedia.org/wiki/Multiversion_concurrency_control
<lopex> in some contrived ways
<lopex> and isolation guarantees
<lopex> but it;s just me spitting slogans
<lopex> headius: the loom does something non jvm compat under the hood ?
<lopex> I might imagine some rewriting bytecode stuff
<bga57> headius: the other day, I mentioned that jruby 9.2 had a different behaviour in a freebsd jail for File.rename than either JRuby 9.1 or MRI, but I did some further investigation, and it has to do with the way statfs works in freebsd jails, and I think jruby 9.2 is probably closer to correct behavior than jruby 9.1, although maybe it should give the same results as MRI.
<lopex> headius: Click said something special about writes here at the end https://www.youtube.com/watch?v=5ZOuCuGrw48
<headius> loom operates completely under the surface of the JVM
<headius> bga57: ah yes, I suppose it's related to a world-readable dir?
<headius> rename...so this is a ToC-to-ToU thing
<lopex> headius: erlanvg vm almost never do the writes
<headius> my favorite exploit nobody's heard of
<lopex> er, in memory
<headius> lopex: ah interesting
<lopex> it;s all spawns
<headius> found a bug on OS X calculator
<headius> when in octal mode if you paste a number it pastes in decimal mode and shows you the octal for it
<bga57> something like that. it depends on whether you can statfs something in /tmp, and there's a setting where you can't if /tmp is in /tmpfs. MRI decides that if you can statfs one of the files, but not the other, they must be on different devices, but jruby 9.2 reports the can't stat error.
<bga57> is that something where you'd like an issue because it doesn't quite match MRI?
<headius> yeah that's the code but we report an error?
<bga57> you report a different error, so bundler fails because it's expecting the different devices error.
<bga57> or at least it knows what to do with the different devices error.
<headius> hmm
<headius> ok so for 9.2 I implemented this using Java 8 path API
<headius> which has support for actually looking at the filesystem of a file and stuff
<bga57> yeah, I looked at the code, but I didn't look at the MRI code.
<headius> what error is it looking for?
<headius> we throw EXDEV it looks like
<headius> oh unless one of these fs lookups can fail....
<headius> @throws IOException
<headius> if an I/O error occurs
<headius> thanks.
<bga57> I get IOError (Mount point not found in fstab)
<bga57>
<headius> aha
<headius> that's it
<bga57> So I can open an issue if you want to match MRI
<headius> whatever the path API is calling to get the FS is failing with an unrecognized IOException
<headius> yeah do that
<bga57> ok, thanks, I'll do it.
<bga57> I realize it's a probably a really rare occurrence, except for a few freebsd users, like me.
<headius> well it's an interesting find
<headius> I wrapped this code with a blanket catch (IOException) because there were no docs on why it might be raised
<headius> but it can fail for any of the reasons of realpath(3) at least...they just raise the error as far as I can see
<headius> The function realpath() may fail and set the external variable errno for any of the errors specified for the library functions alloca(3), getattrlist(2), getcwd(3), lstat(2),
<headius> readlink(2), stat(2), and strdup(3).
<headius> oh is that all
<headius> yah there's that and then I think I see the stat one
<headius> looks like JDK calls lstat in this case
<headius> lstat64
<headius> and there it is
<headius> throw new IOException("Mount point not found in fstab");
<headius> BsdNativeDispatcher.getfsstat()
<headius> why couldn't they make a real exception type to raise
<headius> bga57: fix is easy but gross...it's the JDK impl that's raising this error
<headius> we can make a fallback for this exception to basically just say "can't get FS, can't determine if it's the same" like MRI
<headius> I think it's 50/50 which is the better error but us throwing a dumb IOError is weird
<bga57> I haven't checked to see what MRI does if both old and new are in /tmp, but it can't create new, for example, because the directory where new is located is read only.
<headius> seems like some specs are in order
<headius> I am annoyed that they put a hard error in for this
<headius> for this specific case in fact
<headius> where a file's fs does not show up in the system's list of mounted filesystems
<headius> I'm looking at Java 9 code, this may have been fixed later
<bga57> oh, MRI properly detects rename to read-only directory, too.
<bga57> I'm using openjdk8
<bga57> freebsd doesn't have java9, will probably get java11 next, but no idea how soon.
<headius> heh Android at least include the fs in the error message
<headius> so MRI does error in all these cases anyway
<headius> we're erroring now but not providing a specific-enough error
<headius> we'll have to match on the text of the exception but them's the breaks for now
<headius> bga57: got that bug filed or still exploring?
<bga57> Just filed it, but I included a second end case for rename to a read-only folder
<bga57> I reset the enforce_statfs option for the jail, so I have a workaround.
<headius> ok
<bga57> Sorry, I didn't mean for you to work on it so late.
<headius> no worries, I always work this late
<headius> so does tmpfs not show up as a mount point then?
<headius> with this setting
<headius> oh right because it's in a jail
<bga57> tmpfs       66782216    4 66782212     0%    [restricted]
<bga57> strange, if I do a df, it only shows the root file system, but if I cd to /tmp and then do df . I get
<bga57> Filesystem 1K-blocks Used    Avail Capacity  Mounted on
bga57 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
<headius> does root fs say [restricted] for mount point too?
<headius> does a rename work if you're in /tmp? :-D
<headius> I added info to the bug about this discussion
<headius> jnr-constants nonsense wasted a lot of time
<headius> goodnight
KeyJoo has joined #jruby
drbobbeaty has joined #jruby
shellac has joined #jruby
jmalves has joined #jruby
bbrowning_away is now known as bbrowning
shellac has quit [Quit: Computer has gone to sleep.]
jmalves_ has joined #jruby
jmalves_ has quit [Read error: Connection reset by peer]
jmalves has quit [Ping timeout: 260 seconds]
shellac has joined #jruby
rdubya has joined #jruby
sgeorge has joined #jruby
<ChrisBr> headius: enebo: kares: if you want to visit me in the country of beer & brezels next year -> https://rubyonice.com/
<ChrisBr> (CfP is also still open)
<enebo> ChrisBr: thanks for the heads up. I remember this being announced but I forgot about it.
<ChrisBr> yeah! I was there last year and it was quite nice. Would be cool if there are some jruby people there next year. Ivo Anjo had also some talk there last year.
bga57 has joined #jruby
sgeorge has quit [Remote host closed the connection]
jmalves has joined #jruby
sgeorge has joined #jruby
jmalves has quit [Ping timeout: 252 seconds]
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
sgeorge has quit [Remote host closed the connection]
jmalves has joined #jruby
jmalves has quit [Ping timeout: 260 seconds]
shellac has quit [Ping timeout: 246 seconds]
jmalves has joined #jruby
jmalves has quit [Ping timeout: 245 seconds]
<kares> nice! well maybe if I manage to make a bug this year for a budget ;)
<kares> actually sounds like one conference worth trying
jmalves has joined #jruby
jmalves has quit [Remote host closed the connection]
jmalves has joined #jruby
sgeorge has joined #jruby
<ChrisBr> kares: headius: is there a difference between require with and without extension?
<ChrisBr> Asking regarding bootsnap
<ChrisBr> if I do require 'socket' everything works, require 'socket.jar' does crash
rdubya has quit [Quit: Leaving.]
joast has quit [Ping timeout: 272 seconds]
rdubya has joined #jruby
joast has joined #jruby
xardion has quit [Ping timeout: 252 seconds]
sgeorge has quit [Remote host closed the connection]
sgeorge has joined #jruby
sgeorge has quit [Ping timeout: 246 seconds]
jmalves_ has joined #jruby
jmalves has quit [Ping timeout: 252 seconds]
sgeorge has joined #jruby
sgeorge has quit [Ping timeout: 252 seconds]
sgeorge has joined #jruby