Bug #575


module_function: undefined method

Added by tilman (Tilman Giese) about 14 years ago. Updated over 11 years ago.

ruby -v:



test.rb:17: [BUG] undefined method `m'; can't happen
ruby 1.9.0 (2008-09-09 revision 19264) [i386-mingw32]

-- control frame ----------
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC :module_function
c:0004 p:0013 s:0008 b:0008 l:000007 d:000007 CLASS test.rb:17
c:0003 p:0039 s:0006 b:0006 l:000005 d:000005 TOP test.rb:16
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :private_class_method
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :302

DBG> : "test.rb:17:in module_function'" DBG> : "test.rb:17:in module:M2'"
DBG> : "test.rb:16:in `'"


module M1
def m; end
private :m
module M2
include M1
public :m
module M1
undef_method :m
module M2
module_function :m

Actions #1

Updated by shyouhei (Shyouhei Urabe) about 14 years ago

  • Assignee set to matz (Yukihiro Matsumoto)
  • Priority changed from 3 to 5

Also happens on 1.8.

zsh % gdb --args ~/target/branches/ruby_1_8/bin/ruby -v /dev/shm/tmp.rb
GNU gdb 6.4.90-debian
Copyright (C) 2006 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-linux-gnu"...Using host libthread_db library "/lib/".

(gdb) run
Starting program: /home/shyouhei/target/branches/ruby_1_8/bin/ruby -v /dev/shm/tmp.rb
[Thread debugging using libthread_db enabled]
[New Thread 47976101811568 (LWP 21422)]
ruby 1.8.7 (2008-08-12 revision 17572) [x86_64-linux]
/dev/shm/tmp.rb:13: [BUG] undefined method `m'; can't happen
ruby 1.8.7 (2008-08-12 revision 17572) [x86_64-linux]

Program received signal SIGABRT, Aborted.
[Switching to Thread 47976101811568 (LWP 21422)]
0x000000316ca2f07b in raise () from /lib/
(gdb) bt
#0 0x000000316ca2f07b in raise () from /lib/
#1 0x000000316ca3084e in abort () from /lib/
#2 0x00000000004c1f61 in rb_bug (fmt=0x4c6278 "undefined method `%s'; can't happen") at /home/shyouhei/ruby/branches/ruby_1_8/error.c:213
#3 0x000000000042132c in rb_mod_modfunc (argc=1, argv=0x7fff5c295800, module=47976102064560) at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:7700
#4 0x000000000041d0a3 in call_cfunc (func=0x421215 <rb_mod_modfunc>, recv=47976102064560, len=-1, argc=1, argv=0x7fff5c295800) at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:5751
#5 0x000000000041c452 in rb_call0 (klass=47976102214200, recv=47976102064560, id=4281, oid=4281, argc=1, argv=0x7fff5c295800, body=0x2ba24e8770a0, flags=2) at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:5906
#6 0x000000000041dbdb in rb_call (klass=47976102214200, recv=47976102064560, mid=4281, argc=1, argv=0x7fff5c295800, scope=1, self=47976102064560) at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:6153
#7 0x0000000000415c5f in rb_eval (self=47976102064560, n=0x2ba24e857318) at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:3509
#8 0x00000000004185bf in module_setup (module=47976102064560, n=0x2ba24e8572a0) at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:4204
#9 0x0000000000417fa6 in rb_eval (self=47976102204080, n=0x2ba24e857688) at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:4112
#10 0x0000000000410411 in eval_node (self=47976102204080, node=0x2ba24e857688) at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:1438
#11 0x0000000000410ae4 in ruby_exec_internal () at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:1643
#12 0x0000000000410b34 in ruby_exec () at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:1663
#13 0x0000000000410b57 in ruby_run () at /home/shyouhei/ruby/branches/ruby_1_8/eval.c:1673
#14 0x000000000040e436 in main (argc=3, argv=0x7fff5c296bd8) at /home/shyouhei/ruby/branches/ruby_1_8/main.c:48


Actions #2

Updated by yugui (Yuki Sonoda) about 14 years ago

  • Target version set to 1.9.1 Release Candidate



Actions #3

Updated by nobu (Nobuyoshi Nakada) almost 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r19691.


Also available in: Atom PDF