This chapter catalogues every known case where the RVM, on purpose or knowingly, behaves differently from native ooRexx 5 (the oracle). It assumes the value model (02), the machine (05) and the object core (08). Features that are simply missing are not divergences: they are in 18-known-gaps.md. Defects of native ooRexx that the RVM does not reproduce are mentioned only where the difference is visible to a correct program (Native defects).
Each entry gives the native behaviour, the RVM behaviour, the hosts that show it, its status and the reason.
| Status | Meaning |
|---|---|
| Accepted | a design decision; it is not going to change. Where the official test suite notices it, a rule of the census filter accepts it (ooTest acceptance rules). |
| Open | the RVM falls short; no decision keeps it that way. Fixing it is welcome. |
| Pending decision | the baseline behaviour, kept until the owner decides whether it becomes accepted or is fixed; listed together under Open: pending decision, with the reason the RVM behaves so. Other chapters describe the behaviour and link there; they call it neither a bug nor accepted. |
Hosts: both (the ooRexx host, rvm, and
the JS host, js/rvm), JS or ooRexx
host. Every entry with a code example below was checked with a
probe against both hosts and native rexx.
A few design decisions generate whole families of divergences; the entries cite them.
MIN
of a single whole number is not rounded to DIGITS (at DIGITS 3,
min(12345) and 12345~min are
12345; max(12345) is 1.23E+4),
and MAX/MIN of whole numbers ignore FUZZ (at FUZZ 1,
max(100,101) is 101), and a hole among the
arguments after whole numbers only is 93.903 naming the argument before
it ("argument 0" for MAX(1,,3); MAX('1.5',,3)
is 40.5 "argument 1").1.23E+4; at FUZZ 1 max(100,101) is
100 and min(101,100) is 101
(equal under FUZZ: the first wins); a hole is 40.5."22" and "2"||"2" are two different indexes of
an IdentityTable; "2" stored as an item and
"1223"~substr(2,1) are different items (literals are
interned, so a literal stored and looked up is the same object).getStringHash), and the sequence of
HASHCODE and == sends a collection makes for a user-defined
index is native's (08).::CLASS with that METACLASS, crash
(segmentation fault)..meta~new:.object) has Class's methods, which
read it as a class it is not: ID gives no result (91.999), SUBCLASS
99.927 with a garbage name, METHODS an empty supplier, ISSUBCLASSOF
nothing.See 07 for the mechanisms.
.eventSemaphore~new~wait with
no other thread hangs forever.RVM_CLOCK=virtual the
scheduler's clock starts at 0 and jumps to the next timer when nothing
is ready; a busy loop does not advance it (an activity spinning while
another sleeps keeps the sleeper asleep), and
TIME/DATE add the skipped time. The default is
the real clock.== called by a collection, a
security manager, a STRING requested by a native, the target of an
ADDRESS WITH) may block like any code, each thread on its own stack; it
may also REPLY.runSync/sendSync, 05), and a wait there runs the other
activities in place until it can go on (07). The waiting
activity's frames are below that pump on the host stack, so an activity
run by it that waits, in a nested machine of its own, for something only
the first can do after its wait cannot go on: 93.900 "RVM: nested waits
cross (an activity waits below this one)", and the first goes on. A wait
there that nothing can end is 93.900 "RVM: an activity waits for
something that cannot come" (native blocks for ever). (A REPLY there is
native's: 07.)tests/e2e/cases/e2e-221-nested-cross.rex).
Reason: the machine never nests its loop inside a host
call (06); the
waits nest instead.read gives EINTR): PULL or
LINEIN waiting on standard input gives up, and the HALT is
raised at once. A command the interpreter waits for is not waited for
any more, even when the signal was sent to the interpreter alone (RC is
then undefined).RVM_WORKER=0; a pipe read with nothing else to
run) gets the HALT when it ends, and a second Ctrl-C ends the process
(exit status 130); and a command gets the HALT when it ends: in both
hosts one that lets the other activities run (07), in the JS host
also one waited for (the ooRexx host stops waiting for it, as native).
At a terminal Ctrl-C reaches the writer of the pipe and the command too
(the terminal's process group), so these end at once; the difference
shows with a signal sent to the interpreter alone..environment, in creation order (07)..WeakReference exists; its
value becomes .nil once the referent is
collected..WeakReference~new), and .environment has no
WEAKREFERENCE entry.loop while ref~value \= .nil, generating garbage)
would then hang instead of failing at once. Host weak references were
rejected: they are not deterministic and the RVM retains the objects
anyway. Should one be needed, the way is a deterministic marking done on
~value, only in programs that create a WeakReference
(roots: the stacks and variables of every activation and activity, the
registers of suspended ones, pending messages, .local,
.environment, classes and packages;
~subclasses and the requires cache as weak).RVM_MACROSPACE, in the
SysSaveRexxMacroSpace format): the child loads it at start
and, if it changed it, the parent reloads it when the command returns.
Same limits as the queues.RVM_QUEUES) and the RVM's own
rxqueue placed first in the command's PATH (in
RVM.CommandHost~run, ../RVM.Host.cls; ../js/host-node.mjs); what
the command leaves there is read back when it ends. Consequences:
sharing only with what the RVM starts, and between commands, not live
(two concurrent RVMs in a pipeline: the last one wins; a waiting LINEIN
does not see what another process adds until the command ends);
rxqueue's arguments are the words of its argument string
('a b' is two); a native rexx started by the
RVM does not see the queues
(queue 'x'; 'rexx -e "say queued()"' shows 1 natively, 0 in
the RVM).RXFUNCADD registrations live
in rxapi and survive the process: another process sees them with
RXFUNCQUERY (and cannot drop them).RXFUNCQUERY 0, as many RXFUNCDROP as
registrations) and calling it is 43.1, as native.STDIN
(.stream~new('STDIN')) when standard input is a file
believes it is at position 1 but reads where the descriptor is: after
what .INPUT has read ahead (4096 bytes), usually nothing,
while its CHARS and LINES count from position
1; a LINES or a positioned read moves the descriptor that
the other stream objects read from.CHAROUT/LINEOUT (or SEEK) on a
standard output or error redirected to a file moves the descriptor's
offset, so a command run afterwards writes there.pwrite; a command still
writes where the descriptor was (StdFile in ../js/hostfile-node.mjs).
On a file opened to append both agree: every write goes to the end. The
ooRexx host is native's.lseek; the offset is
read from /proc/self/fdinfo (Linux), but cannot be
set.STREAM(f,'C','OPEN BINARY') on
an empty file raises 93 (with no secondary message) and leaves the
stream READY with zero-length records; the next LINEOUT kills the
interpreter (SIGFPE).ADDRESS ... WITH INPUT feeds
the command while it runs, a line at a time, as the command reads; what
the command does not read is never asked for. A command that ends
without reading leaves an INPUT USING object's
LINEIN uncalled, and an error it would raise never
happens.input~bytes), so that LINEIN runs and
its error goes up (SYNTAX). The two agree whenever the
command reads all its input, as every Unix filter does; they differ for
one that does not, such as cmd.exe running a program it does not know
(with-obj-instream on Windows: native says
no error, the RVM SYNTAX 42.3)."" when
not open) is the same.::REQUIRES 'rxunixsys' LIBRARY is 98.903): it ties a
program to Unix, while the RVM is meant to be as portable as ooRexx.
Accepted (rule RXUNIXSYS).SysCreateEventSem, SysOpenEventSem,
SysCloseEventSem, SysPostEventSem,
SysResetEventSem, SysWaitEventSem,
SysCreateMutexSem, SysOpenMutexSem,
SysCloseMutexSem, SysRequestMutexSem,
SysReleaseMutexSem) are not provided: ooRexx deprecates
them (rexxref, "Deprecated Rexx features", B.2.1: superseded by the
EventSemaphore and MutexSemaphore classes, which the RVM has), because
they cannot be implemented reliably on every operating system; the
official suite does not test them. Accepted.SysFork, SysWait and
SysCreatePipe ("Unix-like systems only" in
rexxref) are not provided, for the same reason as rxunixsys: they tie a
program to Unix, and a fork has no meaning in the JS host.
Accepted.RXFUNCQUERY answers 1
(native 0); see 12.::METHOD m EXTERNAL 'LIBRARY lib entry' of a library that
cannot be loaded fails when the package is translated (98.903).orxncurses,
oodialog...), the package loads and its other methods work;
the method raises 98.903 when it runs (CallNative /
callNative, key L). Every other EXTERNAL error
is raised before the first clause, as natively (12).The JS host emulates the kernel's sockets on Node (../js/sockets-worker.mjs):
SockSend never waits (Node buffers without
limit);/etc/hosts, then DNS (no aliases
outside /etc/hosts).In the browser there are no sockets (98.903). In both hosts a socket call that would block parks only its activity (as a native thread would), and pending socket I/O is waited for in real time even under the virtual clock. Hosts: JS. Status: accepted (consequences of the platform).
sin, exp,
log... come from V8's Math, which differs from
glibc in the last bit for some arguments: visible only at precision 16,
as a last-digit difference (a few per cent of a sample of
RxCalcExp, RxCalcLog, RxCalcSin
results). The ooRexx host calls the host's rxmath and is exact.
Status: accepted.readdir counts .
and ..), or uninitialized data when there is none: it may
show as a directory and be missing from an F (files)
search, and its date, size and attributes vary from run to run
(9999999999 --wxrwxrwx has been seen).---------- and time 0 (what native shows when the data it
reuses happens to be zero).stat did
not write; there is no behaviour to reproduce.rexxc writes the interpreter's
image of the translated program (flattened objects, depending on
platform and bitness) after a /**/@REXX header (base64 with
-e); rexx, Method~newFile and
Routine~newFile/new load it.@. Tests that run rexxc and rexx
as commands work (they are native).rexxc
wrapping R-code was rejected: it would also need an RVM
rexx first in PATH..RexxInfo~executablerexx binary.rvm, js/rvm: the RVM_EXECUTABLE
variable the launchers set), so that programs a program starts (e.g. the
test framework's execRexxPrg) run on the RVM too.RVM.Machine~maxDepth, JS MAX_DEPTH in ../js/machine.mjs).test_sortWith_bug1466:
SORTWITH of 70,000 items) does not finish within the census timeout
there, while the JS host runs it in about a minute. Around 40 % of the
time is the host's garbage collector (a full mark of a large heap); the
rest is spread interpretation with no hot spot.These are differences kept as the RVM's behaviour until the owner decides whether each becomes an accepted divergence or is fixed.
Where native ooRexx crashes, hangs or gives a result that contradicts its own documentation, the RVM does the documented thing; those defects are tracked outside this documentation. The ones visible to a correct program:
XRANGE('digit', '8'): native returns only the range
from '8'; the RVM returns the class followed by the range,
as documented.DATE(, 0, 'D'): native makes a "month 0" date; the RVM
raises 40.19.Some native behaviours that look like defects are what programs and the official test suite see, so the RVM does the same (P1):
BuiltinFunctions.cpp: SUBSTR is
string->substr(n, length, pad)): the function checks its
own arguments first, in their order (the count, 40.3/40.4; an omitted
required one, 40.5; a whole number, 40.12; a pad, 40.23), and then the
method checks them with its errors (93.9xx, in the method's order),
which speak of a method and number the arguments as the method's
(INSERT('a','b',-1) is 93.906 "Method argument 2"). So
SUBSTR('abc',0) is 93.924, B2X('12') 93.934,
DATATYPE('a','Q') 93.915, ABS('x') 93.943, and
TRUNC('a','b') 40.12 (argument 2 is the function's,
argument 1 the method's). The stream functions send the stream its
method (93.907, 93.914, 93.958, 93.0, 88.907 for a count), BEEP,
FILESPEC and DIRECTORY are native routines (88.901, 88.907, 88.922),
TRACE('Z') is 24.1 as the instruction, an unknown option of
ARG, CONDITION, FILESPEC, GC, LINES or STREAM is 40.904, and VALUE's
unknown selector 40.914. Mechanism: CallBIF in ../RVM.BIFs.cls and
callBIF in ../js/bifs.mjs (11).setSecurityManager while a program runs affects
LOCAL and ENVIRONMENT checks at once but other events only in
activations created afterwards, because an activation copies its
package's manager when it starts (08).The census of the official ooRexx test suite (16) counts apart the failures that are accepted divergences, so that the remaining failures are the RVM's to fix. A failure is accepted only if it matches a rule; each rule is narrow enough that a real regression of the same kind still shows.
| Rule | What it accepts | Divergence |
|---|---|---|
| REXXINTEGER | every failure of the group base/class/RexxInteger,
which tells a RexxInteger from a NumberString by the unrounded MIN |
MIN and MAX |
| STRID | the IdentityTable tests that depend on string identity
(TEST_ALLINDEXES, TEST_ALLITEMS,
TEST_AT01, TEST_HASINDEX,
TEST_HASITEM, TEST_INDEX,
TEST_ITEMS, TEST_MAKEARRAY,
TEST_PUT, TEST_REMOVE,
TEST_REMOVEITEM, TEST_XOR,
TEST_[], TEST_[]=) |
IdentityTable |
| WEAKREF | 97.1 'Object ".WEAKREFERENCE" does not understand message "NEW"', and the failure ".environment should contain WEAKREFERENCE" | No WeakReference |
| REXXC | 13.1 on "@" in a test whose body runs
rexxc |
rexxc |
| RXUNIXSYS | every failure of the rxunixsys groups, and 43.1 for
SysStat, SysSymlink, SysGetuid,
SysGetgid, SysGetpid or SysUname
in other groups (tests that use them as tools: SysStat to build
SysFileTree's expected lines, SysSymlink for tilde expansion) |
Library coverage |
| EXECUTABLE | TEST_REXXINFO_EXECUTABLE failing because the name is
not rexx or rexx-oorexx |
RexxInfo executable |
| RXAPI | TEST_RXAPI_LOCKED of utilities/rxapi (it
runs the rxapi next to the executable and expects its
"locked" lines) |
No rxapi |
SysFileTree's own output, which the RXUNIXSYS-accepted tests would check, is verified against native by the RVM's own end-to-end cases instead.
Open divergences of this chapter (also in 18-known-gaps.md):