From: edipofederle@... Date: 2021-05-13T00:16:09+00:00 Subject: [ruby-core:103810] [Ruby master Bug#17860] Segmentation fault when trying to grab blocks of memory using Fiddle Issue #17860 has been reported by edipofederle (�dipo F�derle). ---------------------------------------- Bug #17860: Segmentation fault when trying to grab blocks of memory using Fiddle https://bugs.ruby-lang.org/issues/17860 * Author: edipofederle (�dipo F�derle) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0dev (2021-04-09T04:59:46Z master 582f4bc188) [x86_64-darwin20] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Reproduce process **ruby version:** ruby 3.1.0dev (2021-04-09T04:59:46Z master 582f4bc188) [x86_64-darwin20] Install ruby with: ``` $ git clone git@github.com:ruby/ruby.git $ cd ruby $ autoconf $ ./configure --prefix=$PWD/local $ make $ make install ``` create a test.rb file with: ``` require 'fiddle' str = "Hello world!" str_ptr_int = str.object_id << 1 str_ptr = Fiddle::Pointer.new str_ptr_int str_ptr.to_i == str_ptr_int r_basic = str_ptr[0, Fiddle::SIZEOF_LONG*2] ``` Inside compiled `ruby` directly run: `$ ./local/bin/ruby test.rb` -- https://bugs.ruby-lang.org/ Unsubscribe: