Actions
Bug #17860
closedSegmentation fault when trying to grab blocks of memory using Fiddle
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-04-09T04:59:46Z master 582f4bc188) [x86_64-darwin20]
Description
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
Files
Updated by edipofederle (Édipo Féderle) almost 3 years ago
Updated by jeremyevans0 (Jeremy Evans) almost 3 years ago
- Status changed from Open to Rejected
Object#object_id
now returns an incrementing integer, it no longer is related to a place in memory. So you are referencing probably uninitialized memory, which should result in a segmentation fault.
Actions
Like0
Like0Like0