[MacRuby-devel] [MacRuby] #802: Assertion or Segfault occurs when calls the Zlib::Deflate.deflate.

MacRuby ruby-noreply at macosforge.org
Tue Jul 20 11:30:55 PDT 2010


#802: Assertion or Segfault occurs when calls the Zlib::Deflate.deflate.
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Test Script:
 {{{
 #!ruby
 $ cat test_zlib.rb
 require 'zlib'

 # Assertion (Sometimes)
 10.times do
   string = "a"
   Zlib::Deflate.deflate(string)
 end

 # Segfault
 10.times do
   string = "abc" * 1024
   Zlib::Deflate.deflate(string)
 end
 }}}

 The stack trace of Assertion:
 {{{
 DYLD_LIBRARY_PATH=. gdb --args ./macruby -I./lib test_zlib.rb
 GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10
 UTC 2010)
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you
 are
 welcome to change it and/or distribute copies of it under certain
 conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for
 details.
 This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
 shared libraries ..... done

 (gdb) r
 Starting program: /Users/watson/src/MacRuby/macruby -I./lib test_zlib.rb
 Reading symbols for shared libraries .++++.......................... done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries warning: .o file
 "/Users/watson/src/MacRuby/ext/zlib/zlib.o" more recent than executable
 timestamp in
 "/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/site_ruby/1.9.2
 /universal-darwin10.0/zlib.bundle"
 warning: Could not open OSO file /Users/watson/src/MacRuby/ext/zlib/zlib.o
 to scan for pubtypes for objfile
 /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/site_ruby/1.9.2
 /universal-darwin10.0/zlib.bundle
 . done
 Assertion failed: (IS_BSTR(str)), function rb_bstr_length, file string.c,
 line 5950.

 Program received signal SIGABRT, Aborted.
 0x00007fff815783d6 in __kill ()
 (gdb) thread apply all bt

 Thread 4 (process 40636):
 #0  0x00007fff81543eaa in __workq_kernreturn ()
 #1  0x00007fff815442bc in _pthread_wqthread ()
 #2  0x00007fff81543f25 in start_wqthread ()

 Thread 3 (process 40636):
 #0  0x00007fff8178e4d5 in
 Auto::visitAllocatedBlocks<Auto::scan_retained_and_old_blocks_visitor> ()
 #1  0x00007fff8178d944 in
 Auto::MemoryScanner::scan_retained_and_old_blocks ()
 #2  0x00007fff81788a67 in Auto::Collector::check_roots ()
 #3  0x00007fff8178d8b1 in Auto::MemoryScanner::scan ()
 #4  0x00007fff8178277d in Auto::Zone::collect ()
 #5  0x00007fff8176bb2e in auto_collect_internal ()
 #6  0x00007fff8176c16d in auto_collection_work ()
 #7  0x00007fff815661b0 in _dispatch_call_block_and_release ()
 #8  0x00007fff81544d52 in _dispatch_queue_drain ()
 #9  0x00007fff81544bb4 in _dispatch_queue_invoke ()
 #10 0x00007fff8154475e in _dispatch_worker_thread2 ()
 #11 0x00007fff81544088 in _pthread_wqthread ()
 #12 0x00007fff81543f25 in start_wqthread ()

 Thread 2 (process 40636):
 #0  0x00007fff8154308a in kevent ()
 #1  0x00007fff81544f5d in _dispatch_mgr_invoke ()
 #2  0x00007fff81544c34 in _dispatch_queue_invoke ()
 #3  0x00007fff8154475e in _dispatch_worker_thread2 ()
 #4  0x00007fff81544088 in _pthread_wqthread ()
 #5  0x00007fff81543f25 in start_wqthread ()

 Thread 1 (process 40636):
 #0  0x00007fff815783d6 in __kill ()
 #1  0x00007fff81618972 in abort ()
 #2  0x00007fff816059b4 in __assert_rtn ()
 #3  0x00000001000b525d in rb_bstr_length (str=8590779680) at string.c:5950
 warning: .o file "/Users/watson/src/MacRuby/ext/zlib/zlib.o" more recent
 than executable timestamp in
 "/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/site_ruby/1.9.2
 /universal-darwin10.0/zlib.bundle"
 warning: Couldn't open object file
 '/Users/watson/src/MacRuby/ext/zlib/zlib.o'
 #4  0x000000010179fcc3 in deflate_run ()
 #5  0x00000001001390d5 in rb_ensure () at vm.cpp:3410
 #6  0x000000010179e7ee in rb_deflate_s_deflate ()
 #7  0x000000010012de85 in ruby_dispatch [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:435
 #8  0x000000010012de85 in rb_vm_dispatch () at dispatcher.cpp:816
 #9  0x0000000101f06510 in ?? ()
 #10 0x0000000101f06902 in ?? ()
 #11 0x00000001001346d3 in __rb_vm_bcall [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:98
 #12 0x00000001001346d3 in vm_block_eval [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:1162
 #13 0x00000001001346d3 in rb_vm_yield_args () at dispatcher.cpp:1217
 #14 0x00000001000e1e42 in rb_vm_yield (argc=1, argv=0x7fff5fbfe088) at
 vm.h:629
 #15 0x00000001000e1e15 in rb_yield (val=1) at vm_eval.c:196
 #16 0x0000000100059eef in int_dotimes (num=41, sel=0x1016d8600) at
 numeric.c:3226
 #17 0x000000010012e484 in __rb_vm_rcall [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:159
 #18 0x000000010012e484 in ruby_dispatch [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:453
 #19 0x000000010012e484 in rb_vm_dispatch () at dispatcher.cpp:816
 #20 0x0000000101f06510 in ?? ()
 #21 0x0000000101f060cf in ?? ()
 #22 0x0000000100147df2 in rb_vm_run (fname=0x2000c03c0 "test_zlib.rb",
 node=0x2000c35c0, binding=0x0, inside_eval=false) at vm.cpp:3789
 #23 0x0000000100037a33 in ruby_run_node (n=0x2000c35c0) at eval.c:211
 #24 0x0000000100000c15 in main (argc=3, argv=0x10161de80,
 envp=0x7fff5fbff208) at main.cpp:40
 (gdb)
 }}}

 The stack trace of Segfault:
 {{{
 $ DYLD_LIBRARY_PATH=. gdb --args ./macruby -I./lib test_zlib.rb
 GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10
 UTC 2010)
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you
 are
 welcome to change it and/or distribute copies of it under certain
 conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for
 details.
 This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
 shared libraries ..... done

 (gdb) r
 Starting program: /Users/watson/src/MacRuby/macruby -I./lib test_zlib.rb
 Reading symbols for shared libraries .++++.......................... done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries warning: .o file
 "/Users/watson/src/MacRuby/ext/zlib/zlib.o" more recent than executable
 timestamp in
 "/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/site_ruby/1.9.2
 /universal-darwin10.0/zlib.bundle"
 warning: Could not open OSO file /Users/watson/src/MacRuby/ext/zlib/zlib.o
 to scan for pubtypes for objfile
 /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/site_ruby/1.9.2
 /universal-darwin10.0/zlib.bundle
 . done
 warning: .o file "/Users/watson/src/MacRuby/ext/zlib/zlib.o" more recent
 than executable timestamp in
 "/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/site_ruby/1.9.2
 /universal-darwin10.0/zlib.bundle"
 warning: Couldn't open object file
 '/Users/watson/src/MacRuby/ext/zlib/zlib.o'

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000010
 0x000000010179f011 in zstream_run ()
 (gdb) thread apply all bt

 Thread 4 (process 40727):
 #0  0x00007fff8178eb7b in
 Auto::visitAllocatedBlocks<Auto::scan_retained_and_old_blocks_visitor> ()
 #1  0x00007fff8178d944 in
 Auto::MemoryScanner::scan_retained_and_old_blocks ()
 #2  0x00007fff81788a67 in Auto::Collector::check_roots ()
 #3  0x00007fff8178d8b1 in Auto::MemoryScanner::scan ()
 #4  0x00007fff8178277d in Auto::Zone::collect ()
 #5  0x00007fff8176bb2e in auto_collect_internal ()
 #6  0x00007fff8176c16d in auto_collection_work ()
 #7  0x00007fff815661b0 in _dispatch_call_block_and_release ()
 #8  0x00007fff81544d52 in _dispatch_queue_drain ()
 #9  0x00007fff81544bb4 in _dispatch_queue_invoke ()
 #10 0x00007fff8154475e in _dispatch_worker_thread2 ()
 #11 0x00007fff81544088 in _pthread_wqthread ()
 #12 0x00007fff81543f25 in start_wqthread ()

 Thread 3 (process 40727):
 #0  0x00007fff81543eaa in __workq_kernreturn ()
 #1  0x00007fff815442bc in _pthread_wqthread ()
 #2  0x00007fff81543f25 in start_wqthread ()

 Thread 2 (process 40727):
 #0  0x00007fff8154308a in kevent ()
 #1  0x00007fff81544f5d in _dispatch_mgr_invoke ()
 #2  0x00007fff81544c34 in _dispatch_queue_invoke ()
 #3  0x00007fff8154475e in _dispatch_worker_thread2 ()
 #4  0x00007fff81544088 in _pthread_wqthread ()
 #5  0x00007fff81543f25 in start_wqthread ()

 Thread 1 (process 40727):
 #0  0x000000010179f011 in zstream_run ()
 #1  0x000000010179fce1 in deflate_run ()
 #2  0x00000001001390d5 in rb_ensure () at vm.cpp:3410
 #3  0x000000010179e7ee in rb_deflate_s_deflate ()
 #4  0x000000010012de85 in ruby_dispatch [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:435
 #5  0x000000010012de85 in rb_vm_dispatch () at dispatcher.cpp:816
 #6  0x0000000103ddd4a0 in ?? ()
 #7  0x0000000103ddd8b3 in ?? ()
 #8  0x00000001001346d3 in __rb_vm_bcall [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:98
 #9  0x00000001001346d3 in vm_block_eval [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:1162
 #10 0x00000001001346d3 in rb_vm_yield_args () at dispatcher.cpp:1217
 #11 0x00000001000e1e42 in rb_vm_yield (argc=1, argv=0x7fff5fbfe098) at
 vm.h:629
 #12 0x00000001000e1e15 in rb_yield (val=9) at vm_eval.c:196
 #13 0x0000000100059eef in int_dotimes (num=41, sel=0x1016d8630) at
 numeric.c:3226
 #14 0x000000010012e484 in __rb_vm_rcall [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:159
 #15 0x000000010012e484 in ruby_dispatch [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:453
 #16 0x000000010012e484 in rb_vm_dispatch () at dispatcher.cpp:816
 #17 0x0000000103ddd4a0 in ?? ()
 #18 0x0000000103ddd0cb in ?? ()
 #19 0x0000000100147df2 in rb_vm_run (fname=0x2000c0320 "test_zlib.rb",
 node=0x2000c2340, binding=0x0, inside_eval=false) at vm.cpp:3789
 #20 0x0000000100037a33 in ruby_run_node (n=0x2000c2340) at eval.c:211
 #21 0x0000000100000c15 in main (argc=3, argv=0x10161de80,
 envp=0x7fff5fbff208) at main.cpp:40
 (gdb)
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/802>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list