d-unsed / ruru

Native Ruby extensions written in Rust
MIT License
832 stars 40 forks source link

Segfault with Thread::call_without_gvl #64

Closed Zapotek closed 7 years ago

Zapotek commented 7 years ago

Hello,

I'm getting a segfault when trying to run some code without the GVL.

This is the unsafe_method!:

    fn without_gvl( data: RString ) -> NilClass {
        let str       = data.to_string_unchecked();

        println!( "1 - {}", str );

        let comp    = || { process( str ) };
        let unblock = || {};
        let _       = Thread::call_without_gvl( comp, Some( unblock ) );

        NilClass::new()
    }

I've tried cloning the data prior to passing it to comp and using slices but I can't seem to get around the issue.

The process method is simply:

fn process( data: String ) {
    println!( "{}", data );
}

The Ruby code is:

MyObject.without_gvl( 's' )

Segfault:

1 - s
s
*** Error in `ruby': double free or corruption (fasttop): 0x0000000002c56100 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7efc344c57e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7fe0a)[0x7efc344cde0a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7efc344d198c]
/home/zapotek/workspace/project/lib/../ext/engine/target/release/libproject.so(_ZN4ruru7binding6thread19thread_call_callbox17h27239a4182525d2fE+0x27)[0x7efc29398397]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(rb_thread_call_without_gvl+0x45)[0x7efc34a14095]
/home/zapotek/workspace/project/lib/../ext/engine/target/release/libproject.so(without_gvl+0x149)[0x7efc293928a9]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1d5840)[0x7efc349ec840]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1e51ee)[0x7efc349fc1ee]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1e5763)[0x7efc349fc763]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1dec18)[0x7efc349f5c18]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1e3776)[0x7efc349fa776]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x8a299)[0x7efc348a1299]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x8a956)[0x7efc348a1956]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1d5840)[0x7efc349ec840]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1e51ee)[0x7efc349fc1ee]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1e5763)[0x7efc349fc763]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1dec18)[0x7efc349f5c18]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x1e3776)[0x7efc349fa776]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(+0x844ed)[0x7efc3489b4ed]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(ruby_exec_node+0x1d)[0x7efc3489d6ed]
/home/zapotek/.rvm/rubies/ruby-2.3.1/lib/libruby.so.2.3(ruby_run_node+0x1e)[0x7efc348a012e]
ruby[0x40087b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7efc3446e830]
ruby(_start+0x29)[0x4008a9]
======= Memory map: ========
00400000-00401000 r-xp 00000000 00:30 12600517                           /home/zapotek/.rvm/rubies/ruby-2.3.1/bin/ruby
00600000-00601000 r--p 00000000 00:30 12600517                           /home/zapotek/.rvm/rubies/ruby-2.3.1/bin/ruby
00601000-00602000 rw-p 00001000 00:30 12600517                           /home/zapotek/.rvm/rubies/ruby-2.3.1/bin/ruby
0076d000-0380c000 rw-p 00000000 00:00 0                                  [heap]
7efc24000000-7efc24021000 rw-p 00000000 00:00 0 
7efc24021000-7efc28000000 ---p 00000000 00:00 0 
7efc29250000-7efc295d4000 r-xp 00000000 00:30 11161149                   /home/zapotek/workspace/project/ext/engine/target/release/libproject.so
7efc295d4000-7efc297d3000 ---p 00384000 00:30 11161149                   /home/zapotek/workspace/project/ext/engine/target/release/libproject.so
7efc297d3000-7efc2988a000 r--p 00383000 00:30 11161149                   /home/zapotek/workspace/project/ext/engine/target/release/libproject.so
7efc2988a000-7efc2988c000 rw-p 0043a000 00:30 11161149                   /home/zapotek/workspace/project/ext/engine/target/release/libproject.so
7efc2988c000-7efc2988d000 r-xp 00000000 00:30 12602444                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/fcntl.so
7efc2988d000-7efc29a8c000 ---p 00001000 00:30 12602444                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/fcntl.so
7efc29a8c000-7efc29a8d000 r--p 00000000 00:30 12602444                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/fcntl.so
7efc29a8d000-7efc29a8e000 rw-p 00001000 00:30 12602444                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/fcntl.so
7efc29a8e000-7efc29aa5000 r-xp 00000000 08:21 6696923                    /usr/lib/x86_64-linux-gnu/gconv/CP932.so
7efc29aa5000-7efc29ca4000 ---p 00017000 08:21 6696923                    /usr/lib/x86_64-linux-gnu/gconv/CP932.so
7efc29ca4000-7efc29ca5000 r--p 00016000 08:21 6696923                    /usr/lib/x86_64-linux-gnu/gconv/CP932.so
7efc29ca5000-7efc29ca6000 rw-p 00017000 08:21 6696923                    /usr/lib/x86_64-linux-gnu/gconv/CP932.so
7efc29ca6000-7efc29caa000 r-xp 00000000 00:30 12602461                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/racc/cparse.so
7efc29caa000-7efc29ea9000 ---p 00004000 00:30 12602461                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/racc/cparse.so
7efc29ea9000-7efc29eaa000 r--p 00003000 00:30 12602461                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/racc/cparse.so
7efc29eaa000-7efc29eab000 rw-p 00004000 00:30 12602461                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/racc/cparse.so
7efc29eab000-7efc2a0d7000 r-xp 00000000 00:30 12850999                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/nokogiri-1.6.8.1/lib/nokogiri/nokogiri.so
7efc2a0d7000-7efc2a2d6000 ---p 0022c000 00:30 12850999                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/nokogiri-1.6.8.1/lib/nokogiri/nokogiri.so
7efc2a2d6000-7efc2a2de000 r--p 0022b000 00:30 12850999                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/nokogiri-1.6.8.1/lib/nokogiri/nokogiri.so
7efc2a2de000-7efc2a2e3000 rw-p 00233000 00:30 12850999                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/nokogiri-1.6.8.1/lib/nokogiri/nokogiri.so
7efc2a2e3000-7efc2a2e5000 rw-p 00000000 00:00 0 
7efc2a2e5000-7efc2a312000 r-xp 00000000 00:30 12727165                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/ox-2.4.8/ext/ox/ox.so
7efc2a312000-7efc2a511000 ---p 0002d000 00:30 12727165                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/ox-2.4.8/ext/ox/ox.so
7efc2a511000-7efc2a512000 r--p 0002c000 00:30 12727165                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/ox-2.4.8/ext/ox/ox.so
7efc2a512000-7efc2a514000 rw-p 0002d000 00:30 12727165                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/ox-2.4.8/ext/ox/ox.so
7efc2a514000-7efc2a529000 r-xp 00000000 00:30 12726949                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/msgpack-1.0.2/lib/msgpack/msgpack.so
7efc2a529000-7efc2a728000 ---p 00015000 00:30 12726949                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/msgpack-1.0.2/lib/msgpack/msgpack.so
7efc2a728000-7efc2a729000 r--p 00014000 00:30 12726949                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/msgpack-1.0.2/lib/msgpack/msgpack.so
7efc2a729000-7efc2a72a000 rw-p 00015000 00:30 12726949                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/msgpack-1.0.2/lib/msgpack/msgpack.so
7efc2a72a000-7efc2a732000 r-xp 00000000 00:30 12613473                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/http_parser.rb-0.6.0/lib/ruby_http_parser.so
7efc2a732000-7efc2a932000 ---p 00008000 00:30 12613473                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/http_parser.rb-0.6.0/lib/ruby_http_parser.so
7efc2a932000-7efc2a933000 r--p 00008000 00:30 12613473                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/http_parser.rb-0.6.0/lib/ruby_http_parser.so
7efc2a933000-7efc2a934000 rw-p 00009000 00:30 12613473                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/http_parser.rb-0.6.0/lib/ruby_http_parser.so
7efc2a934000-7efc2aa03000 r-xp 00000000 08:21 5649783                    /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
7efc2aa03000-7efc2ac03000 ---p 000cf000 08:21 5649783                    /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
7efc2ac03000-7efc2ac06000 r--p 000cf000 08:21 5649783                    /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
7efc2ac06000-7efc2ac08000 rw-p 000d2000 08:21 5649783                    /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
7efc2ac08000-7efc2ac09000 rw-p 00000000 00:00 0 
7efc2ac09000-7efc2ac4f000 r-xp 00000000 08:21 5649758                    /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
7efc2ac4f000-7efc2ae4f000 ---p 00046000 08:21 5649758                    /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
7efc2ae4f000-7efc2ae51000 r--p 00046000 08:21 5649758                    /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
7efc2ae51000-7efc2ae53000 rw-p 00048000 08:21 5649758                    /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
7efc2ae53000-7efc2ae54000 rw-p 00000000 00:00 0 
7efc2ae54000-7efc2ae62000 r-xp 00000000 08:21 5649727                    /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
7efc2ae62000-7efc2b061000 ---p 0000e000 08:21 5649727                    /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
7efc2b061000-7efc2b062000 r--p 0000d000 08:21 5649727                    /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
7efc2b062000-7efc2b063000 rw-p 0000e000 08:21 5649727                    /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
7efc2b063000-7efc2b08a000 r-xp 00000000 08:21 5649738                    /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
7efc2b08a000-7efc2b28a000 ---p 00027000 08:21 5649738                    /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
7efc2b28a000-7efc2b28b000 r--p 00027000 08:21 5649738                    /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
7efc2b28b000-7efc2b28c000 rw-p 00028000 08:21 5649738                    /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
7efc2b28c000-7efc2b2a1000 r-xp 00000000 08:21 5649292                    /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
7efc2b2a1000-7efc2b4a0000 ---p 00015000 08:21 5649292                    /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
7efc2b4a0000-7efc2b4a1000 r--p 00014000 08:21 5649292                    /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
7efc2b4a1000-7efc2b4a2000 rw-p 00015000 08:21 5649292                    /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
7efc2b4a2000-7efc2b4d2000 r-xp 00000000 08:21 5649719                    /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
7efc2b4d2000-7efc2b6d2000 ---p 00030000 08:21 5649719                    /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
7efc2b6d2000-7efc2b6d3000 r--p 00030000 08:21 5649719                    /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
7efc2b6d3000-7efc2b6d4000 rw-p 00031000 08:21 5649719                    /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
7efc2b6d4000-7efc2b6d5000 rw-p 00000000 00:00 0 
7efc2b6d5000-7efc2b6d8000 r-xp 00000000 08:21 9187269                    /lib/x86_64-linux-gnu/libcom_err.so.2.1
7efc2b6d8000-7efc2b8d7000 ---p 00003000 08:21 9187269                    /lib/x86_64-linux-gnu/libcom_err.so.2.1
7efc2b8d7000-7efc2b8d8000 r--p 00002000 08:21 9187269                    /lib/x86_64-linux-gnu/libcom_err.so.2.1
7efc2b8d8000-7efc2b8d9000 rw-p 00003000 08:21 9187269                    /lib/x86_64-linux-gnu/libcom_err.so.2.1
7efc2b8d9000-7efc2b978000 r-xp 00000000 08:21 5649878                    /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
7efc2b978000-7efc2bb77000 ---p 0009f000 08:21 5649878                    /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
7efc2bb77000-7efc2bb78000 r--p 0009e000 08:21 5649878                    /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
7efc2bb78000-7efc2bb7b000 rw-p 0009f000 08:21 5649878                    /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
7efc2bb7b000-7efc2bbff000 r-xp 00000000 08:21 5649773                    /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
7efc2bbff000-7efc2bdfe000 ---p 00084000 08:21 5649773                    /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
7efc2bdfe000-7efc2be01000 r--p 00083000 08:21 5649773                    /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
7efc2be01000-7efc2be04000 rw-p 00086000 08:21 5649773                    /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
7efc2be04000-7efc2be05000 rw-p 00000000 00:00 0 
7efc2be05000-7efc2be0d000 r-xp 00000000 08:21 5649815                    /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
7efc2be0d000-7efc2c00c000 ---p 00008000 08:21 5649815                    /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
7efc2c00c000-7efc2c00d000 r--p 00007000 08:21 5649815                    /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
7efc2c00d000-7efc2c00e000 rw-p 00008000 08:21 5649815                    /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
7efc2c00e000-7efc2c01f000 r-xp 00000000 08:21 5649409                    /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1
7efc2c01f000-7efc2c21f000 ---p 00011000 08:21 5649409                    /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1
7efc2c21f000-7efc2c220000 r--p 00011000 08:21 5649409                    /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1
7efc2c220000-7efc2c221000 rw-p 00012000 08:21 5649409                    /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1
7efc2c221000-7efc2c252000 r-xp 00000000 08:21 5647613                    /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15
7efc2c252000-7efc2c452000 ---p 00031000 08:21 5647613                    /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15
7efc2c452000-7efc2c453000 r--p 00031000 08:21 5647613                    /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15
7efc2c453000-7efc2c454000 rw-p 00032000 08:21 5647613                    /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15
7efc2c454000-7efc2c4ad000 r-xp 00000000 08:21 5652093                    /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0
7efc2c4ad000-7efc2c6ac000 ---p 00059000 08:21 5652093                    /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0
7efc2c6ac000-7efc2c6b6000 r--p 00058000 08:21 5652093                    /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0
7efc2c6b6000-7efc2c6b8000 rw-p 00062000 08:21 5652093                    /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0
7efc2c6b8000-7efc2c6f5000 r-xp 00000000 08:21 5649822                    /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
7efc2c6f5000-7efc2c8f5000 ---p 0003d000 08:21 5649822                    /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
7efc2c8f5000-7efc2c8f6000 r--p 0003d000 08:21 5649822                    /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
7efc2c8f6000-7efc2c8f8000 rw-p 0003e000 08:21 5649822                    /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
7efc2c8f8000-7efc2c8f9000 rw-p 00000000 00:00 0 
7efc2c8f9000-7efc2c912000 r-xp 00000000 08:21 5662184                    /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
7efc2c912000-7efc2cb12000 ---p 00019000 08:21 5662184                    /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
7efc2cb12000-7efc2cb13000 r--p 00019000 08:21 5662184                    /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
7efc2cb13000-7efc2cb14000 rw-p 0001a000 08:21 5662184                    /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
7efc2cb14000-7efc2cb2b000 r-xp 00000000 08:21 9188952                    /lib/x86_64-linux-gnu/libresolv-2.23.so
7efc2cb2b000-7efc2cd2b000 ---p 00017000 08:21 9188952                    /lib/x86_64-linux-gnu/libresolv-2.23.so
7efc2cd2b000-7efc2cd2c000 r--p 00017000 08:21 9188952                    /lib/x86_64-linux-gnu/libresolv-2.23.so
7efc2cd2c000-7efc2cd2d000 rw-p 00018000 08:21 9188952                    /lib/x86_64-linux-gnu/libresolv-2.23.so
7efc2cd2d000-7efc2cd2f000 rw-p 00000000 00:00 0 
7efc2cd2f000-7efc2cd63000 r-xp 00000000 08:21 5649094                    /usr/lib/x86_64-linux-gnu/libnettle.so.6.2
7efc2cd63000-7efc2cf62000 ---p 00034000 08:21 5649094                    /usr/lib/x86_64-linux-gnu/libnettle.so.6.2
7efc2cf62000-7efc2cf64000 r--p 00033000 08:21 5649094                    /usr/lib/x86_64-linux-gnu/libnettle.so.6.2
7efc2cf64000-7efc2cf65000 rw-p 00035000 08:21 5649094                    /usr/lib/x86_64-linux-gnu/libnettle.so.6.2
7efc2cf65000-7efc2cf97000 r-xp 00000000 08:21 5647284                    /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2
7efc2cf97000-7efc2d196000 ---p 00032000 08:21 5647284                    /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2
7efc2d196000-7efc2d197000 r--p 00031000 08:21 5647284                    /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2
7efc2d197000-7efc2d198000 rw-p 00032000 08:21 5647284                    /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2
7efc2d198000-7efc2d2bb000 r-xp 00000000 08:21 5651930                    /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
7efc2d2bb000-7efc2d4ba000 ---p 00123000 08:21 5651930                    /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
7efc2d4ba000-7efc2d4c5000 r--p 00122000 08:21 5651930                    /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
7efc2d4c5000-7efc2d4c7000 rw-p 0012d000 08:21 5651930                    /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
7efc2d4c7000-7efc2d4c8000 rw-p 00000000 00:00 0 
7efc2d4c8000-7efc2d515000 r-xp 00000000 08:21 5647521                    /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5
7efc2d515000-7efc2d714000 ---p 0004d000 08:21 5647521                    /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5
7efc2d714000-7efc2d716000 r--p 0004c000 08:21 5647521                    /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5
7efc2d716000-7efc2d717000 rw-p 0004e000 08:21 5647521                    /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5
7efc2d717000-7efc2d719000 rw-p 00000000 00:00 0 
7efc2d719000-7efc2d726000 r-xp 00000000 08:21 5647525                    /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5
7efc2d726000-7efc2d926000 ---p 0000d000 08:21 5647525                    /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5
7efc2d926000-7efc2d927000 r--p 0000d000 08:21 5647525                    /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5
7efc2d927000-7efc2d928000 rw-p 0000e000 08:21 5647525                    /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5
7efc2d928000-7efc2d943000 r-xp 00000000 08:21 5650429                    /usr/lib/x86_64-linux-gnu/librtmp.so.1
7efc2d943000-7efc2db42000 ---p 0001b000 08:21 5650429                    /usr/lib/x86_64-linux-gnu/librtmp.so.1
7efc2db42000-7efc2db43000 r--p 0001a000 08:21 5650429                    /usr/lib/x86_64-linux-gnu/librtmp.so.1
7efc2db43000-7efc2db44000 rw-p 0001b000 08:21 5650429                    /usr/lib/x86_64-linux-gnu/librtmp.so.1
7efc2db44000-7efc2db68000 r-xp 00000000 08:21 8792502                    /usr/local/lib/libnghttp2.so.14.12.4
7efc2db68000-7efc2dd67000 ---p 00024000 08:21 8792502                    /usr/local/lib/libnghttp2.so.14.12.4
7efc2dd67000-7efc2dd68000 r--p 00023000 08:21 8792502                    /usr/local/lib/libnghttp2.so.14.12.4
7efc2dd68000-7efc2dd6b000 rw-p 00024000 08:21 8792502                    /usr/local/lib/libnghttp2.so.14.12.4
7efc2dd6b000-7efc2ddda000 r-xp 00000000 08:21 8796226                    /usr/local/lib/libcurl.so.4.4.0
7efc2ddda000-7efc2dfda000 ---p 0006f000 08:21 8796226                    /usr/local/lib/libcurl.so.4.4.0
7efc2dfda000-7efc2dfdc000 r--p 0006f000 08:21 8796226                    /usr/local/lib/libcurl.so.4.4.0
7efc2dfdc000-7efc2dfdd000 rw-p 00071000 08:21 8796226                    /usr/local/lib/libcurl.so.4.4.0
7efc2dfdd000-7efc2dfff000 r-xp 00000000 00:30 12613168                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/ffi-1.9.17/lib/ffi_c.so
7efc2dfff000-7efc2e1ff000 ---p 00022000 00:30 12613168                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/ffi-1.9.17/lib/ffi_c.so
7efc2e1ff000-7efc2e200000 r--p 00022000 00:30 12613168                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/ffi-1.9.17/lib/ffi_c.so
7efc2e200000-7efc2e201000 rw-p 00023000 00:30 12613168                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/ffi-1.9.17/lib/ffi_c.so
7efc2e201000-7efc2e202000 r-xp 00000000 00:30 12602530                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/digest/md5.so
7efc2e202000-7efc2e401000 ---p 00001000 00:30 12602530                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/digest/md5.so
7efc2e401000-7efc2e402000 r--p 00000000 00:30 12602530                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/digest/md5.so
7efc2e402000-7efc2e403000 rw-p 00001000 00:30 12602530                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/digest/md5.so
7efc2e403000-7efc2e40e000 r-xp 00000000 08:21 9188944                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7efc2e40e000-7efc2e60d000 ---p 0000b000 08:21 9188944                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7efc2e60d000-7efc2e60e000 r--p 0000a000 08:21 9188944                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7efc2e60e000-7efc2e60f000 rw-p 0000b000 08:21 9188944                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7efc2e60f000-7efc2e615000 rw-p 00000000 00:00 0 
7efc2e615000-7efc2e62b000 r-xp 00000000 08:21 9187078                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7efc2e62b000-7efc2e82a000 ---p 00016000 08:21 9187078                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7efc2e82a000-7efc2e82b000 rw-p 00015000 08:21 9187078                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7efc2e82b000-7efc2e99d000 r-xp 00000000 08:21 5647563                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7efc2e99d000-7efc2eb9d000 ---p 00172000 08:21 5647563                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7efc2eb9d000-7efc2eba7000 r--p 00172000 08:21 5647563                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7efc2eba7000-7efc2eba9000 rw-p 0017c000 08:21 5647563                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7efc2eba9000-7efc2ebad000 rw-p 00000000 00:00 0 
7efc2ebad000-7efc2ecb0000 r-xp 00000000 00:30 12851989                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/google_hash-0.9.0/lib/google_hash.so
7efc2ecb0000-7efc2eeaf000 ---p 00103000 00:30 12851989                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/google_hash-0.9.0/lib/google_hash.so
7efc2eeaf000-7efc2eeb0000 r--p 00102000 00:30 12851989                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/google_hash-0.9.0/lib/google_hash.so
7efc2eeb0000-7efc2eeb1000 rw-p 00103000 00:30 12851989                   /home/zapotek/.rvm/gems/ruby-2.3.1@project/gems/google_hash-0.9.0/lib/google_hash.so
7efc2eeb1000-7efc2eeb2000 r-xp 00000000 00:30 12602525                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so
7efc2eeb2000-7efc2f0b2000 ---p 00001000 00:30 12602525                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so
7efc2f0b2000-7efc2f0b3000 r--p 00001000 00:30 12602525                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so
7efc2f0b3000-7efc2f0b4000 rw-p 00002000 00:30 12602525                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so
7efc2f0b4000-7efc2f0b5000 r-xp 00000000 00:30 12602471                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so
7efc2f0b5000-7efc2f2b5000 ---p 00001000 00:30 12602471                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so
7efc2f2b5000-7efc2f2b6000 r--p 00001000 00:30 12602471                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so
7efc2f2b6000-7efc2f2b7000 rw-p 00002000 00:30 12602471                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so
7efc2f2b7000-7efc2f2b8000 r-xp 00000000 00:30 12602532                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/digest/sha2.so
7efc2f2b8000-7efc2f4b8000 ---p 00001000 00:30 12602532                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/digest/sha2.so
7efc2f4b8000-7efc2f4b9000 r--p 00001000 00:30 12602532                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/digest/sha2.so
7efc2f4b9000-7efc2f4ba000 rw-p 00002000 00:30 12602532                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/digest/sha2.so
7efc2f4ba000-7efc2f4c0000 r-xp 00000000 00:30 12602442                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/strscan.so
7efc2f4c0000-7efc2f6bf000 ---p 00006000 00:30 12602442                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/strscan.so
7efc2f6bf000-7efc2f6c0000 r--p 00005000 00:30 12602442                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/strscan.so
7efc2f6c0000-7efc2f6c1000 rw-p 00006000 00:30 12602442                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/strscan.so
7efc2f6c1000-7efc2f6de000 r-xp 00000000 08:21 5649961                    /usr/lib/x86_64-linux-gnu/libyaml-0.so.2.0.4
7efc2f6de000-7efc2f8de000 ---p 0001d000 08:21 5649961                    /usr/lib/x86_64-linux-gnu/libyaml-0.so.2.0.4
7efc2f8de000-7efc2f8df000 r--p 0001d000 08:21 5649961                    /usr/lib/x86_64-linux-gnu/libyaml-0.so.2.0.4
7efc2f8df000-7efc2f8e0000 rw-p 0001e000 08:21 5649961                    /usr/lib/x86_64-linux-gnu/libyaml-0.so.2.0.4
7efc2f8e0000-7efc2f8e6000 r-xp 00000000 00:30 12602553                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/psych.so
7efc2f8e6000-7efc2fae5000 ---p 00006000 00:30 12602553                   /home/zapotek/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/psych.soAborted (core dumped)
jwilm commented 7 years ago

Does anything change if you make comp a move closure? Since it's a double free error, I get the impression that String is being freed twice. This could happen with unsafe and inappropriate bounds on call_without_gvl (maybe missing 'static).

Zapotek commented 7 years ago

That did the trick, thanks a lot @jwilm . :)

jwilm commented 7 years ago

@Zapotek You might want to reopen the issue. The compiler can protect you against this error pretty easily. Ruru needs to add a 'static bound to that closure argument.