[MacRuby] #1175: Datamapper causing macruby to segfault.
#1175: Datamapper causing macruby to segfault. ------------------------------+--------------------------------------------- Reporter: jhamor@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- When trying to use datamapper, i'm seeing segfaults for at least the sqlite & rest adapters. These are happening around seemingly basic functionality. Snippets below: {{{ $macirb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'stringio' => true irb(main):003:0> require 'dm-core' => true irb(main):004:0> DataMapper::Logger.new($stdout, :debug) => #<DataMapper::Logger:0x20094f600 @init_args=[#<IO:<STDOUT>>, :debug] @level=0 @buffer=[] @delimiter=" ~ " @auto_flush=true @log=#<IO:<STDOUT>>> irb(main):005:0> DataMapper.setup(:default, 'sqlite::memory:') => #<DataMapper::Adapters::SqliteAdapter:0x2009586c0 @name=:default @options={"scheme"=>"sqlite", "user"=>nil, "password"=>nil, "host"=>nil, "port"=>nil, "path"=>":memory:", "query"=>nil, "fragment"=>nil, "adapter"=>"sqlite3", "database"=>""} @resource_naming_convention=DataMapper::NamingConventions::Resource::UnderscoredAndPluralized @field_naming_convention=DataMapper::NamingConventions::Field::Underscored @normalized_uri=#<struct DataObjects::URI scheme="sqlite3", user=nil, password=nil, host=nil, port=nil, path=":memory:", query=nil, fragment=nil>> irb(main):006:0> class Users irb(main):007:1> include DataMapper::Resource irb(main):008:1> irb(main):009:1> property :login, String, :key => true irb(main):010:1> property :id, Integer irb(main):011:1> property :gecos, String irb(main):012:1> property :shell, String irb(main):013:0> end => #<DataMapper::Property::String @model=Users @name=:shell> irb(main):014:0> Users => Users irb(main):015:0> Users.new Segmentation fault $ macruby -v MacRuby 0.9 (ruby 1.9.2) [universal-darwin10.0, x86_64] $ }}} To demonstrate this in standard ruby: {{{ $ irb
require 'rubygems' => false require 'stringio' => true require 'dm-core' => true DataMapper::Logger.new($stdout, :debug) => #<DataMapper::Logger:0x1011fa2c8 @buffer=[], @log=#<IO:0x100177ba8>, @level=0, @auto_flush=true, @delimiter=" ~ ", @init_args=[#<IO:0x100177ba8>, :debug]> DataMapper.setup(:default, 'sqlite::memory:') => #<DataMapper::Adapters::SqliteAdapter:0x10110f8b8 @name=:default, @options={"port"=>nil, "adapter"=>"sqlite3", "fragment"=>nil, "scheme"=>"sqlite", "path"=>":memory:", "database"=>"", "host"=>nil, "user"=>nil, "password"=>nil, "query"=>nil}, @resource_naming_convention=DataMapper::NamingConventions::Resource::UnderscoredAndPluralized, @field_naming_convention=DataMapper::NamingConventions::Field::Underscored, @normalized_uri=#<struct DataObjects::URI scheme="sqlite3", user=nil, password=nil, host=nil, port=nil, path=":memory:", query=nil, fragment=nil>> class Users include DataMapper::Resource
?> property :login, String, :key => true
property :id, Integer property :gecos, String property :shell, String end => #<DataMapper::Property::String @model=Users @name=:shell> Users => Users Users.new => #<Users @login=nil @id=nil @gecos=nil @shell=nil>
}}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1175> MacRuby <http://macruby.org/>
#1175: Datamapper causing macruby to segfault. ------------------------------+--------------------------------------------- Reporter: jhamor@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(by jhamor@…): Just to add a reference: http://datamapper.org/getting-started -- Ticket URL: <http://www.macruby.org/trac/ticket/1175#comment:1> MacRuby <http://macruby.org/>
#1175: Datamapper causing macruby to segfault. ------------------------------+--------------------------------------------- Reporter: jhamor@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.10 Component: MacRuby | Resolution: duplicate Keywords: | ------------------------------+--------------------------------------------- Changes (by watson1978@…): * status: new => closed * resolution: => duplicate * milestone: => MacRuby 0.10 Comment: BackTrace with r5242: {{{ Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x0000000100039362 in protect_rescue (obj=0, exc=8598821440) at eval.c:490 490 *(int *)obj = 1; (gdb) bt 20 #0 0x0000000100039362 in protect_rescue (obj=0, exc=8598821440) at eval.c:490 #1 0x000000010015508d in rb_rescue2 (b_proc=0x10003664e <safe_inspect>, data1=8593060608, r_proc=0x10003934e <protect_rescue>, data2=0) at vm.cpp:3500 #2 0x00000001000393db in rb_protect (proc=0x10003664e <safe_inspect>, data=8593060608, state=0x0) at eval.c:502 #3 0x0000000100036735 in name_err_mesg_to_str (obj=8593060608, sel=0x100ec60e0) at error.c:831 #4 0x000000010013bdb0 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:159 #5 0x000000010013bdb0 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:466 #6 0x000000010013bdb0 in rb_vm_dispatch () at dispatcher.cpp:863 #7 0x000000010005e0f9 in rb_vm_call0 (vm=0x100e23a80, top=0, self=8596340704, klass=0x20003a160, sel=0x100ec60e0, block=0x0, opt=2 '\002', argc=0, argv=0x0) at vm.h:637 #8 0x000000010005df8a in rb_vm_call (self=8596340704, sel=0x100ec60e0, argc=0, argv=0x0) at vm.h:644 #9 0x00000001000628d9 in convert_type (val=8596340704, tname=0x100906450 "String", method=0x100906208 "to_str", raise=2) at object.c:2515 #10 0x000000010006292b in rb_convert_type (val=8596340704, type=5, tname=0x100906450 "String", method=0x100906208 "to_str") at object.c:2524 #11 0x00000001000bbf96 in rb_str_to_str (str=8596340704) at string.c:6381 #12 0x00000001000bbf2f in rb_string_value (ptr=0x7fff5fbf80c0) at string.c:6366 #13 0x0000000100036241 in name_err_to_s (exc=8597447680, sel=0x100e27cb0) at error.c:725 #14 0x000000010013bdb0 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:159 #15 0x000000010013bdb0 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:466 #16 0x000000010013bdb0 in rb_vm_dispatch () at dispatcher.cpp:863 #17 0x00000001000e81d2 in rb_vm_call0 (vm=0x100e23a80, top=0, self=8597447680, klass=0x200039a60, sel=0x100e27cb0, block=0x0, opt=2 '\002', argc=0, argv=0x0) at vm.h:637 #18 0x00000001000e92a5 in rb_vm_call2 (block=0x0, self=8597447680, klass=8590170720, sel=0x100e27cb0, argc=0, argv=0x0) at vm.h:662 #19 0x00000001000e9145 in rb_call (recv=8597447680, mid=11472, argc=0, argv=0x0, scope=1, pass_current_block=false) at vm_eval.c:32 (More stack frames follow...) Current language: auto; currently c (gdb) }}} This issue is same problem as #1166. This issue will not reproduce if you will use http://www.macruby.org/files/nightlies/macruby_nightly-latest.pkg -- Ticket URL: <http://www.macruby.org/trac/ticket/1175#comment:2> MacRuby <http://macruby.org/>
#1175: Datamapper causing macruby to segfault. ------------------------------+--------------------------------------------- Reporter: jhamor@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: duplicate Keywords: | ------------------------------+--------------------------------------------- Changes (by watson1978@…): * milestone: MacRuby 0.10 => -- Ticket URL: <http://www.macruby.org/trac/ticket/1175#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby