Ruby 1.0

Details

Version
1.0
Released
Command
ruby-1.0
Try
ruby-1.0 -e 'print "Hello from Ruby ", VERSION, "\n"'
Samples
~/samples/1.0/
Source
ruby-1.0-971225.tar.gz
SHA-256
1ec86e2ecfc377482f3a30602e6eeaa64ce5a99ae99c2e242393d2b248ed5920

Notes

This is 1.0-971225, the last release of 1.0 (25 December 1997), which is what VERSION and ruby-1.0 -v print. 1.0’s releases are numbered by date: the first was 1.0-961225, a year to the day earlier, and the rest are from 1.0-971002 on.

Not patched: 0.95’s errno patch isn’t needed, because every file that declares extern int errno; includes <errno.h> first, so the declaration expands to glibc’s macro. strerror is found by configure, as for 0.95, so missing/strerror.c (the other user of sys_nerr) isn’t built. all-ruby’s glob-voidalloca only matters where <alloca.h> isn’t included, which 0002 rules out, and nothing else in all-ruby is for this release.

Unlike 0.95, Ruby 1.0’s ext/extmk.rb builds every extension that isn’t listed in ext/Setup as a shared library, and ext/Setup lists none, so make install puts eight into /opt/ruby/1.0/lib/ruby/i686-linux/: curses, etc, fcntl, kconv, marshal, md5, socket and tkutil (dbm is skipped). There are 34 libraries in lib/ruby/. socket asks for -lnsl, but Debian links with --as-needed and it uses nothing from it. tkutil loads but is no use without Tk. marshal and md5 build with warnings that they pass argv as a VALUE rather than a VALUE *, which is harmless on 32-bit x86, where both are 32 bits.

Every case in 1.0’s sample/test.rb passes, including array 2, so knownTestFailures is empty. Its test.rb reports results differently from 0.95’s (not ok <case> <n> -- <caller>, and end of test(test: <count>)), and scripts/test-ruby.mjs reads both.

One bug in the release matters in the browser: loop do end, with an empty block, can’t be interrupted. Ruby 1.0 handles SIGINT, SIGQUIT and SIGTSTP by setting a flag that rb_eval() checks after evaluating a node, and loop is a C for (;;) rb_yield(Qnil); that, with nothing in the block, never evaluates one. There’s no second shell in the page to kill it from, so it needs a reload. Any block with something in it (loop do x = 1 end, as checks.busyLoop uses) and while TRUE; end stop on Ctrl-C as expected. It’s left unpatched, like 0.95’s array 2.

sample/eval.rb is a small REPL, installed as eval-1.0. It can’t read a line without 0005, and Ctrl-C quits it.

Patches

0004-error-glibc-sys-nerr.patch

error.c sizes its table of Errno classes with sys_nerr, which glibc 2.32 stopped exporting to newly linked programs. Under glibc it now uses 255, above Linux’s largest errno (133).

In all-ruby: error-sysnerr2.

FreeBSD only.

0006-st-unsigned-numhash.patch

st.c hashes a numeric key with n % modulus on a signed int, and the marshal extension keys its tables by object address, so once the heap is above 2 GiB, as it is in the guest, the bucket index is negative and the table is written out of bounds. Marshal.dump of a Float or any non-empty String crashed with a segfault. It now hashes the key as unsigned, as 1.4’s numhash() does.