rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
34.18k stars 13.98k forks source link

Do we need the binary encoding segment in our .rb files? #8626

Closed sempervictus closed 7 years ago

sempervictus commented 7 years ago

In trying to make Metasploit run GIL-free with the fun aspects of RBX (JIT, partial pre-compilation, channels, etc) i ran into an awesome problem described in this RBX issue.

It makes me wonder, do we, in MRI 2.3+, still need to use this approach introduced when we were fighting the new Ruby 1.9 encoding madness? Any Ruby experts in dev or community who could weigh in on this? Anyone who knows the history behind this please speak up (@hdm, @egypt) as IIRC there were some unpleasant and deep issues which came up from this, and i'm afraid spec might miss them resulting in another Starship Troopers movie hunting those bugs later.


For those of you who remember this descent into madness from last time (~5y?), just think of this as a form of tenacity as opposed to marine bull-headedness ;-). The GIL must fall!

hdm commented 7 years ago

Yes

egypt commented 7 years ago

@sempervictus Without it, we have to audit every single string literal or call String#b on everything.

sempervictus commented 7 years ago

@egypt: You're a genius. I'll just try to early load a String overload for the runtime since files not marked this way in our deps are causing the failure, not us. Thanks

busterb commented 7 years ago

For each file that we audit, can we remove that encoding line? Just curious if there could be a path moving forward.

sempervictus commented 7 years ago

We will still have to have it in some files unless we use Egypt's trick for b. The rbx VM could be very useful for scale, so I'd like to get this working, but not convinced its worth upstream efforts at tedium until I can run a poc.

busterb commented 7 years ago

I'm going to close this, I think the question was answered.