From: MIYAMUKO Katsuyuki Date: 2004-03-30T19:05:52+09:00 Subject: [ruby-dev:23274] Time.gm(...): gmtime/localtime error (ArgumentError) みやむこです。 HP-UX 11.23 でコンパイルエラーになりました。 % uname -srm HP-UX B.11.23 ia64 % ./configure CFLAGS="-g0 +O0 +DD64" && make (略) cc main.o libruby-static.a -ldld -ldl -lm -o miniruby -g0 +O0 +DD64 -DYYMAXDEPTH=300 rbconfig.rb updated ./lib/optparse.rb:197:in `gm': gmtime/localtime error (ArgumentError) from ./lib/optparse.rb:197 from ./lib/optparse/shellwords.rb:4:in `require' from ./lib/optparse/shellwords.rb:4 from ./ext/extmk.rb:31:in `require' from ./ext/extmk.rb:31 *** Error exit code 1 Stop. Time.gm でエラーになっているみたいです。 % ./miniruby -e "Time.gm(2000,1,1,1,1,1)" -e:1:in `gm': gmtime/localtime error (ArgumentError) from -e:1 デバッガで追いかけると以下のようになりました。 % gdb miniruby HP gdb 4.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x. Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-Packard Wildebeest 4.0 (based on GDB) is covered by the GNU General Public License. Type "show copying" to see the conditions to change it and/or distribute copies. Type "show warranty" for warranty/support. .. (gdb) break search_time_t Breakpoint 1 at 0x4000000000373eb0:0: file time.c, line 436. (gdb) run -e "Time.gm(2000,1,1,1,1,1)" Starting program: /home/miyamuko/src/ruby/miniruby -e "Time.gm(2000,1,1,1,1,1)" Breakpoint 1, search_time_t (tptr=0x9ffffffffff87d20, utc_p=2) at time.c:436 436 find_dst = 0 < tptr->tm_isdst; (gdb) s 439 guess_lo = 1L << (8 * sizeof(time_t) - 1); (gdb) s 443 guess_hi = ((time_t)-1) < ((time_t)0) ? (gdb) s 447 tm = (utc_p ? gmtime : localtime)(&guess_lo); (gdb) s 448 if (!tm) goto error; (gdb) s 652 rb_raise(rb_eArgError, "gmtime/localtime error"); (gdb) print tm $1 = (struct tm *) 0x0 (gdb) print guess_lo $2 = -9223372036854775808 -- みやむこ