Listed below are the known bugs and patches or workarounds for version 3.3 of SRC Modula-3:
There is a natural tension between the frequency of new releases and the number of patches that must be applied to an old release. We try to make the right choice. If you have any wisdom or advice on how this tradeoff should be made, please send e-mail to m3-request@src.dec.com.
Some packages (e.g. tools/m3tohtml, compiler/driver, and visualobliq) don't export anything, so m3ship complains.
The driver package should export "m3". Add
LibdExport ("m3")at the end of its m3makefile.
Patch:
Near line 1120 of boot-XYZ/m3build/templates/COMMON, change
if defined("_all") delete_file(M3SHIP_FILE) delete_file(M3OVERRIDES) endto
if defined("_all") delete_file(M3SHIP_FILE) delete_file(M3OVERRIDES) > M3SHIP_FILE in write (CR) end % let m3ship know we've been here endThis change will cause m3build to always create a .M3SHIP file.
On some platforms m3gdb crashes immediately with "gdb internal error: Memory corruption". The bug is in the Modula-3 extensions -- m3_demangle is not returning the address of a malloc'ed string.
Patch:
In m3gdb/gdb/gdb/m3-lang.c, in procedure m3_demangle (lines 899-966) make the following changes:
The mentor m3makefile doesn't evaluate properly.
Patch:
Replace include_dir(pqueue) with include_dir("pqueue") in mentor/src/m3makefile.
The display postscript package is stale. misc/dps/src/DPS.m3 doesn't compile because it calls SchedulerPosix.IOSelect.
Patch:
Date: Tue, 07 Jun 94 10:53:40 -0700 From: wobber >> It seems misc/dps/src/DPS.m3 needs updating; it accesses (in line 897) an >> obsolete procedure SchedulerPosix.IOSelect, which has been superseded by >> SchedulerPosix.IOWait (or so it seems). How do we change it? Although I've never looked at this code before, it looks as if the DPS code depends on all windows existing on a single display and X connection. Look at the code and comment at line 750 of DPS.m3. I believe that the "fd" in the variable "displaySource" is the only one that the code as written will ever wait upon. This implies that replacing the call to WaitForX() near the end of TalkToX() with SchedulerPosix.IOWait(displaySource.fd, TRUE) might do the trick. Ted Wobber DEC SRC
The combination of the gcc optimizer and the m3 IL -> gcc tree translator is buggy. It generates bad code for:
Word.LT (16_80000000, x)This code exists in the the Tick implementation.
Work-around:
Don't turn on the optimizer.
The compiler front-end doesn't pass the following information to the back-end and therefore never gets into the debugger:
None.
The compiler front-end doesn't use the recommended Lex interface to read floating point values. Hence, very large, very small and very precise values may not be read correctly by the compiler.
The front-end uses host floating-point arithmetic to fold floating-point constants -- even when being used as a cross-compiler. Hence, cross-compilers may not compute the correct constants.
The front-end doesn't generate IEEE infinities for FIRST(REAL) and LAST(REAL).
Work-around:
None.
The m3build, m3ship, m3where and m3mkdir programs may pass bad arguments to quake. The function pathhead() uses strncpy() but fails to terminate the resulting string. [ANSI strncpy() adds a \0 only if the source string is shorter than n.]
Patch:
Before building the bootstrap, edit m3build.cq, m3where.cq, m3ship.cq1, and m3mkdir.cq in boot-XYZ/m3build/src. Or, after installing the bootstrap, edit the same files in m3utils/m3build/src and reship the package.
Here are the context diffs for m3utils/m3build/src/m3build.cq:
*** m3build.cq.dist Thu May 26 15:58:35 1994 --- m3build.cq Fri Jun 10 12:22:34 1994 *************** *** 202,207 **** --- 202,208 ---- " len = last_sep - name;", " head = malloc (len + 1);", " strncpy (head, name, len);", + " head[len] = 0;", " DPRINTF((\"pathhead (%s) = %s\\n\", name, head))", " return head;", " }",
If your program generates output faster than the OS can consume it, you program may stall until another I/O event wakes it up.
Patch:
In libm3/src/os/POSIX/FilePosix.m3, line 273 at the end of the procedure IntermittentWrite, the call to IOWait should be:
EVAL SchedulerPosix.IOWait(h.fd, FALSE)
The J-video sources which are part of the formsvbt library don't compile on some platforms.
--- building in SOLgnu --- m3 -w1 -why -g -a libjvideo.a -F/tmp/qkAAAa001lQ new source -> compiling ../src/JvsBuffer.m3 "../src/JvsBuffer.m3", line 85: value is not assignable to field (address) 1 error encountered compilation failed => not building library "libjvideo.a" *** error code 1 (ignored)
Patch:
Since the only J-video hardware is at SRC, substitute
<*ASSERT FALSE*>for the body of the offending procedure.
For some ranges, [a .. b], the Random.Default.integer method returns values in the range [0 .. b-a].
Patch:
In the procedure Integer in libm3/src/random/Common/Random.m3 (near line 132) it says:
res := xl * range; res := Word.RightShift(res, halfWordSize); res := res + xh * range; res := Word.RightShift(res, halfWordSize); RETURN res END (* BEGIN *)But, the return statement should be
res := xl * range; res := Word.RightShift(res, halfWordSize); res := res + xh * range; res := Word.RightShift(res, halfWordSize); RETURN res + min; END (* BEGIN *)
Apparrently getmnt is not a universal C library function. In OSF and SunOS there's a function called getmntent, possibly it can be used as a replacement.
Patch:
In pkgtools/pkgobj/src/POSIX/m3makefile change
if equal (BUILD_DIR, "AOSF") include_dir(osf) else include_dir(ultrix) endto
readonly _osf_like_systems = { "ALPHA_OSF", "SPARC", "SOLsun", "SOLgnu" } if _osf_like_systems contains TARGET include_dir("osf") else include_dir("ultrix") endThe original bug report and patch was:
Date: Fri, 03 Jun 94 18:30:23 +0100 From: Quentin <Quentin.Stafford-Fraser@cl.cam.ac.uk> Ah! It turns out that SunOS is more osf-like than ultrix-like here. In pkgtools/pkgobj/src/POSIX/m3makefile there is: if equal (BUILD_DIR, "AOSF") include_dir(osf) else include_dir(ultrix) end The ultrix directory uses getmnt(), and the osf directory uses statfs(), which exists in SunOS. Changing it to: if equal (BUILD_DIR, "AOSF") or equal (BUILD_DIR, "SPARC") allows things to build. PackageServer still dies, but that's a different problem. I'm working on it. Quentin
On some systems the C compiler complains while linking the driver and compiler during m3boot that a bad object file was produced. The default ALPHA_OSF configuration file should build stand-alone executables during the boot phase.
Patch:
In boot-ALPHA_OSF/m3build/templates/ALPHA_OSF, change the definition of BOOT_LINK to:
BOOT_LINK = "cc -ieee_with_inexact -non_shared"
While building trestle, the loader produces the following:
-ld: /usr/lib/libc.a(find_rtfunc.o): __exc_add_pc_range_table: multiply defined /usr/lib/libc.a(find_rtfunc.o): __exc_remove_pc_range_table: multiply defined /usr/lib/libc.a(find_rtfunc.o): __exc_add_gp_range: multiply defined /usr/lib/libc.a(find_rtfunc.o): __exc_remove_gp_range: multiply defined Warning: Unresolved: _end
The problem is caused by using GNU ld.
Patch:
In boot-ALPHA_OSF/m3build/templates/ALPHA_OSF in the library_hooks procedure, change the invocation of "ld" to explicity use "/usr/bin/ld".
The wrong values are defined for socket types in Solaris. Applications using TCP will be adversely affected. The incorrect values cause a datagram socket to be created when a stream socket is requested. Later stream oriented operations then fail.
Patch:
Edit libm3/src/unix/solaris-2-x/Usocket.i3 to match this:
(* * Types *) CONST SOCK_STREAM = 2; (* stream socket *) SOCK_DGRAM = 1; (* datagram socket *) SOCK_RAW = 4; (* raw-protocol interface *) SOCK_RDM = 5; (* reliably-delivered message *) SOCK_SEQPACKET = 6; (* sequenced packet stream *)
The debugging stabs are not passed into the final executable.
Patch:
Modify the template, m3build/templates/SOLsun, so that "-s" is passed to the assembler:
"-Y7@/usr/ccs/bin/as@-s@", % --- the assembler
The SP and FP offsets used during thread switching are incorrect on Solaris.
Patch:
In libm3/src/runtime/SOLsun/RTThread.m3, define
CONST SP_pos = 1; FP_pos = 3;
To run Modula-3 applications built against the X11 shared libraries you must set LD_LIBRARY_PATH to /usr/openwin/bin (or wherever your libraries hide).
David Goldberg explains:
The problem with setting LD_LIBRARY_PATH holds for the SPARC release as well. The problem appears to be due to a bug in the standard libXt.sa.4.0 file. It includes the symbols __XtInherit and ___XtInherit, but the libXt.so.4.0 file only includes __XtInherit. This is a bug.The libXt.so file distributed with openwin does include ___XtInherit.
On big-endian machines, the network object runtime will hang trying to import instances.
Patch:
In netobj/tcp/src/generic/ConnMsgRW.m3 and trestle/tcp/src/generic/ConnMsgRW.m3, the procedure Swap should be:
PROCEDURE Swap(VAR i: Int32) = VAR b: Byte8; BEGIN WITH p = LOOPHOLE(ADR(i), UNTRACED REF ARRAY [0..3] OF Byte8) DO b := p[3]; p[3] := p[0]; p[0] := b; b := p[2]; p[2] := p[1]; p[1] := b; END; END Swap;
The return type for Ushm.shmat on Solaris is incorrect.
Patch:
The diffs for libm3/src/unix/solaris-2.x/Ushm.i3 are:
9c9 < FROM Ctypes IMPORT char, short, int, void_star; --- > FROM Ctypes IMPORT char, short, int; 192c192 < <*EXTERNAL*> PROCEDURE shmat (shmid: int; shmaddr: ADDRESS; shmflg: int): void_star; --- > <*EXTERNAL*> PROCEDURE shmat (shmid: int; shmaddr: ADDRESS; shmflg: int): int;
gwyant@cloyd.East.Sun.COM (Geoff Wyant)
Due to changes in errno values, there needs to be a Solaris-2 specific version of
netobj/tcp/src/POSIX/TCP.m3 trestle/tcp/src/POSIX/TCP.m3
Patch:
Substitute this version of TCP.m3.
The default SPARC templates generate "pic" code, but when built standalone the network objects stub generator is too big.
Workaround:
Change "pic" to "PIC" throughout boot-SPARC/m3build/templates/SPARC and rebuild the system.
To get over the immediate problem with stubgen and not rebuild the entire world, comment out the "build_standalone()" call in netobj/stubgen/src/m3makefile.
The order of fields in libm3/src/unix/ultrix-3-1.SPARC/Utime.i3 is incorrect.
Date: Fri, 03 Jun 94 20:34:34 +0100 From: Quentin <Quentin.Stafford-Fraser@cl.cam.ac.uk> Ah! Fairly important bug in libm3. It was also in 3.1 - I'm surprised nobody discovered it. I found it because packageserver died with a strlen error, as would anything else which used timezones. Heaven knows why, but on SunOS 4.1.3 the last 2 elements of a 'struct tm' in time.h are char *tm_zone; long tm_gmtoff; where most other systems have them the other way round - ie: long tm_gmtoff; char *tm_zone; This means that the M3 equivalent defined in libm3/src/unix/Utime.i3 is not valid for SunOS. The proper way to fix it (I think) is as follows: * copy all of the interfaces and modules of ultrix-3-1.generic into ultrix-3-1.SPARC * update the m3makefile in ultrix-3-1.SPARC to include the new files - you can just insert the contents of the ultrix-3-1.generic m3makefile. * change the m3makefile in the parent directory (libm3/src/unix) so that the generic directory is not used for SPARCs. This involves changing the line "SPARC" : [ "ultrix-3-1.generic", "ultrix-3-1.SPARC" ], to "SPARC" : [ "ultrix-3-1.SPARC" ], * in the Utime.i3 which is now in the ultrix-3-1.SPARC directory, change the definition of struct_tm by swapping the positions of tm_zone and tm_gmtoff. * rebuild and ship libm3, then rebuild everything everything else to use it. Quentin
From: goldberg@parc.xerox.com (David Goldberg)
Trestle works fine on Openwin-2.0. There is a bug in the xnews openwin 3.0 server. If you are using 3.0, trestle will work if you make the following change to XClient.m3:
(* XXX: Workaround for bug in openwin-3.0 server *) (* X.XGrabKey(trsl.dpy, X.AnyKey, X.AnyModifier, ur.w, X.True, X.GrabModeAsync, X.GrabModeAsync); *) VAR min, max: INTEGER; BEGIN X.XDisplayKeycodes(trsl.dpy, ADR(min), ADR(max)); FOR i := min TO max DO X.XGrabKey(trsl.dpy, i, X.AnyModifier, ur.w, X.True, X.GrabModeAsync, X.GrabModeAsync); END; END;
When a program using network objects tries to connect to a missing netobjd, SunOS will crash. The problem is in some TCP code that was added help diagnose socket errors when using non-blocking IO on Ultrix.
Patch:
Delete or comment out the following code (near line 172) in procedure CheckConnect in tcp/src/POSIX/TCP.m3:
IF Cerrno.errno = Uerror.EINVAL THEN (* special hack to try to get real errno, hidden due to NBIO bug in connect *) VAR optbuf: INTEGER := 0; optlen := BYTESIZE(optbuf); BEGIN EVAL Usocket.getsockopt(fd, Uin.IPPROTO_TCP, TCP_NODELAY, ADR(optbuf), ADR(optlen)); END; END;
The signatures of signal handlers on are system dependent. Obliq contains a signal handler to catch control-C that must be edited on some platforms.
Patch:
The procedure OnSIGINT near line 192 in obliq/src/ObliqOnline.m3 needs an additional ADDRESS parameter under SunOS:
PROCEDURE OnSIGINT(sig, code: Ctypes.int; scp: UNTRACED REF Usignal.struct_sigcontext; (* SPARC *) addr: ADDRESS) = BEGIN (* Thread.Alert(mainThread); *) ObEval.interrupt := TRUE; END OnSIGINT;
kendall@pot.East.Sun.COM (Sam Kendall)
The shmctl system call wrapper fails to pass one of its arguments.
Patch:
In procedure shmctl near line 1075 in libm3/src/runtime/SPARC/RTHeapDepC.C, add the shmid parameter:
*** RTHeapDepC.c.orig Thu Mar 3 12:01:35 1994 --- RTHeapDepC.c Wed Aug 24 15:24:45 1994 *************** *** 1072,1078 **** if (cmd == IPC_STAT || cmd == IPC_SET) { MAKE_WRITABLE(buf); } ! result = syscall(SYS_shmsys, 1, cmd, buf); EXIT_CRITICAL; return result; } --- 1072,1078 ---- if (cmd == IPC_STAT || cmd == IPC_SET) { MAKE_WRITABLE(buf); } ! result = syscall(SYS_shmsys, 1, shmid, cmd, buf); EXIT_CRITICAL; return result; }
thomas@mw.lpc.ethz.ch (Thomas Brupbacher)
======================================================================= Hardware: Sun386i, 16MB RAM, 327 MB Disk, (25 MHz i386/i387) Software: SunOS4.0.2, gcc v 2.5.6, SunOS /bin/as Compiling quake: ================ quake/src/makefile: added -liberty quake/src/fileio.c: Symptom: R_OK/W_OK/X_OK not known Fix: #include <sys/file.h> Symptom: warning: passing arg 1 of `tempnam' makes pointer from integer without a cast Fix: extern char *getenv(); quake/src/operator.c: Symptom: warning: initialization makes pointer from integer without a cast Fix: extern char *getenv(); quake/src/path.c: Symptom: warning: assignment makes pointer from integer without a cast Fix: extern char *strstr(); quake/src/builtin.c: Symptom: No WEXITSTATUS supported on SunOS 4.0.2 Fix: Use the code fragment for SYSTEM_FOR_WIN32 Compiling m3build/m3where: ========================== m3build/src/m3build.cp: m3build/src/m3where.cp: m3build/src/m3mkdir.cp: Symptom: Various messages about converting integer to pointer Fix: "#ifdef sun386", "#include <malloc.h>", "#endif", Compiling the rest: =================== m3c: Symptom: No waitpid() supported on SunOS 4.0.2 Fix: Use waitpid.c from the tcl distribution. A better fix would be to write a M3 version... - Add boot_c ("waitpid") to libm3/SUN386/make.boot - copy waitpid.c to libm3/SUN386 ======================================================================
m3-request@src.dec.com
Last modified on Mon Sep 25 18:25:08 PDT 1995 by heydon modified on Thu Sep 1 08:46:46 PDT 1994 by kalsow