Project

General

Profile

Actions

Bug #2973

closed

rb_bug - Segmentation fault - error.c:213

Added by rudolf (r stu3) over 14 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
ruby -v:
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-netbsdelf]
[ruby-core:28687]

Description

=begin
hi, i have a ruby-1.8.7 install on netbsd-5, which is crashing quite frequently. i can provide the core and other additional info.
here is a backtrace:

Program terminated with signal 6, Aborted.
#0 0xbbac1767 in _lwp_kill () from /usr/lib/libc.so.12
(gdb) bt
#0 0xbbac1767 in _lwp_kill () from /usr/lib/libc.so.12
#1 0xbbac1726 in raise (s=6) at /usr/src/lib/libc/gen/raise.c:48
#2 0xbbac0f2c in abort () at /usr/src/lib/libc/stdlib/abort.c:74
#3 0xbbb32443 in rb_bug (fmt=0xbbbd3cdd "Segmentation fault") at error.c:213
#4 0xbbba2039 in sigsegv (sig=11) at signal.c:634
#5
#6 pthread_exit (retval=0x1) at /usr/src/lib/libpthread/pthread.c:526
#7 0xb8d3ad89 in pthread__cancelled () at /usr/src/lib/libpthread/pthread.c:896
#8 0xb8d36493 in poll (fds=0xbfbc8b04, nfds=1, timeout=0) at /usr/src/lib/libpthread/pthread_cancelstub.c:378
#9 0xb95eb524 in net_clear (net=0xb8b8c800) at net.c:236
#10 0xb95e7d26 in cli_advanced_command (mysql=0xb8b8c800, command=COM_QUERY, header=0x0, header_length=0, arg=0xb6f6e220 "SHOW FIELDS FROM users", arg_length=24, skip_check=1 '\001', stmt=0x0) at client.c:723
#11 0xb95e45d3 in mysql_send_query (mysql=0xb8b8c800, query=0xb6f6e220 "SHOW FIELDS FROM users", length=24) at client.c:2817
#12 0xb95e4660 in mysql_real_query (mysql=0xb8b8c800, query=0xb6f6e220 "SHOW FIELDS FROM users", length=24) at client.c:2828
#13 0xba42308f in query (obj=3130842660, sql=3084416320) at mysql.c:760
#14 0xbbb3661e in call_cfunc (func=0xba423010 , recv=3130842660, len=-1078198260, argc=7353, argv=0xbfbc8dd0) at eval.c:5784
#15 0xbbb406e9 in rb_call0 (klass=3117803040, recv=3130842660, id=16321, oid=16321, argc=-1165156936, argv=0xbfbc8dd0, body=0xb9d5dd38, flags=) at eval.c:5928
#16 0xbbb4150f in rb_call (klass=3117803040, recv=3130842660, mid=16321, argc=1, argv=0xbfbc8dd0, scope=0, self=3130825240) at eval.c:6176
#17 0xbbb3e0ce in rb_eval (self=3130825240, n=) at eval.c:3506
#18 0xbbb3c074 in rb_yield_0 (val=6, self=3130825240, klass=, flags=, avalue=0) at eval.c:5095
#19 0xbbb3e388 in rb_eval (self=3130825240, n=) at eval.c:3311
#20 0xbbb3d4f2 in rb_eval (self=3130825240, n=) at eval.c:3691
#21 0xbbb3c074 in rb_yield_0 (val=6, self=3130825240, klass=, flags=, avalue=0) at eval.c:5095
#22 0xbbb3e388 in rb_eval (self=3137569380, n=) at eval.c:3311
#23 0xbbb3c074 in rb_yield_0 (val=6, self=3137569380, klass=, flags=, avalue=0) at eval.c:5095
#24 0xbbb3e388 in rb_eval (self=3137569380, n=) at eval.c:3311
#25 0xbbb410ce in rb_call0 (klass=3137569280, recv=3137569380, id=41473, oid=41473, argc=0, argv=0x0, body=0xbb041b5c, flags=) at eval.c:6079
#26 0xbbb4150f in rb_call (klass=3137569280, recv=3137569380, mid=41473, argc=0, argv=0x0, scope=1, self=3137569380) at eval.c:6176
#27 0xbbb3e1f9 in rb_eval (self=3137569380, n=) at eval.c:3521
#28 0xbbb40164 in rb_eval (self=3137569380, n=) at eval.c:3236
#29 0xbbb3e050 in rb_eval (self=3137569380, n=) at eval.c:3501
#30 0xbbb410ce in rb_call0 (klass=3137569280, recv=3137569380, id=41489, oid=41489, argc=0, argv=0x0, body=0xbb048a38, flags=) at eval.c:6079
=end

Actions #1

Updated by rudolf (r stu3) over 14 years ago

=begin
i've now compiled ruby 1.8.8dev (2010-03-13) (i.e. ruby_1_8 branch) and it's crashing with the same backtrace.
=end

Actions #2

Updated by naruse (Yui NARUSE) over 14 years ago

  • Status changed from Open to Third Party's Issue

=begin
It is MySQL adaptor or libmysql's bug, please report this to there.
=end

Actions #3

Updated by taca (Takahiro Kambe) over 14 years ago

=begin
This problem might be related to #2603 and you had better try patches attached to #2739.
I received a private mail, but I write to here for memorandum record.
=end

Actions #4

Updated by rudolf (r stu3) over 14 years ago

=begin
Taca: thanks, i've confirmed the problem is still present in ruby_1_8 (r26956), there should be the patches from #2739 already included

Yui: i've installed the 'ruby-mysql' gem instead of the 'mysql' gem now (and also made an upgrade of mysql from 5.0.90 to 5.1.44, but this probably is not significant). i can still bring the app to crash and it seems to me, now it is pure ruby (without mysql code involved):

Program received signal SIGSEGV, Segmentation fault.
0xb98b8c27 in pthread_exit (retval=0x1) at /usr/src/lib/libpthread/pthread.c:526
526 }
(gdb) bt
#0 0xb98b8c27 in pthread_exit (retval=0x1) at /usr/src/lib/libpthread/pthread.c:526
#1 0xb98b8d89 in pthread__cancelled () at /usr/src/lib/libpthread/pthread.c:896
#2 0xb98b4b39 in fcntl (fd=11, cmd=3) at /usr/src/lib/libpthread/pthread_cancelstub.c:185
#3 0xbbb5078f in io_fwrite (str=3085207420, fptr=0xb9643da0) at io.c:454
#4 0xbbb57c7f in io_write (io=3085802960, str=3085207420) at io.c:602
#5 0xbbb2a82e in call_cfunc (func=0xbbb57b70 <io_write>, recv=3085802960, len=893832, argc=-1145210616, argv=0xbfbfb4c0) at eval.c:5861
#6 0xbbb35109 in rb_call0 (klass=3145897400, recv=3085802960, id=7385, oid=7385, argc=-1145210616, argv=0xbfbfb4c0, body=0xbb828f00, flags=) at eval.c:6005
#7 0xbbb35f4f in rb_call (klass=3145897400, recv=3085802960, mid=7385, argc=1, argv=0xbfbfb4c0, scope=0, self=3085801380) at eval.c:6257
#8 0xbbb32165 in rb_eval (self=3085801380, n=) at eval.c:3568
#9 0xbbb333f6 in rb_eval (self=3085801380, n=) at eval.c:3382
#10 0xbbb35aee in rb_call0 (klass=3138364640, recv=3085801380, id=7385, oid=7385, argc=0, argv=0xbfbfba70, body=0xbb0faf1c, flags=) at eval.c:6160
#11 0xbbb35f4f in rb_call (klass=3138364640, recv=3085801380, mid=7385, argc=1, argv=0xbfbfba70, scope=0, self=3103098700) at eval.c:6257
#12 0xbbb32165 in rb_eval (self=3103098700, n=) at eval.c:3568
#13 0xbbb3eaa4 in rb_yield_0 (val=3085207420, self=3103098700, klass=, flags=, avalue=0) at eval.c:5167
#14 0xbbb4014d in rb_yield (val=3085207420) at eval.c:5251
#15 0xbbb9fea5 in rb_str_each_line (argc=0, argv=0x0, str=3083915440) at string.c:3900
#16 0xbbb2a852 in call_cfunc (func=0xbbb9fd30 <rb_str_each_line>, recv=3083915440, len=893832, argc=-1145210616, argv=0x0) at eval.c:5855
#17 0xbbb35109 in rb_call0 (klass=3145929720, recv=3083915440, id=4961, oid=4961, argc=-1077951308, argv=0x0, body=0xbb830660, flags=) at eval.c:6005
#18 0xbbb35f4f in rb_call (klass=3145929720, recv=3083915440, mid=4961, argc=0, argv=0x0, scope=0, self=3086564500) at eval.c:6257
#19 0xbbb32165 in rb_eval (self=3086564500, n=) at eval.c:3568
#20 0xbbb3924a in rb_block_pass (func=0xbbb341c0 <call_block>, arg=3217015892, proc=3085212040) at eval.c:9288
#21 0xbbb322fe in rb_eval (self=3086564500, n=) at eval.c:9362
#22 0xbbb35aee in rb_call0 (klass=3105092260, recv=3086564500, id=4001, oid=4001, argc=0, argv=0x0, body=0xb915052c, flags=) at eval.c:6160
#23 0xbbb35f4f in rb_call (klass=3105092260, recv=3086564500, mid=4001, argc=0, argv=0x0, scope=0, self=3103098700) at eval.c:6257
#24 0xbbb32165 in rb_eval (self=3103098700, n=) at eval.c:3568
#25 0xbbb33d67 in rb_eval (self=3103098700, n=) at eval.c:3296
#26 0xbbb3396b in rb_eval (self=3103098700, n=) at eval.c:3432
#27 0xbbb35aee in rb_call0 (klass=3138089540, recv=3103098700, id=26609, oid=26609, argc=0, argv=0xbfbfceb0, body=0xbb001ed0, flags=) at eval.c:6160
#28 0xbbb35f4f in rb_call (klass=3138089540, recv=3103098700, mid=26609, argc=2, argv=0xbfbfceb0, scope=0, self=3103098900) at eval.c:6257
#29 0xbbb32165 in rb_eval (self=3103098900, n=) at eval.c:3568
#30 0xbbb3eaa4 in rb_yield_0 (val=3103098700, self=3103098900, klass=, flags=, avalue=0) at eval.c:5167

=end

Actions #5

Updated by taca (Takahiro Kambe) over 14 years ago

=begin
One quesition.

How did you install ruby on NetBSD? Have you installed via pkgsrc?
If so, do you use latest pkgsrc (pkgsrc-current) or branch (pkgsrc-2009Q1)?
And what about MySQL?

If you install MySQL via pkgsrc, please use mysql5-client/mysql5-server instead of
mysql51-client/mysql51-server. mysql51 in pkgsrc might have some problem and
mysql5 is more stable now.

=end

Actions #6

Updated by rudolf (r stu3) over 14 years ago

=begin
I need switching between different versions of ruby and combinations of gems, so i use hand-compiled ruby. I compile ruby from the 1.8 branches with the following (with appropriate target_dir):

target_dir="/opt/ruby-1.8-20100316-rails_2.3"
env CFLAGS="-g -march=i686 -O2 -pipe -fomit-frame-pointer" ./configure --prefix=${target_dir} --mandir=${target_dir}/man --datadir=${target_dir}/share --enable-shared --enable-static
make
make install

(plus the ruby_1_8 snapshot needed 'autoconf configure.in > configure')

The first backtrace was with mysql5 (client, server) from pkgsrc from branch pkgsrc-2009Q4. I really don't see, how relevant is the mysql code to the second backtrace, as i wrote in previous: i am using the 'ruby-mysql' gem instead of the 'mysql' gem now (yes, it was mysql51 (client, server) from current pkgsrc branch (other packages: pkgsrc-2009Q4)).

=end

Actions #7

Updated by rudolf (r stu3) over 14 years ago

=begin
here is another backtrace (still the ruby_1_8 snapshot from yesterday):

Program received signal SIGSEGV, Segmentation fault.
0xb98b8c27 in pthread_exit (retval=0x1)
at /usr/src/lib/libpthread/pthread.c:526
526 }
(gdb) bt
#0 0xb98b8c27 in pthread_exit (retval=0x1) at /usr/src/lib/libpthread/pthread.c:526
#1 0xb98b8d89 in pthread__cancelled () at /usr/src/lib/libpthread/pthread.c:896
#2 0xb98b3de3 in accept (s=10, addr=0xbfbfd780, addrlen=0xbfbfd800) at /usr/src/lib/libpthread/pthread_cancelstub.c:127
#3 0xbb9cd28e in s_accept (klass=3141521780, fd=10, sockaddr=0xbfbfd780, len=0xbfbfd800) at socket.c:1517
#4 0xbb9cd6c7 in tcp_accept (sock=3103098860) at socket.c:1551
#5 0xbbb2a83a in call_cfunc (func=0xbb9cd660 <tcp_accept>, recv=3103098860, len=893832, argc=-1145210616, argv=0x0) at eval.c:5858
#6 0xbbb35109 in rb_call0 (klass=3141521660, recv=3103098860, id=17857, oid=17857, argc=1, argv=0x0, body=0xbb3fd0d4, flags=) at eval.c:6005
#7 0xbbb35f4f in rb_call (klass=3141521660, recv=3103098860, mid=17857, argc=0, argv=0x0, scope=0, self=3103098900) at eval.c:6257
#8 0xbbb32165 in rb_eval (self=3103098900, n=) at eval.c:3568
#9 0xbbb30de1 in rb_eval (self=3103098900, n=) at eval.c:3772
#10 0xbbb333f6 in rb_eval (self=3103098900, n=) at eval.c:3382

=end

Actions #8

Updated by naruse (Yui NARUSE) over 14 years ago

=begin
try to run configure with --enable-pthread
=end

Actions #9

Updated by rudolf (r stu3) over 14 years ago

=begin
that seems to have helped, thanks!

so far no problems with:
env CFLAGS="-g -march=i686 -O2 -pipe -fomit-frame-pointer" ./configure --prefix=${target_dir} --mandir=${target_dir}/man --datadir=${target_dir}/share --enable-pthread --enable-shared --with-tcllib=none --with-tklib=none
=end

Actions #10

Updated by naruse (Yui NARUSE) over 14 years ago

  • Status changed from Third Party's Issue to Closed

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0