rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.67k stars 190 forks source link

segfault #391

Closed cstrahan closed 7 months ago

cstrahan commented 8 years ago

I found that uglifier was segfaulting in the therubyracer, and managed to reduce the problematic JS code down to a rather bizarre one-liner:

require 'v8'
src = '/*”*/function f(){                                                                                                }f()'
V8::Context.new.eval(src)

The important bits seem to be the smart-quote character, the number of characters/bytes in the function body, and the function invocation. I suspect that there's some sort of unicode/UTF-8 related problem at play.

Here's the debug output after segfaulting:

/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:99: [BUG] Segmentation fault at 0x00000000000000
ruby 2.1.3p242 (2014-09-19) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0018 p:---- s:0054 e:000053 CFUNC  :Run
c:0017 p:0008 s:0051 e:000050 BLOCK  /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:99
c:0016 p:0006 s:0049 e:000048 BLOCK  /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/error.rb:84 [FINISH]
c:0015 p:---- s:0045 e:000044 CFUNC  :call
c:0014 p:---- s:0043 e:000042 CFUNC  :TryCatch
c:0013 p:0015 s:0040 E:0011b8 METHOD /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/error.rb:83
c:0012 p:0032 s:0037 E:0026d0 BLOCK  /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:99
c:0011 p:0021 s:0033 e:000032 BLOCK  /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:248 [FINISH]
c:0010 p:---- s:0031 e:000030 CFUNC  :call
c:0009 p:---- s:0029 e:000028 CFUNC  :HandleScope
c:0008 p:0015 s:0026 E:000e38 BLOCK  /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:245 [FINISH]
c:0007 p:---- s:0024 e:000023 CFUNC  :call
c:0006 p:---- s:0022 e:000021 CFUNC  :Locker
c:0005 p:0041 s:0019 E:002630 METHOD /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:244
c:0004 p:0018 s:0015 e:000014 METHOD /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:204
c:0003 p:0050 s:0011 E:0011d0 METHOD /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:94
c:0002 p:0031 s:0005 E:000570 EVAL   ./test.rb:4 [FINISH]
c:0001 p:0000 s:0002 E:001ad8 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
./test.rb:4:in `<main>'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:94:in `eval'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:204:in `enter'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:244:in `lock_scope_and_enter'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:244:in `Locker'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:244:in `call'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:245:in `block in lock_scope_and_enter'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:245:in `HandleScope'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:245:in `call'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:248:in `block (2 levels) in lock_scope_and_enter'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:99:in `block in eval'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/error.rb:83:in `try'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/error.rb:83:in `TryCatch'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/error.rb:83:in `call'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/error.rb:84:in `block in try'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:99:in `block (2 levels) in eval'
/nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb:99:in `Run'

-- C level backtrace information -------------------------------------------
/nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/libruby.so.2.1(+0x1e159c) [0x7f13cf22359c]
/nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/libruby.so.2.1(+0x76c53) [0x7f13cf0b8c53]
/nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/libruby.so.2.1(rb_bug+0xb3) [0x7f13cf0b98b3]
/nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/libruby.so.2.1(+0x157b9f) [0x7f13cf199b9f]
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libpthread.so.0(+0x103e0) [0x7f13cee353e0]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x20de69) [0x7f13c4f34e69]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x2aaf78) [0x7f13c4fd1f78]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x2aafb4) [0x7f13c4fd1fb4]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x2b12ee) [0x7f13c4fd82ee]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x2394fd) [0x7f13c4f604fd]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x244841) [0x7f13c4f6b841]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x244bcd) [0x7f13c4f6bbcd]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0xbb2e2) [0x7f13c4de22e2]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x1ff1a6) [0x7f13c4f261a6]
/nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so(+0x19411b) [0x7f13c4ebb11b]
[0x9bf4a3062ee]

-- Other runtime information -----------------------------------------------

* Loaded script: ./test.rb

* Loaded features:

    0 enumerator.so
    1 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/enc/encdb.so
    2 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/enc/trans/transdb.so
    3 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/rbconfig.rb
    4 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/compatibility.rb
    5 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/defaults.rb
    6 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/deprecate.rb
    7 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/errors.rb
    8 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/version.rb
    9 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/requirement.rb
   10 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/platform.rb
   11 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/basic_specification.rb
   12 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/stub_specification.rb
   13 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/util/stringio.rb
   14 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/specification.rb
   15 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/exceptions.rb
   16 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb
   17 thread.rb
   18 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/thread.so
   19 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/monitor.rb
   20 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb
   21 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems.rb
   22 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/pathname.so
   23 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/pathname.rb
   24 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/constants.rb
   25 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/dependency.rb
   26 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/path_support.rb
   27 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/io/console.so
   28 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/user_interaction.rb
   29 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/etc.so
   30 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/config_file.rb
   31 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/ext/build_error.rb
   32 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/ext/builder.rb
   33 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/ext/configure_builder.rb
   34 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/fileutils.rb
   35 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/delegate.rb
   36 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/tmpdir.rb
   37 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/tempfile.rb
   38 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb
   39 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/ext/rake_builder.rb
   40 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/optparse.rb
   41 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/command.rb
   42 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/ext/cmake_builder.rb
   43 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/ext.rb
   44 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/rubygems_integration.rb
   45 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/current_ruby.rb
   46 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/shared_helpers.rb
   47 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/gem_path_manipulation.rb
   48 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/gem_helpers.rb
   49 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/match_platform.rb
   50 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/rubygems_ext.rb
   51 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/version.rb
   52 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler.rb
   53 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri/common.rb
   54 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri/generic.rb
   55 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri/ftp.rb
   56 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri/http.rb
   57 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri/https.rb
   58 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri/ldap.rb
   59 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri/ldaps.rb
   60 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri/mailto.rb
   61 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/uri.rb
   62 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/settings.rb
   63 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/strscan.so
   64 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/source.rb
   65 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/digest.so
   66 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/digest.rb
   67 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/digest/sha1.so
   68 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/source/path.rb
   69 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/source/git.rb
   70 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/socket.so
   71 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/socket.rb
   72 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/timeout.rb
   73 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/protocol.rb
   74 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/zlib.so
   75 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/stringio.so
   76 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/exceptions.rb
   77 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/header.rb
   78 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/generic_request.rb
   79 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/request.rb
   80 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/requests.rb
   81 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/response.rb
   82 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/responses.rb
   83 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/proxy_delta.rb
   84 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http/backward.rb
   85 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/net/http.rb
   86 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/date_core.so
   87 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/date/format.rb
   88 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/date.rb
   89 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/time.rb
   90 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/request.rb
   91 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/cgi/core.rb
   92 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/cgi/util.rb
   93 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/cgi/cookie.rb
   94 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/cgi.rb
   95 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/uri_formatter.rb
   96 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/fcntl.so
   97 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/openssl.so
   98 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/openssl/bn.rb
   99 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/openssl/cipher.rb
  100 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/openssl/config.rb
  101 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/openssl/digest.rb
  102 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/openssl/x509.rb
  103 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/openssl/buffering.rb
  104 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/openssl/ssl.rb
  105 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/openssl.rb
  106 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/securerandom.rb
  107 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/resolv.rb
  108 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/remote_fetcher.rb
  109 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/text.rb
  110 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/name_tuple.rb
  111 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/rubygems/spec_fetcher.rb
  112 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb
  113 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/lockfile_parser.rb
  114 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/set.rb
  115 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/definition.rb
  116 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/dependency.rb
  117 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/ruby_dsl.rb
  118 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/dsl.rb
  119 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/source_list.rb
  120 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/lazy_specification.rb
  121 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/tsort.rb
  122 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/forwardable.rb
  123 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/spec_set.rb
  124 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/environment.rb
  125 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb
  126 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/dep_proxy.rb
  127 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/index.rb
  128 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/remote_specification.rb
  129 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/stub_specification.rb
  130 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/endpoint_specification.rb
  131 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/bundler-1.10.6/lib/bundler/setup.rb
  132 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/version.rb
  133 /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/weakref.rb
  134 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/weak.rb
  135 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/extensions/x86_64-linux/2.1.0/therubyracer-0.12.2/v8/init.so
  136 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/error.rb
  137 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/stack.rb
  138 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/fundamental.rb
  139 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/abstract_reference_value_map.rb
  140 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/abstract_reference_key_map.rb
  141 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/reference.rb
  142 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/reference_queue.rb
  143 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/soft_reference.rb
  144 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/weak_reference/weak_ref.rb
  145 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/soft_key_map.rb
  146 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/soft_value_map.rb
  147 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/strong_reference.rb
  148 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/weak_key_map.rb
  149 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref/weak_value_map.rb
  150 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/ref-2.0.0/lib/ref.rb
  151 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/indentity.rb
  152 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/reference.rb
  153 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/primitive.rb
  154 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/code.rb
  155 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/class.rb
  156 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/object.rb
  157 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/time.rb
  158 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/hash.rb
  159 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/array.rb
  160 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/proc.rb
  161 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/method.rb
  162 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/symbol.rb
  163 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/string.rb
  164 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion/fixnum.rb
  165 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/conversion.rb
  166 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/access/names.rb
  167 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/access/indices.rb
  168 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/access/invocation.rb
  169 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/access.rb
  170 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/context.rb
  171 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/object.rb
  172 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/array.rb
  173 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8/function.rb
  174 /nix/store/c0gljjm2c60qs4fp9smbp8a3v193k65r-gitlab/lib/ruby/gems/2.1.3/gems/therubyracer-0.12.2/lib/v8.rb

* Process memory map:

00400000-00401000 r-xp 00000000 00:13 30011382                           /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/bin/ruby
00600000-00601000 rw-p 00000000 00:13 30011382                           /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/bin/ruby
00c11000-020e3000 rw-p 00000000 00:00 0                                  [heap]
9bf4a039000-9bf4a100000 ---p 00000000 00:00 0 
9bf4a100000-9bf4a105000 rw-p 00000000 00:00 0 
9bf4a105000-9bf4a106000 ---p 00000000 00:00 0 
9bf4a106000-9bf4a107000 rwxp 00000000 00:00 0 
9bf4a107000-9bf4a200000 ---p 00000000 00:00 0 
9bf4a200000-9bf4a205000 rw-p 00000000 00:00 0 
9bf4a205000-9bf4a206000 ---p 00000000 00:00 0 
9bf4a206000-9bf4a207000 rwxp 00000000 00:00 0 
9bf4a207000-9bf4a300000 ---p 00000000 00:00 0 
9bf4a300000-9bf4a305000 rw-p 00000000 00:00 0 
9bf4a305000-9bf4a306000 ---p 00000000 00:00 0 
9bf4a306000-9bf4a3ff000 rwxp 00000000 00:00 0 
9bf4a3ff000-9bf6a039000 ---p 00000000 00:00 0 
dbcb2000000-dbcb2f00000 ---p 00000000 00:00 0 
dbcb2f00000-dbcb3000000 rw-p 00000000 00:00 0 
dbcb3000000-dbcb4000000 ---p 00000000 00:00 0 
15ad36762000-15ad36763000 r-xp 00000000 00:00 0 
23b600c7c000-23b600c7d000 r-xp 00000000 00:00 0 
2407c0000000-2407c0035000 rw-p 00000000 00:00 0 
303e16e50000-303e16e51000 r-xp 00000000 00:00 0 
309abbf00000-309abbf25000 rw-p 00000000 00:00 0 
351a75b00000-351a75b25000 rw-p 00000000 00:00 0 
36b288500000-36b288585000 rw-p 00000000 00:00 0 
38491b36e000-38491b380000 ---p 00000000 00:00 0 
38491b380000-38491b3a0000 rw-p 00000000 00:00 0 
38491b3a0000-38491b3ce000 ---p 00000000 00:00 0 
399dd25f7000-399dd25f8000 r-xp 00000000 00:00 0 
3aba1fa47000-3aba1fa48000 rw-p 00000000 00:00 0 
3aba1fa48000-3aba1fc47000 ---p 00000000 00:00 0 
3e4129bf4000-3e4129bf5000 r-xp 00000000 00:00 0 
7f13c0000000-7f13c0021000 rw-p 00000000 00:00 0 
7f13c0021000-7f13c4000000 ---p 00000000 00:00 0 
7f13c4806000-7f13c481b000 r-xp 00000000 00:13 19147528                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libgcc_s.so.1
7f13c481b000-7f13c4a1b000 ---p 00015000 00:13 19147528                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libgcc_s.so.1
7f13c4a1b000-7f13c4a1c000 rw-p 00015000 00:13 19147528                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libgcc_s.so.1
7f13c4a1c000-7f13c4b07000 r-xp 00000000 00:13 19151621                   /nix/store/i9nn1fkcy95dzf0hb9wi8gbkid3iw1sa-gcc-4.9.3/lib/libstdc++.so.6.0.20
7f13c4b07000-7f13c4d07000 ---p 000eb000 00:13 19151621                   /nix/store/i9nn1fkcy95dzf0hb9wi8gbkid3iw1sa-gcc-4.9.3/lib/libstdc++.so.6.0.20
7f13c4d07000-7f13c4d10000 r--p 000eb000 00:13 19151621                   /nix/store/i9nn1fkcy95dzf0hb9wi8gbkid3iw1sa-gcc-4.9.3/lib/libstdc++.so.6.0.20
7f13c4d10000-7f13c4d12000 rw-p 000f4000 00:13 19151621                   /nix/store/i9nn1fkcy95dzf0hb9wi8gbkid3iw1sa-gcc-4.9.3/lib/libstdc++.so.6.0.20
7f13c4d12000-7f13c4d27000 rw-p 00000000 00:00 0 
7f13c4d27000-7f13c522a000 r-xp 00000000 00:13 29936276                   /nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so
7f13c522a000-7f13c542a000 ---p 00503000 00:13 29936276                   /nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so
7f13c542a000-7f13c545b000 rw-p 00503000 00:13 29936276                   /nix/store/05gvvfk306xqvk1652svqn5wwsxgpqn9-v8-3.16.14.11/lib/libv8.so
7f13c545b000-7f13c545e000 rw-p 00000000 00:00 0 
7f13c545e000-7f13c54a9000 r-xp 00000000 00:13 30196918                   /nix/store/bqp0vv2glaz8m8hvg847p7z5jp5p79sp-ruby-2.1.3-p0-therubyracer/lib/ruby/gems/2.1.3/extensions/x86_64-linux/2.1.0/therubyracer-0.12.2/v8/init.so
7f13c54a9000-7f13c56a9000 ---p 0004b000 00:13 30196918                   /nix/store/bqp0vv2glaz8m8hvg847p7z5jp5p79sp-ruby-2.1.3-p0-therubyracer/lib/ruby/gems/2.1.3/extensions/x86_64-linux/2.1.0/therubyracer-0.12.2/v8/init.so
7f13c56a9000-7f13c56ad000 rw-p 0004b000 00:13 30196918                   /nix/store/bqp0vv2glaz8m8hvg847p7z5jp5p79sp-ruby-2.1.3-p0-therubyracer/lib/ruby/gems/2.1.3/extensions/x86_64-linux/2.1.0/therubyracer-0.12.2/v8/init.so
7f13c56ad000-7f13c5712000 r-xp 00000000 00:13 19149403                   /nix/store/w0ml3zjnqawcw2dlamn9q3pilplmgryi-openssl-1.0.1p/lib/libssl.so.1.0.0
7f13c5712000-7f13c5911000 ---p 00065000 00:13 19149403                   /nix/store/w0ml3zjnqawcw2dlamn9q3pilplmgryi-openssl-1.0.1p/lib/libssl.so.1.0.0
7f13c5911000-7f13c591b000 rw-p 00064000 00:13 19149403                   /nix/store/w0ml3zjnqawcw2dlamn9q3pilplmgryi-openssl-1.0.1p/lib/libssl.so.1.0.0
7f13c591b000-7f13c596d000 r-xp 00000000 00:13 30012372                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/openssl.so
7f13c596d000-7f13c5b6d000 ---p 00052000 00:13 30012372                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/openssl.so
7f13c5b6d000-7f13c5b70000 rw-p 00052000 00:13 30012372                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/openssl.so
7f13c5b70000-7f13c5b71000 rw-p 00000000 00:00 0 
7f13c5b71000-7f13c5b72000 r-xp 00000000 00:13 30012355                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/fcntl.so
7f13c5b72000-7f13c5d71000 ---p 00001000 00:13 30012355                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/fcntl.so
7f13c5d71000-7f13c5d72000 rw-p 00000000 00:13 30012355                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/fcntl.so
7f13c5d72000-7f13c5da6000 r-xp 00000000 00:13 30012288                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/date_core.so
7f13c5da6000-7f13c5fa5000 ---p 00034000 00:13 30012288                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/date_core.so
7f13c5fa5000-7f13c5fa7000 rw-p 00033000 00:13 30012288                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/date_core.so
7f13c5fa7000-7f13c5fa8000 rw-p 00000000 00:00 0 
7f13c5fa8000-7f13c5fb0000 r-xp 00000000 00:13 30012385                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/stringio.so
7f13c5fb0000-7f13c61af000 ---p 00008000 00:13 30012385                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/stringio.so
7f13c61af000-7f13c61b0000 rw-p 00007000 00:13 30012385                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/stringio.so
7f13c61b0000-7f13c61c8000 r-xp 00000000 00:13 19149107                   /nix/store/31w31mc8immhpnmxvcl4l0fvc3i5iwh0-zlib-1.2.8/lib/libz.so.1.2.8
7f13c61c8000-7f13c63c7000 ---p 00018000 00:13 19149107                   /nix/store/31w31mc8immhpnmxvcl4l0fvc3i5iwh0-zlib-1.2.8/lib/libz.so.1.2.8
7f13c63c7000-7f13c63c8000 rw-p 00017000 00:13 19149107                   /nix/store/31w31mc8immhpnmxvcl4l0fvc3i5iwh0-zlib-1.2.8/lib/libz.so.1.2.8
7f13c63c8000-7f13c63d8000 r-xp 00000000 00:13 30012389                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/zlib.so
7f13c63d8000-7f13c65d7000 ---p 00010000 00:13 30012389                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/zlib.so
7f13c65d7000-7f13c65d8000 rw-p 0000f000 00:13 30012389                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/zlib.so
7f13c65d8000-7f13c6601000 r-xp 00000000 00:13 30012384                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/socket.so
7f13c6601000-7f13c6801000 ---p 00029000 00:13 30012384                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/socket.so
7f13c6801000-7f13c6802000 rw-p 00029000 00:13 30012384                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/socket.so
7f13c6802000-7f13c6806000 r-xp 00000000 00:13 30012295                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/digest.so
7f13c6806000-7f13c6a05000 ---p 00004000 00:13 30012295                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/digest.so
7f13c6a05000-7f13c6a06000 rw-p 00003000 00:13 30012295                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/digest.so
7f13c6a06000-7f13c6bc8000 r-xp 00000000 00:13 19149160                   /nix/store/w0ml3zjnqawcw2dlamn9q3pilplmgryi-openssl-1.0.1p/lib/libcrypto.so.1.0.0
7f13c6bc8000-7f13c6dc7000 ---p 001c2000 00:13 19149160                   /nix/store/w0ml3zjnqawcw2dlamn9q3pilplmgryi-openssl-1.0.1p/lib/libcrypto.so.1.0.0
7f13c6dc7000-7f13c6def000 rw-p 001c1000 00:13 19149160                   /nix/store/w0ml3zjnqawcw2dlamn9q3pilplmgryi-openssl-1.0.1p/lib/libcrypto.so.1.0.0
7f13c6def000-7f13c6df3000 rw-p 00000000 00:00 0 
7f13c6df3000-7f13c6df4000 r-xp 00000000 00:13 30012293                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/digest/sha1.so
7f13c6df4000-7f13c6ff4000 ---p 00001000 00:13 30012293                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/digest/sha1.so
7f13c6ff4000-7f13c6ff5000 rw-p 00001000 00:13 30012293                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/digest/sha1.so
7f13c6ff5000-7f13c6ffb000 r-xp 00000000 00:13 30012386                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/strscan.so
7f13c6ffb000-7f13c71fb000 ---p 00006000 00:13 30012386                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/strscan.so
7f13c71fb000-7f13c71fc000 rw-p 00006000 00:13 30012386                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/strscan.so
7f13c71fc000-7f13c71ff000 r-xp 00000000 00:13 30012354                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/etc.so
7f13c71ff000-7f13c73fe000 ---p 00003000 00:13 30012354                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/etc.so
7f13c73fe000-7f13c73ff000 rw-p 00002000 00:13 30012354                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/etc.so
7f13c73ff000-7f13c7403000 r-xp 00000000 00:13 30012360                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/io/console.so
7f13c7403000-7f13c7602000 ---p 00004000 00:13 30012360                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/io/console.so
7f13c7602000-7f13c7603000 rw-p 00003000 00:13 30012360                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/io/console.so
7f13c7603000-7f13c760a000 r-xp 00000000 00:13 30012373                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/pathname.so
7f13c760a000-7f13c7809000 ---p 00007000 00:13 30012373                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/pathname.so
7f13c7809000-7f13c780a000 rw-p 00006000 00:13 30012373                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/pathname.so
7f13c780a000-7f13c780d000 r-xp 00000000 00:13 30012388                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/thread.so
7f13c780d000-7f13c7a0d000 ---p 00003000 00:13 30012388                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/thread.so
7f13c7a0d000-7f13c7a0e000 rw-p 00003000 00:13 30012388                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/thread.so
7f13c7a0e000-7f13c7a11000 r-xp 00000000 00:13 30012345                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/enc/trans/transdb.so
7f13c7a11000-7f13c7c10000 ---p 00003000 00:13 30012345                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/enc/trans/transdb.so
7f13c7c10000-7f13c7c11000 rw-p 00002000 00:13 30012345                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/enc/trans/transdb.so
7f13c7c11000-7f13c7c13000 r-xp 00000000 00:13 30012303                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/enc/encdb.so
7f13c7c13000-7f13c7e12000 ---p 00002000 00:13 30012303                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/enc/encdb.so
7f13c7e12000-7f13c7e13000 rw-p 00001000 00:13 30012303                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/ruby/2.1.0/x86_64-linux/enc/encdb.so
7f13c7e13000-7f13ce343000 r--p 00000000 00:13 28298411                   /nix/store/4yhkx5xr14q3phjdqds3rhckrw4107xx-glibc-locales-2.21/lib/locale/locale-archive
7f13ce343000-7f13ce4d9000 r-xp 00000000 00:13 19147510                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libc-2.21.so
7f13ce4d9000-7f13ce6d9000 ---p 00196000 00:13 19147510                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libc-2.21.so
7f13ce6d9000-7f13ce6dd000 r--p 00196000 00:13 19147510                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libc-2.21.so
7f13ce6dd000-7f13ce6df000 rw-p 0019a000 00:13 19147510                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libc-2.21.so
7f13ce6df000-7f13ce6e3000 rw-p 00000000 00:00 0 
7f13ce6e3000-7f13ce7e4000 r-xp 00000000 00:13 19147530                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libm-2.21.so
7f13ce7e4000-7f13ce9e4000 ---p 00101000 00:13 19147530                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libm-2.21.so
7f13ce9e4000-7f13ce9e5000 r--p 00101000 00:13 19147530                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libm-2.21.so
7f13ce9e5000-7f13ce9e6000 rw-p 00102000 00:13 19147530                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libm-2.21.so
7f13ce9e6000-7f13ce9f2000 r-xp 00000000 00:13 19147518                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libcrypt-2.21.so
7f13ce9f2000-7f13cebf1000 ---p 0000c000 00:13 19147518                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libcrypt-2.21.so
7f13cebf1000-7f13cebf2000 r--p 0000b000 00:13 19147518                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libcrypt-2.21.so
7f13cebf2000-7f13cebf3000 rw-p 0000c000 00:13 19147518                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libcrypt-2.21.so
7f13cebf3000-7f13cec21000 rw-p 00000000 00:00 0 
7f13cec21000-7f13cec23000 r-xp 00000000 00:13 19147522                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libdl-2.21.so
7f13cec23000-7f13cee23000 ---p 00002000 00:13 19147522                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libdl-2.21.so
7f13cee23000-7f13cee24000 r--p 00002000 00:13 19147522                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libdl-2.21.so
7f13cee24000-7f13cee25000 rw-p 00003000 00:13 19147522                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libdl-2.21.so
7f13cee25000-7f13cee3c000 r-xp 00000000 00:13 19147563                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libpthread-2.21.so
7f13cee3c000-7f13cf03c000 ---p 00017000 00:13 19147563                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libpthread-2.21.so
7f13cf03c000-7f13cf03d000 r--p 00017000 00:13 19147563                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libpthread-2.21.so
7f13cf03d000-7f13cf03e000 rw-p 00018000 00:13 19147563                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/libpthread-2.21.so
7f13cf03e000-7f13cf042000 rw-p 00000000 00:00 0 
7f13cf042000-7f13cf2f0000 r-xp 00000000 00:13 30011421                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/libruby.so.2.1.0
7f13cf2f0000-7f13cf4ef000 ---p 002ae000 00:13 30011421                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/libruby.so.2.1.0
7f13cf4ef000-7f13cf4f8000 rw-p 002ad000 00:13 30011421                   /nix/store/i2sy75caqgk7x1yl33aaschykqqg87ax-ruby-2.1.3-p0/lib/libruby.so.2.1.0
7f13cf4f8000-7f13cf509000 rw-p 00000000 00:00 0 
7f13cf509000-7f13cf529000 r-xp 00000000 00:13 19147499                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/ld-2.21.so
7f13cf60b000-7f13cf60c000 rw-p 00000000 00:00 0 
7f13cf60c000-7f13cf60d000 ---p 00000000 00:00 0 
7f13cf60d000-7f13cf61d000 rw-p 00000000 00:00 0                          [stack:25849]
7f13cf61d000-7f13cf61e000 ---p 00000000 00:00 0 
7f13cf61e000-7f13cf729000 rw-p 00000000 00:00 0                          [stack:25848]
7f13cf729000-7f13cf72a000 r--p 00020000 00:13 19147499                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/ld-2.21.so
7f13cf72a000-7f13cf72b000 rw-p 00021000 00:13 19147499                   /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/lib/ld-2.21.so
7f13cf72b000-7f13cf72c000 rw-p 00000000 00:00 0 
7ffef24ac000-7ffef24cf000 rw-p 00000000 00:00 0 
7ffef25e9000-7ffef25eb000 r--p 00000000 00:00 0                          [vvar]
7ffef25eb000-7ffef25ed000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
cstrahan commented 8 years ago

I'm using v8 version 3.16.14.11. I realize now that, a couple months ago, we updated from 3.16.14 in NixOS's packages. So I tried with 3.16.14, and I can still reproduce this.

cstrahan commented 8 years ago

I wrote the following bit of C++ to rule out problems with my libv8.so:

#include <v8.h>

int main (int argc, char *argv[]) {
  v8::HandleScope handle_scope;
  v8::Persistent<v8::Context> context = v8::Context::New();
  v8::Context::Scope context_scope(context);
  v8::TryCatch trycatch;

  auto source =
    v8::String::New(
        "/*”*/function f(){                                                                                                }f()"
        );

  auto script = v8::Script::New(source);

  script->Run();
}

That runs fine, so I believe the problem resides with therubyracer. @cowboyd are you able to reproduce this? I'm willing to lend a hand in any way I can, just let me know if there's something I can do to help isolate the cause of this problem.

cowboyd commented 8 years ago

Do you find this problem on the v8 4.5 branch? https://github.com/cowboyd/therubyracer/tree/upgrade-to-v8-4.5

cstrahan commented 8 years ago

@cowboyd I can give that a go. Do you know if Google provides a tarball for the 4.5.x series of v8? The following has worked for 3.x: https://commondatastorage.googleapis.com/chromium-browser-official

cstrahan commented 8 years ago

@cowboyd I've built v8-4.5.95.1 from source, and tried using your 4.5 branch. Unfortunately, I get the following after require 'v8':

lib/v8/init.so: undefined symbol: _ZN2v88platform21CreateDefaultPlatformEi

Here's the output when I run nm libv8.so: http://sprunge.us/IZUE

I'm not sure why the platform namespace appears to be unaccounted for...

cstrahan commented 8 years ago

So, I've spent some time studying the *.gyp files, and I think I'm slowly getting a sense of how it works, but even then, I'm still pretty lost.

From what I've gathered, the $prefix/bin/d8 executable should have the v8_libplatform target statically linked in, and from running nm on it, I know that assumption is correct.

I'm now curious what we're doing differently that would result in v8_libplatform being linked into your libv8.so, but not in mine.

cstrahan commented 8 years ago

I tried adding a dependency to v8_libplatform on the v8 target: https://github.com/v8/v8/blob/ea6801b77e285926ac41cc18a3b34d8b42eb3134/tools/gyp/v8.gyp#L42

That seems to result in linking in the platform stuff: http://sprunge.us/VgBQ

But I still get the "undefined symbol" error. It looks like those symbols are local instead of global.

cstrahan commented 8 years ago

Also, I don't see where you're passing component=shared as a make flag, which makes me wonder how you create the shared library.

cowboyd commented 8 years ago

The answer is that by default, the libv8 gem will build a static library, not a shared one. Did you build the v8 source directly from v8, or using the libv8 gem?

By default, the libv8 gem will compile static archives libv8_platform.a, libv8_parser.a, etc... which we then link into the v8/init.so in the ruby extension, so that the ruby extension is a dynamically linked library, that contains the entirety of the v8 object code.

If you are compiling therubyracer against system libraries (using --with-system-v8 option on libv8), and you're using component=shared then my question is, how many shared libraries does the v8 build generate, and we'll probably have to modify the libv8 gem to link against them (beyond just -lv8) so we'd have to add -lv8_platform -lv8_parser -lv8_snapshot

Anyhow, that's my guess.

cstrahan commented 8 years ago

By default, the libv8 gem will compile static archives libv8_platform.a, libv8_parser.a, etc... which we then link into the v8/init.so in the ruby extension, so that the ruby extension is a dynamically linked library, that contains the entirety of the v8 object code.

Ah, that makes sense.

Here's a look at the relevant bits from the build directory (I pruned unrelated stuff):

build-dynamic
├── build
│   └── All.target.mk
├── Makefile
└── Release
    ├── cctest
    ├── d8
    ├── hello-world
    ├── lib.target
    │   └── libv8.so
    ├── mksnapshot
    └── obj.target
        └── tools
            └── gyp
                ├── js2c.stamp
                ├── libv8_base.a
                ├── libv8_libbase.a
                ├── libv8_libplatform.a
                ├── libv8_nosnapshot.a
                ├── libv8_snapshot.a
                ├── libv8.so
                └── v8_maybe_snapshot.stamp

So, the dynamic build doesn't link libv8_libplatform.a into libv8.so - although it does link it into executables like d8. When I try to hack the build's gyp files per my earlier comment , the symbols are there, but nm reports that they are local symbols and thus not visible.

I'm not sure what the "right" thing to do is. Have therubyracer dynamically link libv8.so while statically linking in libv8_libplatform.a (that's how the binaries like d8 are compiled)? Or try to produce a libv8.so with libv8_libplatform.a linked in (my C++ compiler tool-chain knowledge is too rusty to know how to fix the visibility of the symbols, and that also deviates from what the authors are doing)?

cowboyd commented 8 years ago

My inclination is to say that it should dynamically link libv8.so, and then statically link libv8_libplatform.a into the ruby extension.

cstrahan commented 8 years ago

I tried looking through the gyp file for any differences between how the libv8_libplatform and v8_base targets are defined, and I found this under v8_base:

        ['component=="shared_library"', {
          'defines': [
             'BUILDING_V8_SHARED',
             'V8_SHARED',
          ],
        }]

Which lead me to the definition of V8_EXPORT:

#if V8_HAS_ATTRIBUTE_VISIBILITY && defined(V8_SHARED)
# ifdef BUILDING_V8_SHARED
#  define V8_EXPORT __attribute__ ((visibility("default")))
# else
#  define V8_EXPORT
# endif
#else
# define V8_EXPORT
#endif

Which then lead me to reading the GCC docs on C++ visibility.

If I'm reading include/libplatform/libplatform.h correctly, it looks like CreateDefaultPlatform isn't exported. That header includes include/v8-platform.h, which doesn't include include/v8.h, and thus neither of those two headers export anything via V8_EXPORT.

I'm not entirely sure what to make of that, but I figured I'd share what I've found. If I'm right about the whole exporting thing, then I would think it would be unreasonable to expect any distributions to modify both the header files and the gyp build files in order to have a unified libv8.so, so perhaps dynamically linking libv8.so (if available, perhaps falling back to statically linking the *.a if not) and statically linking libv8_libplatform.a is the way to go.

In the NixOS package I'm writing, I think I'll build a dynamic library while also including all of the *.a in the package too.

cstrahan commented 8 years ago

My inclination is to say that it should dynamically link libv8.so, and then statically link libv8_libplatform.a into the ruby extension.

Ah, just saw your comment. Yeah, I think that's the way to go.

cstrahan commented 8 years ago

I modified the libv8 gem's System configuration to add:

        $libs = context.send(:append_library, $libs, 'v8_libplatform')

And when I try to build therubyracer, I get the following:

linking shared-object v8/init.so
/nix/store/6sqj15q4snqmydj5cq5hz9fzr6a031qs-v8-4.5.95.1/lib/libv8_libplatform.a: could not read symbols: Malformed archive

I've tried using the archives from both a dynamic and static build of v8, and both approached result in the above error.

From googling, it looks like you've seen similar reports in the past. Do you know what the root cause was?

cowboyd commented 8 years ago

Indeed, this is usually because the build generated a thin archive that only contains symbolic references to the filesystem and not the actuall object code. Althought it should work if you're building therubyracer and libv8 on the same machine...

cstrahan commented 8 years ago

Indeed, this is usually because the build generated a thin archive that only contains symbolic references to the filesystem and not the actuall object code.

Ah, that makes perfect sense. I believe that explains why, when enumerating with ar -t, the full paths are given to the original object files. I wasn't familiar with with thin archives, so I'm glad you pointed that out - I would have been stumped for a long while (tried fruitlessly to use readelf and others to gain some insight).

Althought it should work if you're building therubyracer and libv8 on the same machine...

I'm using the (as of yet unfinished) package I wrote for v8, and any build artifacts that I don't explicitly copy over to the prefix are deleted at the end of the build process, so those object files are gone by the time I try to build the therubyracer.

I think I can convert the thin archives to regular ones and have everything work. I'll give that a go after work today and let you know if that fixes the build, and if the 4.5 branch also (hopefully) fixes the segfault I reported.

Thanks for your help!

ignisf commented 8 years ago

I think I can convert the thin archives to regular ones and have everything work.

If you'll be trying to produce non-thin archives on the 4.5 branch, take a look at these:

https://github.com/cowboyd/libv8/commit/9999e40d597110bef5905a7716bebe4462eb83e6 https://github.com/cowboyd/libv8/pull/178#issuecomment-120828269 https://github.com/cowboyd/libv8/pull/185

cstrahan commented 8 years ago

@ignisf Awesome - thanks so much for pointing out those patches! That should solve the thin archive problem, and probably also fix unforeseen problems regarding PIC. Also, disabling tests is nice while I'm trying to iterate on this quickly.

cstrahan commented 8 years ago

Hm.... therubyracer now builds successfully, but fails with:

symbol lookup error: /home/cstrahan/.gem/extensions/x86_64-linux/2.2.0/therubyracer-0.12.1/v8/init.so: undefined symbol: _ZN2v84base5MutexC1Ev

Per nm, only the v8_libplatform symbols are defined - the rest are undefined. ldd reports the correct rpath for libv8.so. Here are the linker flags from the Makefile:

LIBS = $(LIBRUBYARG_SHARED) -lv8 -lv8_libplatform -lpthread  -lpthread -ldl -lcrypt -lm   -lc

(In what order should the the two v8 libs be specified? Does it matter here?)

cstrahan commented 8 years ago

I tried flipping the order of the two libs, but that didn't help.

cstrahan commented 8 years ago

Oh god:

00000000005fbfa0 t _ZN2v84base5MutexC1Ev

I really feel for you. Building v8 is an exercise in frustration.

cstrahan commented 8 years ago

Tried googling for "lv8 lv8_libplatform" to see if anyone else is doing what I'm trying to do. Looks like at least someone has some experience with this: https://github.com/pmed/v8pp/blob/9a5e206f1281a5c6e1cb7c414163b9a9619a3237/Makefile

@pmed do you think you could give some advice, pretty please? You'd be my hero :).

pmed commented 8 years ago

@cstrahan, V8 building might be a painful process. :) I have failed to use v8pp with Travis due v8 build issues.

Anyway, this base part in the missing symbol name _ZN2v84base5MutexC1Ev might give a clue to link against an additional libv8_libbase.a or libv8_base.a or both of them, which probably is used in libv8_libplatform.

@cstrahan, please let me know whether you managed to disable V8 tests. They take a lot of time and make the build process really slow.

ignisf commented 8 years ago

@pmed, https://github.com/cowboyd/libv8/blob/4.5/patches/disable-building-tests.patch

cstrahan commented 8 years ago

@pmed Aha! Thanks for pointing that out - now everything is working! And I can happily report that the segfault doesn't happen on this branch! I also tried building with v8 4.5.107, and that works too.

To help future people compiling v8, you can pass V=1 as a make flag when invoking the Makefile generated by gyp, which will give you verbose output. For reference, here's the line where the d8 executable is linked:

  g++ -pthread -fuse-ld=gold -B/tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/third_party/binutils/Linux_x64/Release/bin -fuse-ld=gold -B/tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/third_party/binutils/Linux_x64/Release/bin -L/nix/store/80a3md2fnc41f8n30ss2g7g65v0sqmia-icu4c-55.1/lib -licui18n -licuuc -licudata -m64 -m64 -Wl,-rpath=\$ORIGIN/lib.target/ -Wl,-rpath-link=\/tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/lib.target/  -o /tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/d8 -Wl,--start-group /tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/obj.target/d8/src/d8.o /tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/obj.target/d8/src/startup-data-util.o /tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/obj.target/d8/src/d8-readline.o /tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/obj.target/d8/src/d8-posix.o /tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/obj.target/tools/gyp/libv8.so /tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/obj.target/tools/gyp/libv8_libplatform.a /tmp/nix-build-v8-4.5.95.1.drv-17/v8-4.5.95.1-src/out/Release/obj.target/tools/gyp/libv8_libbase.a -Wl,--end-group -lreadline -ldl -lrt -licui18n -licuuc -licudata

Had I checked that earlier, I would have realized that I also needed to ensure -lv8_libbase was given.

Here's the patch that fixes ext/libv8/location.rb:

diff --git a/ext/libv8/location.rb b/ext/libv8/location.rb
index ddb63b2..3ce2fd5 100644
--- a/ext/libv8/location.rb
+++ b/ext/libv8/location.rb
@@ -53,6 +53,8 @@ module Libv8
         context.send(:dir_config, 'v8')
         context.send(:find_header, 'v8.h') or fail NotFoundError
         context.send(:find_header, 'libplatform/libplatform.h') or fail NotFoundError
+        $libs = context.send(:append_library, $libs, 'v8_libbase')
+        $libs = context.send(:append_library, $libs, 'v8_libplatform')
         context.send(:have_library, 'v8') or fail NotFoundError
       end

I would use context.send(:have_library, 'v8_libbase'), but, unless explicitly given a symbol to find, have_library attempts to find a symbol main, which will fail when given a static library. I suppose I could use one of the mangled C++ symbols, but I don't know if that's a good idea (I think that source-compatible changes in v8 could still result in ABI changes, making the symbol check fragile at best).

@ignisf @pmed @cowboyd: thank you for the help!

@cowboyd: when are you thinking about releasing 4.5? This some exciting work in general, and more specifically, should get GitLab working on NixOS again.

cstrahan commented 8 years ago

Also, it looks like Chrome 4.6 went stable on Oct. 13th: http://googlechromereleases.blogspot.com/2015/10/stable-channel-update.html

Current version info available here: https://omahaproxy.appspot.com/

Assuming the API didn't change much, it might be worthwhile jumping straight to v8 4.6.x.

cstrahan commented 8 years ago

For reference, here's the package I wrote for NixOS: https://github.com/NixOS/nixpkgs/commit/abf7301cc9a41dd212f87db7e918c951ae3a6a69

pmed commented 8 years ago

@cstrahan, I finally found the way how to build only V8 libraries without .gyp files patching. See build-v8.sh script in a commit pmed/v8pp@9222535cdf944cc3dac6ba122686539b83334ebf

The idea is to generate a Makefile with gyp manually and then to run make for v8 and v8_libplatform targets only.

I had to create an additional v8_options.gypi file to override V8 gyp build options, in particular to set standalone_static_library: 1 for static libraries.