[MacRuby] #1149: Occasional crash using smtp within a dispatch async

MacRuby ruby-noreply at macosforge.org
Thu Feb 3 19:33:16 PST 2011


#1149: Occasional crash using smtp within a dispatch async
---------------------------------------+------------------------------------
 Reporter:  matt.massicotte@…          |       Owner:  lsansonetti@…        
     Type:  defect                     |      Status:  new                  
 Priority:  major                      |   Milestone:                       
Component:  MacRuby                    |    Keywords:                       
---------------------------------------+------------------------------------
Description changed by watson1978@…:

Old description:

> I have macruby code that looks something like this:
>
> group = Dispatch::Group.new()
>
>       @cam_device_hash.values.each do |device|
>         Dispatch::Queue.concurrent.async(group) do
>           Net::SMTP.start("smpt.com") do |smtp|
>              .. email
>         end
>       end
>
>       group.wait()
>
> Occasionally, this code crashes macruby.  I cannot attach the full crash
> log to the bug: here's the best I can do.
>
> Thread 4 Crashed:  Dispatch queue: com.apple.root.default-priority
> 0   libSystem.B.dylib                   0x00007fffffe00660 __bzero + 96
> 1   libmacruby.dylib                    0x00000001000ef11f rb_fd_zero +
> 47
> 2   socket.bundle                       0x0000000104fe9548
> try_wait_connectable + 56
> 3   libmacruby.dylib                    0x00000001001514e5 rb_ensure + 37
> 4   socket.bundle                       0x0000000104fe934d ruby_connect +
> 461
> 5   socket.bundle                       0x0000000104fed3ce
> init_inetsock_internal + 254
> 6   libmacruby.dylib                    0x00000001001514e5 rb_ensure + 37
> 7   socket.bundle                       0x0000000104fe8f7f tcp_init + 143
> 8   libmacruby.dylib                    0x000000010014c0cc rb_vm_dispatch
> + 7676
> 9   libmacruby.dylib                    0x000000010006fe2a
> rb_class_new_instance + 538
> 10  libmacruby.dylib                    0x00000001000571d8 rb_io_binmode
> + 1224
> 11  libmacruby.dylib                    0x000000010014c0cc rb_vm_dispatch
> + 7676
> 12  smtp.rbo                            0x00000001056c12ac 0x1056c0000 +
> 4780
> 13  smtp.rbo                            0x00000001056c8790
> MREP_2C248079BA6B4801B49202DD35DFDA7F + 27552
> 14  libmacruby.dylib                    0x000000010014e993
> rb_vm_yield_args + 1923
> 15  timeout.rbo                         0x0000000100ff866d
> MREP_ECE09555A8A04827AFC1AB585E102057 + 3997
> 16  libmacruby.dylib                    0x000000010014c3e7 rb_vm_dispatch
> + 8471
> 17  timeout.rbo                         0x0000000100ff749c 0x100ff6000 +
> 5276
> 18  timeout.rbo                         0x0000000100ff942d
> MREP_ECE09555A8A04827AFC1AB585E102057 + 7517
> 19  libmacruby.dylib                    0x000000010014c3e7 rb_vm_dispatch
> + 8471
> 20  smtp.rbo                            0x00000001056c12ac 0x1056c0000 +
> 4780
> 21  smtp.rbo                            0x00000001056c7e54
> MREP_2C248079BA6B4801B49202DD35DFDA7F + 25188
> 22  libmacruby.dylib                    0x000000010014c67c rb_vm_dispatch
> + 9132
> 23  smtp.rbo                            0x00000001056c12ac 0x1056c0000 +
> 4780
> 24  smtp.rbo                            0x00000001056c77a3
> MREP_2C248079BA6B4801B49202DD35DFDA7F + 23475
> 25  libmacruby.dylib                    0x000000010014c67c rb_vm_dispatch
> + 9132
> 26  smtp.rbo                            0x00000001056c12ac 0x1056c0000 +
> 4780
> 27  smtp.rbo                            0x00000001056c73b7
> MREP_2C248079BA6B4801B49202DD35DFDA7F + 22471
> 28  libmacruby.dylib                    0x000000010014c612 rb_vm_dispatch
> + 9026
> 29  ???                                 0x0000000102d5b356 0 + 4342526806
> 30  ???                                 0x0000000105f3cfc6 0 + 4394831814
> 31  libmacruby.dylib                    0x000000010014c3bc rb_vm_dispatch
> + 8428
> 32  ???                                 0x0000000102d5b356 0 + 4342526806
> 33  ???                                 0x0000000105f3ca22 0 + 4394830370
> 34  libmacruby.dylib                    0x000000010014e977
> rb_vm_yield_args + 1895
> 35  libmacruby.dylib                    0x0000000100102d88 rb_yield + 40
> 36  libmacruby.dylib                    0x000000010001549d rary_reserve +
> 989
> 37  libmacruby.dylib                    0x000000010014c3bc rb_vm_dispatch
> + 8428
> 38  ???                                 0x0000000102d5b356 0 + 4342526806
> 39  ???                                 0x0000000105f3bd1d 0 + 4394827037
> 40  libmacruby.dylib                    0x000000010014d778
> rb_vm_block_eval + 1432
> 41  libmacruby.dylib                    0x000000010014c0cc rb_vm_dispatch
> + 7676
> 42  ???                                 0x0000000102d5b356 0 + 4342526806
> 43  ???                                 0x0000000105f3c573 0 + 4394829171
> 44  libmacruby.dylib                    0x000000010014d759
> rb_vm_block_eval + 1401
> 45  libmacruby.dylib                    0x000000010016025a rb_rescue2 +
> 58
> 46  libSystem.B.dylib                   0x00007fff800ec810
> _dispatch_worker_thread2 + 206
> 47  libSystem.B.dylib                   0x00007fff800ec168
> _pthread_wqthread + 353
> 48  libSystem.B.dylib                   0x00007fff800ec005 start_wqthread
> + 13

New description:

 I have macruby code that looks something like this:
 {{{
 #!ruby
 group = Dispatch::Group.new()

       @cam_device_hash.values.each do |device|
         Dispatch::Queue.concurrent.async(group) do
           Net::SMTP.start("smpt.com") do |smtp|
              .. email
         end
       end

       group.wait()
 }}}
 Occasionally, this code crashes macruby.  I cannot attach the full crash
 log to the bug: here's the best I can do.
 {{{
 Thread 4 Crashed:  Dispatch queue: com.apple.root.default-priority
 0   libSystem.B.dylib                   0x00007fffffe00660 __bzero + 96
 1   libmacruby.dylib                    0x00000001000ef11f rb_fd_zero + 47
 2   socket.bundle                       0x0000000104fe9548
 try_wait_connectable + 56
 3   libmacruby.dylib                    0x00000001001514e5 rb_ensure + 37
 4   socket.bundle                       0x0000000104fe934d ruby_connect +
 461
 5   socket.bundle                       0x0000000104fed3ce
 init_inetsock_internal + 254
 6   libmacruby.dylib                    0x00000001001514e5 rb_ensure + 37
 7   socket.bundle                       0x0000000104fe8f7f tcp_init + 143
 8   libmacruby.dylib                    0x000000010014c0cc rb_vm_dispatch
 + 7676
 9   libmacruby.dylib                    0x000000010006fe2a
 rb_class_new_instance + 538
 10  libmacruby.dylib                    0x00000001000571d8 rb_io_binmode +
 1224
 11  libmacruby.dylib                    0x000000010014c0cc rb_vm_dispatch
 + 7676
 12  smtp.rbo                            0x00000001056c12ac 0x1056c0000 +
 4780
 13  smtp.rbo                            0x00000001056c8790
 MREP_2C248079BA6B4801B49202DD35DFDA7F + 27552
 14  libmacruby.dylib                    0x000000010014e993
 rb_vm_yield_args + 1923
 15  timeout.rbo                         0x0000000100ff866d
 MREP_ECE09555A8A04827AFC1AB585E102057 + 3997
 16  libmacruby.dylib                    0x000000010014c3e7 rb_vm_dispatch
 + 8471
 17  timeout.rbo                         0x0000000100ff749c 0x100ff6000 +
 5276
 18  timeout.rbo                         0x0000000100ff942d
 MREP_ECE09555A8A04827AFC1AB585E102057 + 7517
 19  libmacruby.dylib                    0x000000010014c3e7 rb_vm_dispatch
 + 8471
 20  smtp.rbo                            0x00000001056c12ac 0x1056c0000 +
 4780
 21  smtp.rbo                            0x00000001056c7e54
 MREP_2C248079BA6B4801B49202DD35DFDA7F + 25188
 22  libmacruby.dylib                    0x000000010014c67c rb_vm_dispatch
 + 9132
 23  smtp.rbo                            0x00000001056c12ac 0x1056c0000 +
 4780
 24  smtp.rbo                            0x00000001056c77a3
 MREP_2C248079BA6B4801B49202DD35DFDA7F + 23475
 25  libmacruby.dylib                    0x000000010014c67c rb_vm_dispatch
 + 9132
 26  smtp.rbo                            0x00000001056c12ac 0x1056c0000 +
 4780
 27  smtp.rbo                            0x00000001056c73b7
 MREP_2C248079BA6B4801B49202DD35DFDA7F + 22471
 28  libmacruby.dylib                    0x000000010014c612 rb_vm_dispatch
 + 9026
 29  ???                                 0x0000000102d5b356 0 + 4342526806
 30  ???                                 0x0000000105f3cfc6 0 + 4394831814
 31  libmacruby.dylib                    0x000000010014c3bc rb_vm_dispatch
 + 8428
 32  ???                                 0x0000000102d5b356 0 + 4342526806
 33  ???                                 0x0000000105f3ca22 0 + 4394830370
 34  libmacruby.dylib                    0x000000010014e977
 rb_vm_yield_args + 1895
 35  libmacruby.dylib                    0x0000000100102d88 rb_yield + 40
 36  libmacruby.dylib                    0x000000010001549d rary_reserve +
 989
 37  libmacruby.dylib                    0x000000010014c3bc rb_vm_dispatch
 + 8428
 38  ???                                 0x0000000102d5b356 0 + 4342526806
 39  ???                                 0x0000000105f3bd1d 0 + 4394827037
 40  libmacruby.dylib                    0x000000010014d778
 rb_vm_block_eval + 1432
 41  libmacruby.dylib                    0x000000010014c0cc rb_vm_dispatch
 + 7676
 42  ???                                 0x0000000102d5b356 0 + 4342526806
 43  ???                                 0x0000000105f3c573 0 + 4394829171
 44  libmacruby.dylib                    0x000000010014d759
 rb_vm_block_eval + 1401
 45  libmacruby.dylib                    0x000000010016025a rb_rescue2 + 58
 46  libSystem.B.dylib                   0x00007fff800ec810
 _dispatch_worker_thread2 + 206
 47  libSystem.B.dylib                   0x00007fff800ec168
 _pthread_wqthread + 353
 48  libSystem.B.dylib                   0x00007fff800ec005 start_wqthread
 + 13
 }}}

--

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1149#comment:1>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list