I have upgraded our bin86 from 0.4 to 0.14.9 because lilo 21.4.4
contains some as86 source code that now uses the .asciz pseudo-op.  This
has exposed a bug in as86-0.14.9.

        If you tell as86-0.14.9 to generate a program listing, it
will do writes of a negative size, due to a pointer being null when
it does not expect this to be the case.  The Linux terminal and /dev/null
drivers silently ignore these writes, but the ext2 filesystem (at
least in 2.4.0test1-ac18) interprets the length as unsigned and generates
a "file size limit exceeded" signal.

        When this happens, linebuf points to some valid data.
You shoudl be able to reproduce this problem by attempting to
build dosemu 1.0.0.  Here is an excerpt from the build log:

gcc -E -D__AS86__ --traditional -I../include fossil.S  > fossil.s 
as86 -l -0 -o fossil.o fossil.s > fossil.s.out 
make[4]: *** [/usr/src/emulators/dosemu/1.0.0.0/commands/fossil.com] Error 153 


        I have made the following kludge to work around the problem.
However, I may be misinterpeting the semantics of lineptr == NULL.
It may be that the more correct action is to print nothing, or (more
likely, I think) it may be that lineptr should never be null at this
point, and there is some kind of parser bug in as86-0.14.9.

        Anyhow, please look into this after the remaining build
problems have been fixed.

        I am cc'ing this to the bin86 (H. J. Lu and Robert de Bath, I guess)
and dosemu developers so that they will at least be familiar with
this bug in case anyone else reports it and will know at least one method
that might work around it.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
[EMAIL PROTECTED]     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

--- /tmp/adam/bin86-0.14.9/as/genlist.c Mon Jan  4 06:38:03 1999
+++ bin86/as/genlist.c  Wed Jun 14 13:58:27 2000
@@ -189,11 +189,14 @@
 PRIVATE void list1(fd)
 fd_t fd;
 {
     outfd = fd;
     listcode();
-    write(outfd, linebuf, (unsigned) (lineptr - linebuf));
+    write(outfd, linebuf,
+         (lineptr == NULL ? strlen(linebuf) : (unsigned) (lineptr - linebuf)));
+          /* FIXME: The lineptr == NULL test is a total kludge to avoid
+             getting an error on a serious as86 bug! */
     writenl();
     if (errcount != 0)
        listerrors();
     listpre = TRUE;
     list_force=FALSE;

Reply via email to