I''m using the current release branch from the repository (version_0) on freebsd 6.1 with ruby 1.8.4. This is the error that is generated when running the code below at the bottom of the message, plus a gdb bt. Sorry no debugging symbols built into ruby but maybe the bt will help anyways. terminate called after throwing an instance of ''std::runtime_error'' what(): unimplemented Abort trap: 6 (core dumped) #0 0x2826b397 in kill () from /lib/libc.so.6 #1 0x281834f6 in raise () from /usr/lib/libpthread.so.2 #2 0x28269e62 in abort () from /lib/libc.so.6 #3 0x2845b5b5 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.5 #4 0x28460795 in __cxxabiv1::__terminate () from /usr/lib/libstdc++.so.5 #5 0x284607d2 in std::terminate () from /usr/lib/libstdc++.so.5 #6 0x28460712 in __cxa_throw () from /usr/lib/libstdc++.so.5 #7 0x2829f75d in EventMachine_t::ConnectToServer () from /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so #8 0x282a4433 in evma_connect_to_server () from /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so #9 0x282a25fe in t_connect_server () from /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so #10 0x280a57b4 in rb_call0 () from /usr/local/lib/libruby18.so.18 #11 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 #12 0x280a0000 in rb_eval () from /usr/local/lib/libruby18.so.18 #13 0x280a0aad in rb_eval () from /usr/local/lib/libruby18.so.18 #14 0x280a61c9 in rb_call0 () from /usr/local/lib/libruby18.so.18 #15 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 #16 0x2809fd7a in rb_eval () from /usr/local/lib/libruby18.so.18 #17 0x280a35bb in rb_yield_0 () from /usr/local/lib/libruby18.so.18 #18 0x280abdfc in proc_invoke () from /usr/local/lib/libruby18.so.18 #19 0x280abfb8 in proc_call () from /usr/local/lib/libruby18.so.18 #20 0x280a5749 in rb_call0 () from /usr/local/lib/libruby18.so.18 #21 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 #22 0x2809fd7a in rb_eval () from /usr/local/lib/libruby18.so.18 #23 0x280a61c9 in rb_call0 () from /usr/local/lib/libruby18.so.18 #24 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 #25 0x280a69f9 in vafuncall () from /usr/local/lib/libruby18.so.18 #26 0x280a6a3c in rb_funcall () from /usr/local/lib/libruby18.so.18 #27 0x282a22f7 in event_callback () from /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so #28 0x2829f402 in EventMachine_t::_RunTimers () from /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so #29 0x2829ed4c in EventMachine_t::Run () from /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so #30 0x282a4245 in evma_run_machine () from /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so #31 0x282a2357 in t_run_machine_without_threads () from /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so #32 0x280a5779 in rb_call0 () from /usr/local/lib/libruby18.so.18 #33 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 #34 0x280a0087 in rb_eval () from /usr/local/lib/libruby18.so.18 #35 0x280a61c9 in rb_call0 () from /usr/local/lib/libruby18.so.18 #36 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 #37 0x2809fd7a in rb_eval () from /usr/local/lib/libruby18.so.18 ---Type <return> to continue, or q <return> to quit--- #38 0x2809ee12 in rb_eval () from /usr/local/lib/libruby18.so.18 #39 0x2809b283 in eval_node () from /usr/local/lib/libruby18.so.18 #40 0x2809b857 in ruby_exec_internal () from /usr/local/lib/libruby18.so.18 #41 0x2809b8d2 in ruby_exec () from /usr/local/lib/libruby18.so.18 #42 0x2809b90e in ruby_run () from /usr/local/lib/libruby18.so.18 #43 0x08048694 in main () ------------------------------------------------------- require ''eventmachine'' class DumbHttpClient < EventMachine::Connection def initialize *args super # whatever else you want to do here end def post_init #start_tls send_data "GET / HTTP/1.1\r\nHost: shop.paymentonline.com\r\n\r\n" @data = "" end def receive_data data @data << data if @data =~ /[\n][\r]*[\n]/m puts "RECEIVED HTTP HEADER:" $`.each {|line| puts ">>> #{line}" } puts "Now we''ll terminate the loop, which will also close the connection" EventMachine::stop_event_loop end end def unbind puts "A connection has terminated" end end # DumbHttpClient EventMachine::run { EventMachine::connect "69.25.136.32", 80, DumbHttpClient }
Francis Cianfrocca
2006-Aug-08 11:56 UTC
[Eventmachine-talk] Core dump using sample DumbHttpClient
Got it- investigating asap. On 8/8/06, snacktime <snacktime at gmail.com> wrote:> I''m using the current release branch from the repository (version_0) > on freebsd 6.1 with ruby 1.8.4. This is the error that is generated > when running the code below at the bottom of the message, plus a gdb > bt. Sorry no debugging symbols built into ruby but maybe the bt will > help anyways. > > terminate called after throwing an instance of ''std::runtime_error'' > what(): unimplemented > Abort trap: 6 (core dumped) > > #0 0x2826b397 in kill () from /lib/libc.so.6 > #1 0x281834f6 in raise () from /usr/lib/libpthread.so.2 > #2 0x28269e62 in abort () from /lib/libc.so.6 > #3 0x2845b5b5 in __gnu_cxx::__verbose_terminate_handler () from > /usr/lib/libstdc++.so.5 > #4 0x28460795 in __cxxabiv1::__terminate () from /usr/lib/libstdc++.so.5 > #5 0x284607d2 in std::terminate () from /usr/lib/libstdc++.so.5 > #6 0x28460712 in __cxa_throw () from /usr/lib/libstdc++.so.5 > #7 0x2829f75d in EventMachine_t::ConnectToServer () from > /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so > #8 0x282a4433 in evma_connect_to_server () from > /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so > #9 0x282a25fe in t_connect_server () from > /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so > #10 0x280a57b4 in rb_call0 () from /usr/local/lib/libruby18.so.18 > #11 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 > #12 0x280a0000 in rb_eval () from /usr/local/lib/libruby18.so.18 > #13 0x280a0aad in rb_eval () from /usr/local/lib/libruby18.so.18 > #14 0x280a61c9 in rb_call0 () from /usr/local/lib/libruby18.so.18 > #15 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 > #16 0x2809fd7a in rb_eval () from /usr/local/lib/libruby18.so.18 > #17 0x280a35bb in rb_yield_0 () from /usr/local/lib/libruby18.so.18 > #18 0x280abdfc in proc_invoke () from /usr/local/lib/libruby18.so.18 > #19 0x280abfb8 in proc_call () from /usr/local/lib/libruby18.so.18 > #20 0x280a5749 in rb_call0 () from /usr/local/lib/libruby18.so.18 > #21 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 > #22 0x2809fd7a in rb_eval () from /usr/local/lib/libruby18.so.18 > #23 0x280a61c9 in rb_call0 () from /usr/local/lib/libruby18.so.18 > #24 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 > #25 0x280a69f9 in vafuncall () from /usr/local/lib/libruby18.so.18 > #26 0x280a6a3c in rb_funcall () from /usr/local/lib/libruby18.so.18 > #27 0x282a22f7 in event_callback () from > /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so > #28 0x2829f402 in EventMachine_t::_RunTimers () from > /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so > #29 0x2829ed4c in EventMachine_t::Run () from > /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so > #30 0x282a4245 in evma_run_machine () from > /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so > #31 0x282a2357 in t_run_machine_without_threads () from > /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd6/rubyeventmachine.so > #32 0x280a5779 in rb_call0 () from /usr/local/lib/libruby18.so.18 > #33 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 > #34 0x280a0087 in rb_eval () from /usr/local/lib/libruby18.so.18 > #35 0x280a61c9 in rb_call0 () from /usr/local/lib/libruby18.so.18 > #36 0x280a66c6 in rb_call () from /usr/local/lib/libruby18.so.18 > #37 0x2809fd7a in rb_eval () from /usr/local/lib/libruby18.so.18 > ---Type <return> to continue, or q <return> to quit--- > #38 0x2809ee12 in rb_eval () from /usr/local/lib/libruby18.so.18 > #39 0x2809b283 in eval_node () from /usr/local/lib/libruby18.so.18 > #40 0x2809b857 in ruby_exec_internal () from /usr/local/lib/libruby18.so.18 > #41 0x2809b8d2 in ruby_exec () from /usr/local/lib/libruby18.so.18 > #42 0x2809b90e in ruby_run () from /usr/local/lib/libruby18.so.18 > #43 0x08048694 in main () > > ------------------------------------------------------- > require ''eventmachine'' > > class DumbHttpClient < EventMachine::Connection > def initialize *args > super > # whatever else you want to do here > end > > def post_init > #start_tls > send_data "GET / HTTP/1.1\r\nHost: shop.paymentonline.com\r\n\r\n" > @data = "" > end > > def receive_data data > @data << data > if @data =~ /[\n][\r]*[\n]/m > puts "RECEIVED HTTP HEADER:" > $`.each {|line| puts ">>> #{line}" } > > puts "Now we''ll terminate the loop, which will also close the > connection" > EventMachine::stop_event_loop > end > end > > def unbind > puts "A connection has terminated" > end > > end # DumbHttpClient > > > EventMachine::run { > EventMachine::connect "69.25.136.32", 80, DumbHttpClient > } > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >
Francis Cianfrocca
2006-Aug-08 12:32 UTC
[Eventmachine-talk] Core dump using sample DumbHttpClient
Snacktime, the following code works on my Linux box, can you try it: #-------------------------------- require ''rubygems'' require ''eventmachine'' module DumbClient def post_init send_data "GET / HTTP/1.1\r\nHost: shop.paymentonline\r\n\r\n" end def receive_data data puts data end end EventMachine.run { EventMachine.connect "69.25.136.32", 80, DumbClient } #-------------------------------- If you get this far, then we''ll take the next step and figure out what''s wrong with your little state machine.
On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> Snacktime, the following code works on my Linux box, can you try it:Get the same error and coredump. I wonder if it''s due to ruby not being built with pthread support? pthread/ruby on freebsd have some issues, so people generally don''t enable pthreads and the freebsd port defaults to not building pthread support. Chris
Francis Cianfrocca
2006-Aug-08 12:47 UTC
[Eventmachine-talk] Core dump using sample DumbHttpClient
EventMachine only uses threads in the most recent unpublished versions, and only if you call #defer. Grab the version 0.5.3 gem off Rubyforge and see if it gives you the same problem. On 8/8/06, snacktime <snacktime at gmail.com> wrote:> On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote: > > Snacktime, the following code works on my Linux box, can you try it: > > Get the same error and coredump. I wonder if it''s due to ruby not > being built with pthread support? pthread/ruby on freebsd have some > issues, so people generally don''t enable pthreads and the freebsd port > defaults to not building pthread support. > > Chris > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >
Francis Cianfrocca
2006-Aug-08 12:50 UTC
[Eventmachine-talk] Core dump using sample DumbHttpClient
Chris, I think something else is going on, that is simpler. I''ll bet EM is throwing a C++ exception. That can happen if there is a failure to connect to the address you''re trying to hit. Try to telnet to that address on port 80 from a command shell. Also, does the fault happen instantly when your program starts, or does it take a few seconds? On 8/8/06, snacktime <snacktime at gmail.com> wrote:> On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote: > > Snacktime, the following code works on my Linux box, can you try it: > > Get the same error and coredump. I wonder if it''s due to ruby not > being built with pthread support? pthread/ruby on freebsd have some > issues, so people generally don''t enable pthreads and the freebsd port > defaults to not building pthread support. > > Chris > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >
On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> EventMachine only uses threads in the most recent unpublished > versions, and only if you call #defer. Grab the version 0.5.3 gem off > Rubyforge and see if it gives you the same problem.0.5.3 works fine, I have that installed in a different server (same OS and version). I also got that exact same error message the first time I used #defer in a little server I wrote. I can''t remember all the details, but I figured out I was calling it too soon or something and changed it, and now it''s working fine.
Francis Cianfrocca
2006-Aug-08 12:56 UTC
[Eventmachine-talk] Core dump using sample DumbHttpClient
Ok, waiting for word from you. Meantime I''m seeing a possible place for the exception that is being thrown: file ext/em.cpp, line 412. If you feel like getting your hands dirty, you can put a print statement right above the throw to see if it gets executed. On 8/8/06, snacktime <snacktime at gmail.com> wrote:> On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote: > > Snacktime, the following code works on my Linux box, can you try it: > > Get the same error and coredump. I wonder if it''s due to ruby not > being built with pthread support? pthread/ruby on freebsd have some > issues, so people generally don''t enable pthreads and the freebsd port > defaults to not building pthread support. > > Chris > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >
On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> Chris, I think something else is going on, that is simpler. I''ll bet > EM is throwing a C++ exception. That can happen if there is a failure > to connect to the address you''re trying to hit. Try to telnet to that > address on port 80 from a command shell. Also, does the fault happen > instantly when your program starts, or does it take a few seconds?No that''s not it. It dumps instantly, not like it tried to connect and then couldn''t.
On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> Ok, waiting for word from you. Meantime I''m seeing a possible place > for the exception that is being thrown: file ext/em.cpp, line 412. If > you feel like getting your hands dirty, you can put a print statement > right above the throw to see if it gets executed.Yep it''s line 412 that''s throwing the exception.
Francis Cianfrocca
2006-Aug-08 13:05 UTC
[Eventmachine-talk] Core dump using sample DumbHttpClient
Ok, are you game for trying a patch? Can I chat with you on gmail? On 8/8/06, snacktime <snacktime at gmail.com> wrote:> On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote: > > Ok, waiting for word from you. Meantime I''m seeing a possible place > > for the exception that is being thrown: file ext/em.cpp, line 412. If > > you feel like getting your hands dirty, you can put a print statement > > right above the throw to see if it gets executed. > > Yep it''s line 412 that''s throwing the exception. > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >
On 8/8/06, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> Ok, are you game for trying a patch? Can I chat with you on gmail?Sure. Haven''t ever used the gmail chat before though, can''t be that difficult:)