Core dump

I’m new to Ruby, so I may be doing something wrong, but the following
code continually gives me a core dump (Illegal instruction: 4 (core
dumped)) in both irb and ruby. I’m running versions:

ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-freebsd6]
feed-normalizer (1.3.0)


require ‘rubygems’
require ‘open-uri’
require ‘feed-normalizer’

feed = FeedNormalizer::FeedNormalizer.parse
open(‘reddit: the front page of the internet’)
feed.each {|line| print line, " "}


Ideas?

On 5/25/07, Steve [email protected] wrote:

require ‘feed-normalizer’

feed = FeedNormalizer::FeedNormalizer.parse open(‘reddit: the front page of the internet’)
feed.each {|line| print line, " "}


Ideas?

Can someone confirm this so I know if it’s my ruby compilation or not?

On May 27, 2007, at 17:03 , Steve wrote:

Can someone confirm this so I know if it’s my ruby compilation or not?

Why? Ruby shouldn’t core dump. Ever. Either ruby has a bug or a
binary extension does.
Did you do something freaky when you built your ruby?

If you can reproduce the error, rerun like so:

% gdb ruby

r script.rb
blah blah
BOOM!
bt
stack trace

I am using Ruby 1.8.6 for Windows and would like to use that version of
Ruby from the cygwin bash prompt.I have added the following to my
.bashrc:

Ruby - have ruby use the Windows version

alias ruby=’/cygdrive/c/ruby/bin/ruby.exe’
alias erb=’/cygdrive/c/ruby/bin/erb.bat’
alias gem=’/cygdrive/c/ruby/bin/gem.bat’
alias fxri=’/cygdrive/c/ruby/bin/fxri.bat’
alias gem_mirror=’/cygdrive/c/ruby/bin/gem_mirror.bat’
alias gem_server=’/cygdrive/c/ruby/bin/gem_server.bat’
alias gemhelp=’/cygdrive/c/ruby/bin/gemhelp.bat’
alias gemwhich=’/cygdrive/c/ruby/bin/gemwhich.bat’
alias irb=’/cygdrive/c/ruby/bin/irb.bat’
alias rake=’/cygdrive/c/ruby/bin/rake.bat’
alias ri=’/cygdrive/c/ruby/bin/ri.bat’
alias testrb=’/cygdrive/c/bin/testrb.bat’
alias update_rubygems=’/cygdrive/c/ruby/bin/update_rubygems.bat’
alias iconv=’/cygdrivec/ruby/bin/iconv.exe’
alias rubyw=’/cygdrive/c/ruby/bin/rubyw.exe’

I was trying to run the simple Tk app from Programming Ruby:

#!/cygdrive/c/ruby/bin/ruby -w
require ‘tk’
root = TkRoot.new { title “Ex1” }
TkLabel.new(root) do
text ‘hi there’
pack(‘padx’ => 15, ‘pady’ => 15, ‘side’ => ‘left’)
end
Tk.mainloop

I am able to run the program from the Dos prompt, but the program hangs
when run from the cygwin prompt.
So far programs not using Tk have run okay from cygwin.
Any suggestions on what I can check would be appreciated.
TIA,
Kevin

Hi,

What’s concerned with core dump using feed-normalizer?

At Mon, 28 May 2007 10:32:37 +0900,
Kev wrote in [ruby-talk:253272]:

I am able to run the program from the Dos prompt, but the program hangs
when run from the cygwin prompt.
So far programs not using Tk have run okay from cygwin.

Seems you use non-cygwin ruby but cygwin Tk dll might be
loaded.

On 5/27/07, Ryan D. [email protected] wrote:

If you can reproduce the error, rerun like so:

% gdb ruby

r script.rb
blah blah
BOOM!
bt
stack trace

It’s a long stack trace, so I’ve posted only part of it. I can
provide the complete trace if needed.

$ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-freebsd6]

$gdb
(gdb) r crash.rb
Starting program: /usr/local/bin/ruby crash.rb
warning: Unable to get location for thread creation breakpoint: generic
error
[New LWP 100090]
[New Thread 0x8053000 (LWP 100114)]

Program received signal SIGBUS, Bus error.
[Switching to Thread 0x8053000 (LWP 100090)]
0x280a16dc in rb_eval (self=148154120, n=0x84a69d0) at eval.c:2901
2901 eval.c: No such file or directory.
in eval.c
(gdb) bt
#0 0x280a16dc in rb_eval (self=148154120, n=0x84a69d0) at eval.c:2901
#1 0x280a31d2 in rb_eval (self=148154120, n=0x84a6908) at eval.c:3441
#2 0x280a31d2 in rb_eval (self=148154120, n=0x84a68f4) at eval.c:3441
#3 0x280a2db3 in rb_eval (self=148154120, n=0x84a68cc) at eval.c:3391
#4 0x280a2820 in rb_eval (self=148154120, n=0x84a67f0) at eval.c:3263
#5 0x280a95f4 in rb_call0 (klass=139078040, recv=148154120, id=3889,
oid=3889, argc=0, argv=0xbfa01124, body=0x84a67f0, flags=0) at
eval.c:5966
#6 0x280aa0b6 in rb_call (klass=139078040, recv=148154120, mid=3889,
argc=1, argv=0xbfa01120, scope=1, self=6) at eval.c:6062
#7 0x280aa3ee in rb_funcall2 (recv=148154120, mid=3889, argc=1,
argv=0xbfa01120) at eval.c:6198
#8 0x280a8949 in method_missing (obj=148154120, id=50513, argc=0,
argv=0xbfa013f4, call_status=0) at eval.c:5639
#9 0x280a9fcf in rb_call (klass=139079040, recv=148154120, mid=50513,
argc=0, argv=0xbfa013f4, scope=1, self=6) at eval.c:6041
#10 0x280aa1e1 in rb_f_send (argc=0, argv=0xbfa013f4, recv=148154120)
at eval.c:6110
#11 0x280a995d in call_cfunc (func=0x280aa14c <rb_f_send>,
recv=148154120, len=-1, argc=1, argv=0xbfa013f0) at eval.c:5659
#12 0x280a8e71 in rb_call0 (klass=134786200, recv=148154120, id=4049,
oid=4049, argc=1, argv=0xbfa013f0, body=0x8088d44, flags=0) at
eval.c:5815
#13 0x280aa0b6 in rb_call (klass=134786200, recv=148154120, mid=4049,
argc=1, argv=0xbfa013f0, scope=0, self=148154120) at eval.c:6062
#14 0x280a33c7 in rb_eval (self=148154120, n=0x84a6908) at eval.c:3447
#15 0x280a31d2 in rb_eval (self=148154120, n=0x84a68f4) at eval.c:3441
#16 0x280a2db3 in rb_eval (self=148154120, n=0x84a68cc) at eval.c:3391
#17 0x280a2820 in rb_eval (self=148154120, n=0x84a67f0) at eval.c:3263
#18 0x280a95f4 in rb_call0 (klass=139078040, recv=148154120, id=3889,
oid=3889, argc=0, argv=0xbfa02224, body=0x84a67f0, flags=0) at
eval.c:5966
#19 0x280aa0b6 in rb_call (klass=139078040, recv=148154120, mid=3889,
argc=1, argv=0xbfa02220, scope=1, self=6) at eval.c:6062
#20 0x280aa3ee in rb_funcall2 (recv=148154120, mid=3889, argc=1,
argv=0xbfa02220) at eval.c:6198
#21 0x280a8949 in method_missing (obj=148154120, id=50505, argc=0,
argv=0xbfa024f4, call_status=0) at eval.c:5639
#22 0x280a9fcf in rb_call (klass=139079040, recv=148154120, mid=50505,
argc=0, argv=0xbfa024f4, scope=1, self=6) at eval.c:6041
#23 0x280aa1e1 in rb_f_send (argc=0, argv=0xbfa024f4, recv=148154120)
at eval.c:6110
#24 0x280a995d in call_cfunc (func=0x280aa14c <rb_f_send>,
recv=148154120, len=-1, argc=1, argv=0xbfa024f0) at eval.c:5659
#25 0x280a8e71 in rb_call0 (klass=134786200, recv=148154120, id=4049,
oid=4049, argc=1, argv=0xbfa024f0, body=0x8088d44, flags=0) at
eval.c:5815
#26 0x280aa0b6 in rb_call (klass=134786200, recv=148154120, mid=4049,
argc=1, argv=0xbfa024f0, scope=0, self=148154120) at eval.c:6062
#27 0x280a33c7 in rb_eval (self=148154120, n=0x84a6908) at eval.c:3447
#28 0x280a31d2 in rb_eval (self=148154120, n=0x84a68f4) at eval.c:3441
#29 0x280a2db3 in rb_eval (self=148154120, n=0x84a68cc) at eval.c:3391
#30 0x280a2820 in rb_eval (self=148154120, n=0x84a67f0) at eval.c:3263

[…]

#6208 0x280aa3ee in rb_funcall2 (recv=148154120, mid=3889, argc=1,
argv=0xbfbfbe20) at eval.c:6198
#6209 0x280a8949 in method_missing (obj=148154120, id=46697, argc=0,
argv=0xbfbfc0f4, call_status=0) at eval.c:5639
#6210 0x280a9fcf in rb_call (klass=139079040, recv=148154120,
mid=46697, argc=0, argv=0xbfbfc0f4, scope=1, self=6) at eval.c:6041
#6211 0x280aa1e1 in rb_f_send (argc=0, argv=0xbfbfc0f4,
recv=148154120) at eval.c:6110
#6212 0x280a995d in call_cfunc (func=0x280aa14c <rb_f_send>,
recv=148154120, len=-1, argc=1, argv=0xbfbfc0f0) at eval.c:5659
#6213 0x280a8e71 in rb_call0 (klass=134786200, recv=148154120,
id=4049, oid=4049, argc=1, argv=0xbfbfc0f0, body=0x8088d44, flags=0)
at eval.c:5815
#6214 0x280aa0b6 in rb_call (klass=134786200, recv=148154120,
mid=4049, argc=1, argv=0xbfbfc0f0, scope=0, self=148154120) at
eval.c:6062
#6215 0x280a33c7 in rb_eval (self=148154120, n=0x84a6908) at eval.c:3447
#6216 0x280a31d2 in rb_eval (self=148154120, n=0x84a68f4) at eval.c:3441
#6217 0x280a2db3 in rb_eval (self=148154120, n=0x84a68cc) at eval.c:3391
#6218 0x280a2820 in rb_eval (self=148154120, n=0x84a67f0) at eval.c:3263
#6219 0x280a95f4 in rb_call0 (klass=139078040, recv=148154120,
id=3889, oid=3889, argc=0, argv=0xbfbfcf24, body=0x84a67f0, flags=0)
at eval.c:5966
#6220 0x280aa0b6 in rb_call (klass=139078040, recv=148154120,
mid=3889, argc=1, argv=0xbfbfcf20, scope=1, self=6) at eval.c:6062
#6221 0x280aa3ee in rb_funcall2 (recv=148154120, mid=3889, argc=1,
argv=0xbfbfcf20) at eval.c:6198
#6222 0x280a8949 in method_missing (obj=148154120, id=46689, argc=0,
argv=0xbfbfd1f4, call_status=0) at eval.c:5639
#6223 0x280a9fcf in rb_call (klass=139079040, recv=148154120,
mid=46689, argc=0, argv=0xbfbfd1f4, scope=1, self=6) at eval.c:6041
#6224 0x280aa1e1 in rb_f_send (argc=0, argv=0xbfbfd1f4,
recv=148154120) at eval.c:6110
#6225 0x280a995d in call_cfunc (func=0x280aa14c <rb_f_send>,
recv=148154120, len=-1, argc=1, argv=0xbfbfd1f0) at eval.c:5659
#6226 0x280a8e71 in rb_call0 (klass=134786200, recv=148154120,
id=4049, oid=4049, argc=1, argv=0xbfbfd1f0, body=0x8088d44, flags=0)
at eval.c:5815
#6227 0x280aa0b6 in rb_call (klass=134786200, recv=148154120,
mid=4049, argc=1, argv=0xbfbfd1f0, scope=0, self=148154120) at
eval.c:6062
#6228 0x280a33c7 in rb_eval (self=148154120, n=0x84a6908) at eval.c:3447
#6229 0x280a31d2 in rb_eval (self=148154120, n=0x84a68f4) at eval.c:3441
#6230 0x280a2db3 in rb_eval (self=148154120, n=0x84a68cc) at eval.c:3391
#6231 0x280a2820 in rb_eval (self=148154120, n=0x84a67f0) at eval.c:3263
#6232 0x280a95f4 in rb_call0 (klass=139078040, recv=148154120,
id=3889, oid=3889, argc=0, argv=0xbfbfe024, body=0x84a67f0, flags=0)
at eval.c:5966
#6233 0x280aa0b6 in rb_call (klass=139078040, recv=148154120,
mid=3889, argc=1, argv=0xbfbfe020, scope=1, self=6) at eval.c:6062
#6234 0x280aa3ee in rb_funcall2 (recv=148154120, mid=3889, argc=1,
argv=0xbfbfe020) at eval.c:6198
#6235 0x280a8949 in method_missing (obj=148154120, id=3841, argc=0,
argv=0x0, call_status=0) at eval.c:5639
#6236 0x280a9fcf in rb_call (klass=139079040, recv=148154120,
mid=3841, argc=0, argv=0x0, scope=0, self=134781340) at eval.c:6041
#6237 0x280a33c7 in rb_eval (self=134781340, n=0x807a500) at eval.c:3447
#6238 0x280a23b4 in rb_eval (self=134781340, n=0x807a6e0) at eval.c:3177
#6239 0x2809e842 in eval_node (self=134781340, node=0x807a6e0) at
eval.c:1423
#6240 0x2809eef6 in ruby_exec_internal () at eval.c:1608
#6241 0x2809ef63 in ruby_exec () at eval.c:1628
#6242 0x2809ef95 in ruby_run () at eval.c:1638
#6243 0x0804866f in main (argc=2, argv=0xbfbfe8c8, envp=0xbfbfe8d4) at
main.c:48
(gdb)