Project

General

Profile

Actions

Bug #1757

closed

cygwin-1.7, gcc4-4.3, and ruby-1.9. method `inspect' called on hidden object (0x10046720) (NotImplementedError)

Added by neomjp (neomjp neomjp) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2009-07-10 trunk 24017) [i386-cygwin]
Backport:
[ruby-core:24251]

Description

=begin
I tried compiling ruby-1.9.2-r24017 on cygwin-1.7.0 using gcc-4.3 as follows:

$ cygcheck -f /bin/cygwin1.dll /usr/bin/gcc-4
cygwin-1.7.0-50
gcc4-core-4.3.2-2

$ ../ruby-1.9.2-r24017/configure --program-suffix="-19" --with-ridir="/usr/share/ri-19" CC="gcc-4" CFLAGS="-O2 -pipe -DCCP_WIN_A_TO_POSIX=CCP_WIN_A_TO_POSIX"

$ make

The -DCCP_WIN_A_TO_POSIX=CCP_WIN_A_TO_POSIX above was added to make use of the #if switch introduced in r23468 to skip a deprecated function in cygwin 1.7(, and is not related to the issue that follows). Then,

$ ./miniruby.exe -v -e 'p($:)'
ruby 1.9.2dev (2009-07-10 trunk 24017) [i386-cygwin]
-e:1:in inspect': method inspect' called on hidden object (0x100466f8) (NotImplementedError)
from -e:1:in p' from -e:1:in '

$ ./miniruby.exe -e 'puts($-I)'
-e:1:in puts': method respond_to?' called on hidden object (0x100466f8) (NotImplementedError)
from -e:1:in puts' from -e:1:in '

So, $:, $-I, and $LOAD_PATH seem to be hidden objects, somehow.
=end

Actions #1

Updated by yugui (Yuki Sonoda) over 14 years ago

  • Priority changed from Normal to 5
  • Target version set to 1.9.2

=begin

=end

Actions #2

Updated by yugui (Yuki Sonoda) over 14 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)

=begin

=end

Actions #3

Updated by neomjp (neomjp neomjp) over 14 years ago

=begin
I was wrong in presuming that -DCCP_WIN_A_TO_POSIX=CCP_WIN_A_TO_POSIX was not related.

  1. ../ruby-1.9.2-r24220/configure --program-suffix="-19" --with-ridir="/usr/share/ri-19" CC="gcc-4"
  2. Edit Makefile so that
    CFLAGS = ${cflags} -DCCP_WIN_A_TO_POSIX=CCP_WIN_A_TO_POSIX
  3. make

$ ./miniruby.exe -ve "p($:)";
ruby 1.9.2dev (2009-07-21 trunk 24220) [i386-cygwin]
-e:1:in inspect': method inspect' called on hidden object (0x10046658) (NotImplementedError)
from -e:1:in p' from -e:1:in '

Something about #define BASEPATH() in r23468 seemed to be related to this issue. The correct behavior could be recovered by using rb_str_buf_cat() instead of rb_str_dup() in case #if !VARIABLE_LIBPATH is false. But I am not sure if it is the right way to fix it. Can anybody verify this?

--- src/ruby-1.9.2-r24220/ruby.c 2009-06-23 01:21:09.000000000 +0900
+++ newsrc/ruby-1.9.2-r24220/ruby.c 2009-07-22 22:00:18.282555100 +0900
@@ -350,8 +363,8 @@ ruby_init_loadpath_safe(int safe_level)
VALUE sopath;

else

  char libpath[MAXPATHLEN + 1];
  • size_t baselen;

endif

  • size_t baselen;
    char *p;

#if defined _WIN32 || defined CYGWIN
@@ -414,15 +427,13 @@ ruby_init_loadpath_safe(int safe_level)
p = libpath + 1;
}

  • baselen = p - libpath;

-#define BASEPATH() rb_str_buf_cat(rb_str_buf_new(baselen+len), libpath, baselen)
#else
rb_str_set_len(sopath, p - libpath);

-#define BASEPATH() rb_str_dup(sopath)
#endif

  • baselen = p - libpath;
    +#define BASEPATH() rb_str_buf_cat(rb_str_buf_new(baselen+len), libpath, baselen)

#define RUBY_RELATIVE(path, len) rb_str_buf_cat(BASEPATH(), path, len)
#else
#define RUBY_RELATIVE(path, len) rubylib_mangled_path(path, len)

$ ./miniruby.exe -ve "p($:)";
ruby 1.9.2dev (2009-07-21 trunk 24220) [i386-cygwin]
["/tmp/ruby19/ruby19-1.9.2devr24220-0/build/lib/ruby/site_ruby/1.9.1", "/tmp/ruby19/ruby19-1.9.2devr24220-0/build/lib/ruby/site_ruby/1.9.1/i386-cygwin", "/tmp/ruby19/ruby19-1.9.2devr24220-0/build/lib/ruby/site_ruby", "/tmp/ruby19/ruby19-1.9.2devr24220-0/build/lib/ruby/vendor_ruby/1.9.1", "/tmp/ruby19/ruby19-1.9.2devr24220-0/build/lib/ruby/vendor_ruby/1.9.1/i386-cygwin", "/tmp/ruby19/ruby19-1.9.2devr24220-0/build/lib/ruby/vendor_ruby", "/tmp/ruby19/ruby19-1.9.2devr24220-0/build/lib/ruby/1.9.1", "/tmp/ruby19/ruby19-1.9.2devr24220-0/build/lib/ruby/1.9.1/i386-cygwin"]

=end

Actions #4

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

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

=begin
This issue was solved with changeset r25390.
neomjp, thank you for your reporting of the issue.
You have greatfully contributed toward Ruby.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0