home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / sysv386 / 16704 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  47.9 KB

  1. Xref: sparky comp.unix.sysv386:16704 comp.unix.bsd:9184 comp.os.mach:1571 news.answers:4133
  2. Path: sparky!uunet!ornl!sunova!convex!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!cbmvax!snark!esr
  3. From: esr@snark.thyrsus.com (Eric S. Raymond)
  4. Newsgroups: comp.unix.sysv386,comp.unix.bsd,comp.os.mach,news.answers
  5. Subject: Known Bugs in the USL UNIX distribution
  6. Message-ID: <1jWcLX#1Qbqls9Wy5rR5kw7xb4zw81M=esr@snark.thyrsus.com>
  7. Date: 20 Nov 92 21:45:47 GMT
  8. Expires: 20 Feb 93 00:00:00 GMT
  9. Sender: esr@snark.thyrsus.com (Eric S. Raymond)
  10. Followup-To: comp.unix.sysv386
  11. Lines: 1165
  12. Approved: news-answers-request@MIT.Edu
  13.  
  14. Archive-name: usl-bugs
  15. Last-update: Fri Nov 20 16:16:32 1992
  16. Version: 8.0
  17.  
  18. [Note: This issue is being released nearly two weeks ahead of schedule.  This
  19. is because (a) there have been been big changes in the hardware market since
  20. 7.0 --- the 386 is dead, long live the 386, and (b) I received an unusually
  21. large number of additions and corrections during the last week, including
  22. material for a new major section.]
  23.  
  24. What's new in this issue:
  25.    * A table of contents and some reorganization by topic
  26.    * Several new bugs
  27.    * Update on problems fixed and remaining in Dell 2.2.
  28.  
  29. (In the table below, bugs new this issue or old bugs for which information has
  30. been added are marked with a * at the left margin)
  31.  
  32. 0. Table of Contents
  33. I. Introduction
  34. II. General Bugs
  35.     1. Dropout problems with tty devices
  36.     2. Suid programs dump core when signalled
  37.     3. DMAs on large ISA machines may fail
  38.     4. There is a cylinder limit on disk size
  39.     5. shmat(2) vs. vfork(2)
  40.     6. X performance problem
  41.     7. FIONREAD fails on regular files
  42.     8. A security hole in login
  43.     9. COFF problems with long filenames
  44.     10. Flakeouts in the Wangtek device driver
  45. *   11. A kernel declaration bug
  46.     12. fread(3) does the wrong thing on pipes and FIFOs
  47. *   13. Process accounting is broken
  48.     14. tar(1) foos up in the presence of symbolic links
  49. *   15. Symbolic links can interfere with shellscript execution
  50. *   16. Piping a csh builtin causes the shell to hang.
  51.     17. Quick port setup option in sysadm is broken
  52.     18. COFF binaries linked with curses(3) and shared libc hang
  53.     19. shl hangs, sxt devices bad
  54.     20. num-lock prevents mouse from working properly
  55.     21. adjtime() doesn't work
  56.     22. ttymon drops DTR
  57.     23. cron mail doesn't go through aliasing
  58. *   24. fragility in xterm
  59.     25. csh lossage due to bad optimization
  60.     26. Bug in cp(1)
  61.     27. tbl -me doesn't work
  62.     28. who -r fragility leads to boot-time problems
  63.     29. at(1) breaks here-documents in shell scripts
  64. III. Networking and File-Sharing Bugs
  65. *   1. NFS locking is unusably slow
  66.     2. UFS file system problems
  67. *   3. Byte-order problem with NFS when accessing Sun disks
  68.     4. Under weird circumstances, lseek on UFS may cause corruption
  69.     5. FTP problems
  70.     6. A bug in the WD80x3 support
  71. IV. SCSI Support Problems
  72.     1. sar is confused by SCSI
  73.     2. A configuration problem
  74. *   3. Synchronous SCSI hang problem
  75. *   4. ps chokes on commands that do SCSI I/O
  76.     5. Transfer speed problems with Adaptec 1542B on 486s
  77. V. Development Tools Problems
  78.     1. General UCB library brokenness
  79. *   2. USL emulation of BSD signals doesn't work
  80.     3. Possible string library problems
  81. *   4. USL's ndbm support is broken.
  82.     5. An include file is missing
  83.     6. sscanf(3) has a potential bug
  84.     7. Compiler problems
  85. VI. The FUBYTE Problem
  86. VII. Destiny and Dell
  87.  
  88. I. Introduction
  89.  
  90. This posting lists known bugs in System V Release 4 implementations, and known
  91. fixes applied by various porting houses (there's also random bits of
  92. information about SCO UNIX here and there).  It was formerly part of the
  93. 386-buyers-faq issues 1.0 through 4.0, and is still best read in conjunction
  94. with the pc-unix/software FAQ descended from that posting.
  95.  
  96. This document is maintained and periodically updated as a service to the net by
  97. Eric S.  Raymond <esr@snark.thyrsus.com>, who began it for the very best
  98. self-interested reason that he was in the market and didn't believe in plonking
  99. down several grand without doing his homework first (no, I don't get paid for
  100. this, though I have had a bunch of free software and hardware dumped on me as a
  101. result of it!).  Corrections, updates, and all pertinent information are
  102. welcomed at that address.
  103.  
  104. This posting is periodically broadcast to the USENET group comp.unix.sysv386
  105. and to a list of vendor addresses.  If you are a vendor representative, please
  106. check to make sure the information on your company is current and correct.  If
  107. it is not, please email me a correction ASAP.  If you are a knowledgeable user
  108. of any of these products, please send me a precis of your experiences for the
  109. improvement of future issues.
  110.  
  111. The bug descriptions often include indications of fixes by the various porting
  112. houses to their current releases.  These are:
  113.  
  114. Consensys UNIX Version 1.3            abbreviated as "Cons" below
  115. Dell UNIX Issue 2.2                abbreviated as "Dell" below
  116. Esix Revision A                    abbreviated as "Esix" below
  117. Micro Station Technology SVr4 UNIX        abbreviated as "MST" below
  118. Microport System V Release 4.0 version 4    abbreviated as "uPort" below
  119. UHC Version 3.6                    abbreviated as "UHC" below
  120. SCO Open DeskTop 1.1                abbreviated as "SCO" below
  121.  
  122. II. General Bugs
  123.  
  124. 1. Dropout problems with tty devices
  125.    The most serious problem anyone has reported is that the USL asy driver is
  126. flaky and occasionally drops characters at above 4800 baud.
  127.    Microport, Dell, Esix, and UHC say that they believe they've fixed this.
  128. However, Dell, at least, was mistaken when they first made this claim; a more
  129. detailed description of the problem is given below.  I have been assured that
  130. this is on the fix list for the next Dell release.
  131.    Bela Lubkin at SCO comments "386 interrupt latency vs. unbuffered UARTs.
  132. This is a tough problem.  Nobody's driver should drop characters with a
  133. turned-on 16550.  It's not so easy with a 16450.  Anyone with 16450s or lower
  134. should be able to solve their problems by dropping in a 16550."
  135.  
  136. 2. Suid programs dump core when signalled
  137.    Mark Snitily of SGCS says that under many SVr4s, signalling a
  138. process that is running suid root will cause it to core-dump.  He says
  139. Dell and MST have fixed this, and SCO doesn't suffer from this.
  140.  
  141. 3. DMAs on large ISA machines may fail
  142.    On ISA machines with more that 16MB of RAM, SVr4 may try to do DMA
  143. from outside the bus's address space, causing serious problems.  UNIX ought
  144. to do an in-memory copy to within the low 16MB but the USL base code doesn't.
  145.    Dell says they've fixed this, and that's been confirmed by a user.
  146.    UHC says they've fixed this; they add that the special buffer-allocation
  147. logic to handle the problem can be turned off with a tunable kernel parameter
  148. if you've got less than 16M.
  149.    Microport says they've fixed this in their new 4.1 release, shipping early
  150. March.
  151.    Esix offers a patch to correct this problem.
  152.    SCO used to have a similar bug but fixed it long ago.
  153.    John Sully <jms@mport.com> writes: "This was due to a bug in pre version 4
  154. dma code.  The USL code has always at least attempted to do a copy from low
  155. memory to high memory on systems with more than 16Mb of RAM.  By the way UHC is
  156. wrong; the buffer allocation code only comes into play if you have more than
  157. 16Mb of memory.  You can turn it off if you have a machine (ie. an EISA bus)
  158. which will allow you to do DMA above 16Mb.  You *must* have this tunable
  159. (MAXDMAPAGE) turned on if you are using *ISA* bus masters in a system with more
  160. than 16Mb of ram.  Unfortunately doing this will affect all drivers which do
  161. dma as there is no good way to do this on a per-driver basis."
  162.  
  163. 4. There is a cylinder limit on disk size
  164.    Stock USL code is limited to 1,024 cylinders per Winchester, which
  165. might cause problems with some disk drives.
  166.    Microport, Dell, Esix, MST, and UHC have fixed this.
  167.    Bela Lubkin says "SCO's boot filesystem must lie below 1024 cylinder mark;
  168. anything else can be anywhere.  This is more-or-less a limitation of the BIOS
  169. interface that the bootstrap loader must use.  Could be circumvented by going
  170. directly to controller hardware in the bootstrap loader, but that would be
  171. horrendously complex with all the controllers & host adapters to be supported."
  172. This limit probably applies to all other UNIXes as well.
  173.  
  174. 5. shmat(2) vs. vfork(2)
  175.    The shmat(2) call is known to interact bady with vfork(2).  Specifically,
  176. if you attach a shared-memory segment, vfork(), and then the child releases
  177. the segment, the parent loses it too!  Workaround; use fork(2).
  178.    UHC and Microport both suspect that they still have this bug and opine that
  179. anyone who uses vfork deserves to lose.  Dell has no plans to fix it.
  180.  
  181.    John Sully <jms@mport.com> writes: "This is not a bug.  It is completely
  182. consistent with the semantics of a change to the address space of the child.
  183. Think about it: any change to the address space of a child process created by
  184. vfork(2) is reflected in the parent since the child is actually executing in
  185. the parent's address space.  Therefore if the child changes the address space
  186. (in this case by releasing the shared memory segment) what should happen?
  187. Right, the parent should have the same change happen.  And what does happen?
  188. The segment is released in the parent.  One can argue about the braindead
  189. semantics of vfork(2) all day, but the fact remains that this is exactly what
  190. one would expect to happen.  To quote from the manual page:
  191.  
  192.      [...] vfork differs  from fork  in
  193.      that the    child  borrows    the parent's *memory* and thread of
  194.      control until a call to execve or an exit (either by a  call
  195.      to     exit  or  abnormally.) [ emphasis added ]
  196.  
  197. and later:
  198.  
  199.      It does not work, however, to return while
  200.      running in    the child's  context  from  the     procedure  which
  201.      called vfork since    the eventual return from vfork would then
  202.      return to a no longer existent  stack  frame.
  203.  
  204. Please note that the entire address space of the parent is used by
  205. the child created by vfork(2).  The manual page also points out
  206. several other caveats involved in doing anything to the parent's
  207. address space except successfully calling an exec family function or
  208. _exit (note it specifically says *not* to call exit(2)).  I do not believe 
  209. that having a shared memory segment disappear from the parent's address 
  210. space is out of line after reading the man page for vfork(2).
  211.  
  212. It is interesting to note that Sun after implementing its new VM system in
  213. SunOS 4.0 initially had no plans to support vfork, since they felt that the COW
  214. semantics of the new fork would provide the necessary efficiency gain.  Indeed
  215. they found that most programs which used vfork worked just fine by doing
  216. -Dvfork=fork.  All that is, except for a certain popular command interpreter
  217. [ed: can you say C shell?].  So we are stuck with the legacy of this braindead
  218. system call.
  219.  
  220. BTW, Microport has no plans to fix this :-)."
  221.  
  222. 6. X performance problem
  223.    Stock X11R4 and R5 (at least prior to 1.2E) is said to hog the
  224. processor if you use the LOCALCONNECT option.  Jan Brittenson
  225. <bson@gnu.ai.mit.edu> posted the following workaround:
  226.  
  227.    I don't know what causes the standard X server to hog the CPU, but
  228. it can be avoided. Use the following program instead of xinit. Compile
  229. it with `$CC -O -o xserv xserv.c -lX11' where CC is either
  230. /usr/ccs/bin/cc or gcc. Set DISPLAY and XINITRC and run `xserv' from
  231. your home directory. This is just a q&d hack, and not really a
  232. substitute for xinit -- but it works.
  233.  
  234. /* xserv.c -- start X server
  235.  
  236.    Start X server. Similar to xinit, but intended to
  237.    circumvent the X386 CPU Hog Mode
  238.  
  239.    Jan Brittenson, June 2 1992  05:15 am */
  240.  
  241. #include <stdio.h>
  242. #include <sys/types.h>
  243. #include <signal.h>
  244. #include <setjmp.h>
  245. #include <unistd.h>
  246. #include <libgen.h>
  247.  
  248. #include <X11/Xlib.h>
  249. #include <X11/Xos.h>
  250. #include <X11/Xmu/SysUtil.h>
  251.  
  252.  
  253. extern int errno;
  254.  
  255.  
  256. /* Start X server. Fork-exec server, passing the DISPLAY environment
  257.    variable. Wait for server to get up and running (at which point it
  258.    passes back a SIGUSR1), at which point the user xinitrc file is run. */
  259.  
  260. #define DEFAULT_XPATH "/usr/X386/bin/X386"
  261. #define XINITRC ".xinitrc"
  262. #define DEFAULT_XCOMMAND "xterm -g +1+1 -n login -display :0"
  263.  
  264. extern void *malloc (), free ();
  265. extern char *basename (), *getenv (), *strcpy ();
  266.  
  267. /* X stuff */
  268. Display *top_display;
  269.  
  270.  
  271. /* This is supposed to be in libgen.a... */
  272. static char
  273. *basename (s0)
  274.   char *s0;
  275. {
  276.   register char *s1;
  277.  
  278.   for (s1 = s0 + strlen (s0) - 1;
  279.        s1 > s0 && *s1 != '/'; s1--);
  280.  
  281.   if (*s1 == '/')
  282.     return s1+1;
  283.  
  284.   return s1;
  285. }
  286.  
  287. jmp_buf sigusr1_frame;
  288.  
  289. static void
  290. caught_sigusr1 (int dummy) { longjmp (sigusr1_frame, !0); }
  291.  
  292.  
  293. static char
  294. *dispname (s0)
  295.   char *s0;
  296. {
  297.   register char *s1;
  298.  
  299.   for (s1 = s0 + strlen (s0) - 1;
  300.        s1 > s0 && *s1 != ':'; s1--);
  301.  
  302.   return s1;
  303. }
  304.  
  305.  
  306. /* No arguments */
  307. int
  308. main (argc, argv)
  309. int argc;
  310. char **argv;
  311. {
  312.   char *xserver_file, *xinitrc_file, *home_path, *display, *display_X_arg;
  313.   int xserver_pid, orgmask;
  314.   
  315.   
  316.   /* Not that it really matters, just to avoid being used as a direct
  317.      replacement for xinit. */
  318.   
  319.   if (argc != 1)
  320.     {
  321.       fprintf (stderr, "usage: %s\n", basename (*argv));
  322.       exit (1);
  323.     }
  324.   
  325.   
  326.   /* Resolve xinitrc path. This is done before the server is
  327.      started. */
  328.   
  329.   if (!(home_path = getenv ("HOME")))
  330.     home_path = "/etc";
  331.   
  332.   if (!(xinitrc_file = getenv ("XINITRC")))
  333.     {
  334.       xinitrc_file = malloc (strlen (home_path) + 1 + strlen (XINITRC) + 1);
  335.       sprintf (xinitrc_file, "%s/%s", home_path, xinitrc_file);
  336.     }
  337.   else
  338.     xinitrc_file = strdup (xinitrc_file);
  339.  
  340.  
  341.   /* Resolve display */
  342.   if (!(display = getenv ("DISPLAY")))
  343.     display = display_X_arg = ":0.0";
  344.   else
  345.     display_X_arg = dispname (display);
  346.  
  347.  
  348.   /* Tell server to notify us when up and running */
  349.   signal (SIGUSR1, SIG_IGN);
  350.   orgmask = sigblock (sigmask (SIGUSR1));
  351.  
  352.   /* Start server */
  353.   if (!(xserver_pid = vfork ()))
  354.     {
  355.       xserver_file = DEFAULT_XPATH;
  356.       
  357.       execl (xserver_file, xserver_file, display_X_arg, NULL);
  358.  
  359.       fprintf (stderr, "%s: can't exec %s (errno = %d) -- start-up aborted\n",
  360.                basename (*argv), xserver_file, errno);
  361.       exit (1);
  362.     }
  363.  
  364.   if (xserver_pid < 0)
  365.     {
  366.       fprintf (stderr, "%s: can't fork (errno = %d) -- start-up aborted\n",
  367.                basename (*argv), errno);
  368.       
  369.       exit (1);
  370.     }
  371.   
  372.   /* Await signal from server */
  373. #if 0
  374.   /* Why the #@$*! doesn't this work?! */
  375.   sigsetmask (orgmask);
  376.   alarm (20);
  377.   sigpause (sigmask (SIGUSR1) | sigmask (SIGALRM));
  378. #else
  379.   sleep (5);
  380. #endif
  381.  
  382.   /* Open display */
  383.   if (!(top_display = XOpenDisplay (display)))
  384.     {
  385.       fprintf (stderr, "%s: unable to open display '%s' -- start-up aborted\n",
  386.                basename (*argv), display);
  387.       exit (1);
  388.     }
  389.   
  390.   /* Execute xinitrc file */
  391.   if (system (xinitrc_file) < 0)
  392.     system (DEFAULT_XCOMMAND);
  393.       
  394.   /* Close display */
  395.   XCloseDisplay (top_display);
  396.  
  397.   /* Terminate server */
  398.   kill (xserver_pid, SIGTERM);
  399.  
  400.   /* Finished */
  401.   free (xinitrc_file);
  402. }
  403.  
  404. 7. FIONREAD fails on regular files
  405.   Christoph Badura <bad@generics.ka.sub.org> reports that the FIONREAD ioctl()
  406. fails on regular (disk) files.  He has sent USL a one-line kernel fix.
  407.  
  408. 8. A security hole in login
  409.    David Wexelblat <dwex@mtgzfs3.att.com> reports: "There is a HUGE security
  410. hole in /bin/login in all USL derived SVR4s before 4.0.4.  Refer to CERT
  411. advisory CA-91:08, dated 5/23/91.  This is known to be present in AT&T SVR4
  412. 2.1, and Microport SVR4 3.1.  ESIX claims to have fixed it, Microport reports
  413. that it is fixed in 4.1.  I won't give any more details unless necessary.
  414. Suffice to say that this bug allows any non-privileged user on an SVR4 system
  415. to get read-write access to any file on the system."
  416.  
  417. 9. COFF problems with long filenames
  418.    A source at Dell urges: "Our SVR4v2 did some stuff that USL didn't get
  419. around to until SVR4v4.  Try Dell UNIX 2.1 with a COFF program on a large UFS
  420. filesystem in a directory with long names.  Runs on Dell UNIX.  Breaks on
  421. others."  I don't have more definite info yet.
  422.  
  423. 10. Flakeouts in the Wangtek device driver
  424.    Dell reports that USL's Wangtek device driver is seriously flaky.  "How'd
  425. you like a multi volume backup where the second and subsequent volumes don't
  426. follow on from the previous volumes?"  UHC confirms this and is actively
  427. working on the problem.
  428.    An anonymous SCOer says "The QIC02 tape controller `standard' is seriously
  429. flaky.  Our driver's in pretty good shape but nobody will ever have a truly
  430. solid driver that supports every QIC02 controller you can find."
  431.    Gordon Ross <gwr@mc.com> reports: "Actually, the SCSI tape target driver
  432. `st01' has a similar problem at version 4.0.3 which I corrected while I worked
  433. on the SVR4 code.  The correction was provided to the support group at USL.
  434. The actual problem was that the SCSI tape would return a `check status'
  435. completion code which was just trying to inform the driver of the arrival
  436. of the `logical end of media' indication but the driver was treating it
  437. as an error.  The tape drive had in fact written the data, but the driver
  438. incorrectly assumed that the "check status" return meant that it failed.
  439. The result of this is that when you write into the end of the tape, you
  440. can read back one more "chunk" than yu wrote.  Of course, cpio does not
  441. like this at all when doing multi-volume backups..."
  442.  
  443. 11. A kernel declaration bug
  444.     A botch in USL's /etc/conf/pack.d/kernel/space.c (which is present in
  445. Consensys 1.3, Dell 2.1, Esix 4.0.3A, Microport 4.0.3 and 4.0.4 and may also be
  446. present in other SVr4s) can step on the linesw[] table.  The problem is that
  447. the domain name array initialization is wrong and too short; thus, when it's
  448. set, data past the end of the array can be stomped.  To fix this, find the
  449. following near line 247:
  450.  
  451.     char srpc_domain[] = SRPC_DOMAIN;
  452.  
  453. and change it to
  454.  
  455.     char srpc_domain[SYS_NMLN] = SRPC_DOMAIN;
  456.  
  457. then rebuild the kernel.
  458.    Microport officially knows about this bug and plans to fix it in a
  459. near-future update release.  It has been fixed in Dell 2.2.
  460.  
  461. 12. fread(3) does the wrong thing on pipes and FIFOs
  462.    Ed Hall <edhall@rand.org> writes: "Unlike the raw read() system call,
  463. fread() is supposed to be able to make several partial reads to satisfy the
  464. data requested by its arguments.  The exceptions are an EOF or an error on the
  465. stream.  This characteristic is quite useful when moving data through pipes or
  466. over network connections, since partial reads are quite common in these cases.
  467. Well, the version of fread() in ESIX 4.0.3 (and likely other Sys5R4's) only
  468. does a single physical read, and if it only satifies part of the requested
  469. number of bytes, that's all you get.  This can sting you even if you carefully
  470. check the value returned by fread(), since the value returned is rounded down
  471. to the number of complete "nitems" read, although your position in the stream
  472. can be up to size-1 bytes beyond that point.  Neither ferror() nor feof()
  473. indicate anything is wrong when this happens."
  474.    This bug (which is also present in 4.0.4) is serious and nasty and should
  475. be high on every porting house's list to fix.  It appears to be peculiar to
  476. USL 4.0.3 and 4.0.4; 4.0.2 does *not* have it, nor does SCO.
  477.    A USL source claims it has been fixed in 4.1.
  478.  
  479. 13. Process accounting is broken
  480.     In 4.0.3, process accounting doesn't work.  From examining the accounting
  481. scripts, it appears that /usr/lib/acct/accton is supposed to set a return code
  482. depending on whether accounting was switched on already or not.  However, it
  483. always returns the same result - accounting switched off.  This means that the
  484. /usr/lib/acct/ckpacct script, which is run every hour to keep the proccess
  485. accounting log in check, instead turns off accounting the first time it is run
  486. after booting.  The same happens with the nightly /usr/lib/acct/monacct
  487. program.
  488.    I don't yet know whether this bug is present in 4.0.4.  It is definitely
  489. un-fixed in Dell 2.1 and Consensys 1.3.  In Dell 2.2 the return bug is fixed,
  490. but accounting isn't automatically enabled at boot time.
  491.  
  492. 14. tar(1) foos up in the presence of symbolic links
  493.     Tar can get the names of symbolic links wrong when creating an archive.
  494. This bug can be demonstrated by doing the following:
  495.  
  496.    mkdir t
  497.    cd t
  498.    touch a 1234567890
  499.    ln -s 1234567890 b
  500.    ln -s a c
  501.    tar vcf ../t.tar .
  502.  
  503.    The output generated by tar is:
  504.  
  505.    a ./ 0 tape blocks
  506.    a ./a 0 tape blocks
  507.    a ./1234567890 0 tape blocks
  508.    a ./b symbolic link to 1234567890
  509.    a ./c symbolic link to a234567890
  510.  
  511. (Note the above commands should be done in the order shown and in a new
  512. directory)  This bug is nasty.  Recommended solution: use GNU tar.
  513.    This is reported from Esix 4.0.3 and Consensys 1.3, but probably exists on
  514. other SVr4s as well.
  515.  
  516. 15. Symbolic links can interfere with shellscript execution
  517.    There is a problem running #! scripts when symbolic links are involved.
  518. Typing in the following from a command shell demonstrates the problem:
  519.  
  520.    mkdir a b
  521.    ln -s a c
  522.    cd a
  523.    cat > script <<!
  524.    #!/bin/sh
  525.    echo Hello
  526.    !
  527.    chmod 755 script
  528.    cd ../b
  529.    ln -s ../c/script .
  530.    ./script
  531.  
  532. The message generated from the last line is:
  533.  
  534.      a/script: a/script: cannot open
  535.  
  536.    This is reported from Esix 4.0.3, Consensys 1.3, and Dell 2.2, but
  537. probably exists on other SVr4s as well.
  538.  
  539. 16. Piping a csh builtin causes the shell to hang.
  540.    While running csh, this can be demonstrated by some of the following:
  541.  
  542.    echo Hello | cat
  543.    history | more
  544.  
  545. (A solution to this one is use tcsh-6.02.)
  546.    This is reported from Esix 4.0.3 and Consensys 1.3, but probably exists on
  547. other SVr4s as well.  It is reported fixed in Dell 2.2.
  548.  
  549. 17. Quick port setup option in sysadm is broken
  550.    In 4.0.3 sysadm, the quick port setup option, which is used to add and
  551. delete terminal ports, is seriously broken.  The script modifies /etc/conf/*
  552. files, and has incorrect minor numbers, sets the 5th field of sdevice.d if Y
  553. when it should be N, and is missing columns for node.d.  See
  554. /usr/sadm/sysadm/bin/q-add.
  555.  
  556. 18. COFF binaries linked with curses(3) and shared libc hang
  557.    ...eating the CPU.  Cause unknown.
  558.  
  559. 19. shl hangs, sxt devices bad
  560.    shl(1) does not work.  Try creating a layer and doing an 'ls'.  Your session
  561. hangs.  Bruce Momjian <root%candle.uucp@bts.com>, who reported this bug, says
  562. he believes it is the sxt devices which are broken.  It definitely exists in
  563. Consensys 1.3.
  564.  
  565. 20. num-lock prevents mouse from working properly
  566.    When using the Motif window manager, if your num lock is on, your mouse
  567. clicks are not recognized by the window manager.  The mouse still works in
  568. xterm(1).  This is allegedly fixed in Destiny (4.2).
  569.  
  570. 21. adjtime() doesn't work
  571.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 adjtime() doesn't.
  572. Calling `date -a' works to adjust the time slowly.
  573.  
  574. 22. ttymon drops DTR
  575.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 the ttymon(1)
  576. utility for HDB uucp drops DTR every few weeks.  The workaround is to disable
  577. and re-enable it.
  578.  
  579. 23. cron mail doesn't go through aliasing
  580.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 cron mail to adm
  581. doesn't get redirected by the aliases file.
  582.  
  583. 24. fragility in xterm
  584.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6, doing ~! from
  585. a cu in xterm kills xterm.  This has been fixed in Dell 2.2.
  586.  
  587. 25. csh lossage due to bad optimization
  588.   If a csh user sources a non-existent file in their .cshrc (eg, source .alias,
  589. where .alias doesn't exist), then the system will hang for a couple of minutes.
  590. Eventually the user get an "Out of memory" error and the console logs "NOTICE:
  591. out of swap space - Insufficient memory to allocate 2 pages - system call
  592. failed".
  593.   This appears to be due to over-optimization of code surrounding a longjmp
  594. call.
  595.   (There are numerous other reports of memory leak bugs in csh).
  596.  
  597. 26. Bug in cp(1)
  598.    If ``copy'' encounters a directory before a file, it dumps core ...
  599.  
  600. --- cut ---
  601. cd /tmp
  602. mkdir copybug jnk
  603. cd jnk
  604. mkdir directory
  605. >file
  606. cp -r * /tmp/copbug
  607. --- cut ---
  608.  
  609. This was reported from Consensys 4.0.3 but is probably a generic SVr4 bug.
  610.  
  611. 27. tbl -me doesn't work
  612.    Wolfgang Denk reports that trying to use "tbl -me" for any input file causes
  613. tbl to quit.  The problem is that newer tbl versions don't accept [nt]roff
  614. contol lines (".rm @W") after .TS.
  615.  
  616. 28. who -r fragility leads to boot-time problems
  617.   It coredumps if the name of the timezone is longer than three characters.
  618. This can be a real problem for European sites...  and is potentially more
  619. hazardous than immediately apparent as _a lot_ of the initialization scripts
  620. (rc1.d, rc2.d) use ``who -r'' to see if the machine is in single- or multi-user
  621. mode.  And when ``who'' bombs out, the ``set'' command is iven an empty
  622. command-line and can't do much else than print the shell variables, $1-$9
  623. remain empty ... meaning that more or less all the scripts fail in various ways
  624. and the system has an exceptionally hard time coming up.
  625.  
  626. 29. at(1) breaks here-documents in shell scripts
  627.    at adds gratuitous empty lines to the job submitted by the user.
  628. This prevents shell here-documents from working.
  629.  
  630. III. Networking and File Sharing Bugs 
  631.  
  632. 1. NFS locking is unusably slow
  633.    Randy Terbush <randy@dsndata.dsndata.com> has posted code which
  634. demonstrates a serious bug in the SVr4 NFS locking daemon.
  635.    In his own words: "The symptoms are ~30% cpu usage by 'lockd' and
  636. severe slowing of the machines on the network.  This program
  637. demonstates that it takes ~20 seconds to obtain locks from an ailing
  638. 'lockd'.  We have verified that this bug does not exist in HPUX 8.0x."
  639.    Randy's code is too large to be included here.  He is, quite
  640. rightly, exercised at USL's exceedingly slow response to this problem.
  641. The comment in his makefile reads, in part:
  642.  
  643. # USL has admitted to the existance of this bug in version 4.0, 4.1,
  644. # and 4.2 of their distributed and yet to be released sources.  This is
  645. # a network crippling problem that they have refused to fix until
  646. # release 4.3, which will be OVER 1 YEAR from today. (29 Oct 1992)
  647. # If your version of 'lockd' exhibits this same problem, I would
  648. # strongly urge you to contact your vendor and ask them to put some
  649. # pressure on USL to fix this problem.  SVR4 is virtually useless in a
  650. # network of shared resources while this problem exists.
  651.  
  652. 2. UFS file system problems
  653.    In stock USL 4.0.3, you can't use a UFS file system as the root; the system
  654. hangs if you try.  Consensys, Dell, Esix, Microport, MST, UHC, and ESIX all
  655. appear to have fixed this.
  656.    David Aitken, the UNIX product manager at UHC, writes "The ufs as root file
  657. system [problem] was not really a bug, just a little oversight on USL's part -
  658. we have fixed it completely by adding one line to the /stand/boot script:
  659. rootfstype=ufs!"  He adds that they've been using ufs on their lab machines for
  660. over 10 months with no trouble, and the latest UHC release defaults to ufs if
  661. you have more than 120MB of disk.
  662.  
  663. 3. Byte-order problem with NFS when accessing Sun disks
  664.    Christoph Badura <bad@generics.ka.sub.org> notes that the stock USL resolver
  665. library suffers from serious confusion about the byte order in the
  666. socketaddr_in structure.  This bug is acknowledged by USL for the 4.0.4
  667. release.  A symptom of this bug is that Sun disks will not mount correctly over
  668. NFS. As a workaround, try removing the references to /usr/lib/resolv.so from
  669. /etc/netconfig and rebooting your system.  Unfortunately, this will mean
  670. you can't use nameservers.
  671.    Alan Batie <batie@agora.rain.com> writes: "Actually, you don't have to
  672. remove resolv.so, just put tcpip.so first and have a hosts file with the names
  673. of hosts you want to do NFS mounts from.  This way you can use nameservers for
  674. most things."
  675.  
  676. 4. Under weird circumstances, lseek on UFS may cause corruption
  677.   Christoph Badura <bad@generics.ka.sub.org> reports that a UFS lseek() to an
  678. offset which is a multiple of 4096 but not a multiple of 8192, followed by a
  679. write(), may corrupt the file being written.  The bug shows up only, if the
  680. file has no pages in the page pool associated with it at the seek offset and at
  681. 4k before the seek offset.  He has sent USL kernel fix for this, which was
  682. included in 4.0.4.
  683.  
  684. 5. FTP problems
  685.   The in.ftpd on SVR4.0.3 does not support all the commands listed in RFC 959.
  686. When recent SCO UNIX/ODT versions ftp to SVR4.0.3, the SVR4 side will refuse,
  687. drop the connection, and core dump after you authenticate.  This is because the
  688. SCO end sends the 'SYST' command ala RFC 959, and the SVR4.0.3 end doesn't
  689. recognise it.  Some ports have fixed this.
  690.   Christoph Badura adds: "The bug is do to a longjmp(3) on a sigjmpbuf obtained
  691. by sigsetjmp(3). ARGH. Testing led to a bug in the original BSD sources, which
  692. is still present in the NET/2 ftpd.  "
  693.  
  694. 6. A bug in the WD80x3 support
  695.    MST reports a serious bug in the SVr4 kernel support for this card.  Here's
  696. how to reproduce it:
  697.  
  698.     server: init 3 and share (export) /usr for example.
  699.  
  700.     client: mount -F nfs server:/usr /mnt
  701.         cd /mnt
  702.         find . -print | cpio -ocBuv > /dev/null
  703.  
  704.     what happens:
  705.         server and client will "hang" together.
  706.  
  707.     "cue":
  708.         hit keys on server and/or client, hang will go away
  709.         for 10-20 seconds temporarily.  Yank BNC connectors
  710.         do the same trick.
  711.  
  712.    They say they've heard from customers that this happens on Dell, UHC as well
  713. as USL 4.0.4.  PCNFS/BWNFS network xcopy suffers this as well.  Client can be a
  714. Sun Sparc for that matter.
  715.  
  716. IV. SCSI Support Problems
  717.  
  718. 1. sar is confused by SCSI
  719.    Sar -d doesn't work on SCSI drives.  Dell fixed this in 2.1 and it's
  720. reported to work OK in Esix 4.0.3A; no report of any other SVr4 having fixed
  721. this yet.  SCO fixed it in 3.2.4.
  722.  
  723. 2. A configuration problem
  724.    Stock USL requires you to jumper your SCSI devices to fixed IDs
  725. during installation (it can be changed to any other ID after).  
  726.    Dell says they've fixed this.  The requirement is definitely still present
  727. in Esix and Consensys 1.3.  UHC thinks they've fixed this, but their 4.0.3.6
  728. release still seems to demand ID 1 to install. 
  729.  
  730. 3. Synchronous SCSI hang problem
  731.    David Wexelblat <dwex@mtgzfs3.att.com> reports: "Stock SVR4.0.3 will hang
  732. the SCSI bus with a 1542 in synchronous mode.  Dell fixed this, and this has
  733. been given to Microport [ed note: Microport 4.0.4 and Consensys 4.0.3 have
  734. fixed the problem; MST UNIX and Esix 4.0.3 still have this problem; I have not
  735. yet been able to determine if ESIX 4.0.4 does].  In the file /sbin/bcheckrc,
  736. change the line:
  737.  
  738.     echo MARK > /dev/rswap
  739.  
  740. to
  741.         
  742.     echo MARK | dd of=/dev/rswap bs=512 conv=sync > /dev/null 2>&1
  743.  
  744. The magic is apparently the conv=sync, which forces a 512 byte block
  745. to be written.  The original echo writes 4 bytes, which apparently causes
  746. synchronous SCSI to go out to lunch.
  747.  
  748. Now, you ask, how can I fix this, since the system won't boot?  There are
  749. a couple of methods.  First, if possible, disable synchronous negotiation
  750. (1542 jumper J5-1 removed, plus whatever you may need to do to your drive).
  751. Then boot up, edit /sbin/bcheckrc, then shutdown, restrap for synchronous,
  752. then reboot.  Everything should be OK.
  753.  
  754. That's the easy way.  Unfortunately, some hard drives will only work
  755. in synchronous mode.  Well, you can still recover from this phenomenon.
  756. Here's how:
  757.  
  758.         1) Install on your hard drive
  759.         2) Boot from the first boot floppy.  When it tells you to, insert
  760.            the second boot floppy.  At the first prompt, hit <DEL> to
  761.            break out to a shell.
  762.         3) Mount your hard drive under /mnt with the following command
  763.            (replace FS-TYPE with s5, s52, or ufs, whichever you used for
  764.            for your root partition):
  765.  
  766.                 /etc/fs/FS-TYPE/mount /dev/dsk/c0t0d0s1 /mnt
  767.  
  768.         4) Now edit /mnt/sbin/bcheckrc:
  769.  
  770.                 ed /mnt/sbin/bcheckrc
  771.  
  772.            You may want the 'ed' man page handy (I barely remember how to
  773.            to use 'ed' :->).  For simplicity, you can delete/comment out
  774.            the offending line, then replace it with the correct line later.
  775.         5) Unmount the hard drive:
  776.  
  777.                 umount /mnt
  778.  
  779.         6) Reboot from the hard drive.  Everything should come up OK. and
  780.            you can finish editing /sbin/bcheckrc, if necessary.
  781.  
  782. Note that you perform these actions at your own risk.  The first version was
  783. performed by me on Microport SVR4, and the second was performed by someone
  784. else (on my suggestion) on ESIX SVR4."
  785.    This problem appears to be fixed on Consensys 1.3 and Dell 2.1.
  786.  
  787. 4. ps chokes on commands that do SCSI I/O
  788.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6, ps
  789. doesn't work when a SCSI command in progress. It stops printing at the
  790. process executing the scsi command.
  791.   This is still broken in Dell 2.2.
  792.  
  793. 5. Transfer speed problems with Adaptec 1542B on 486s
  794.   If a system mount or install fails, try setting the DMA speed to 5MB/s,
  795. rather than the default 5.7MB/s.  This is accomplished by removing the jumper
  796. shorting the 12th pin pair of jumper block 5.
  797.  
  798. V. Development Tools Problems
  799.  
  800. 1. General UCB library brokenness
  801.    The BSD compatibility libraries were badly broken in USL code.  A Dell
  802. source adds "That meant that almost all the apps derived from them were broken
  803. too.  Most stuff like automount will die when you send a SIGHUP, instead of
  804. rereading the map file.  You can get a system into very strange states when
  805. that happens."
  806.    John Sully <jms@mport> of Microport opines: "This is a bug in automount
  807. itself rather than BSD compatibility, since the automount which comes with SVR4
  808. is not compiled with the BSD libraries.  (isn't this comforting??  :-()."
  809.  
  810.    Esix and UHC's BSD libraries are USL stock.  I don't yet know
  811. the status of other ports.  Microport has run into things they think may be
  812. symptoms of this but have no fix yet.
  813.  
  814.    John Sully <jms@mport> of Microport counters with: "One common thread I find
  815. on reading of these problems is that the BSD compatibility libraries are
  816. *misused*. [...] The problem is that BSD and SYSV have similarly named .h files
  817. which sometimes contain different definitions for objects with the same name.
  818. This has been known to cause all sorts of problems because the SYSV headers are
  819. picked up and then the calls are satisfied from the BSD library rather than the
  820. shared object library.  I have found that if you use /usr/ucb/cc that the BSD
  821. compatibility is much less broken than it would seem at first because it
  822. ensures that the correct headers are picked up."
  823.  
  824.    However, note that there is at least one *real* bug known --- as of 4.0.4
  825. the signal emulation cannot explicitly set a handler to SIG_DFL or SIG_IGN.
  826.  
  827.    Ron Guilmette <rfg@ncd.com> writes "[Library lossage] may be easily
  828. demonstrated by attempting to build and link the GNU C compiler with
  829. `-L/usr/ucblib -lucb'.  The resulting compiler will most certainly
  830. crash and die."  John Sully thinks this is because the /usr/ucb/cc
  831. compiler should have been used, but wasn't.
  832.  
  833. 2. USL emulation of BSD signals doesn't work
  834.    A different source reports that the the USL implementatation of BSD signals
  835. is broken in both 4.0.3 and 4.0.4; in particular, the sigvec() family doesn't
  836. work properly.  It is possible to make minor tweaks to source to make such apps
  837. work properly with the native USL signals implementation.
  838.  
  839.    Here's more on the signals problem, thanks to Richard <rc@siesoft.co.uk>:
  840. ------------------------------------------------------------------------------
  841. The problem is to do with the signal() function that is within the BSD
  842. compatability libc. 
  843.  
  844. To reproduce the problem do the following:
  845.  
  846. #include <stdio.h>
  847. #include <sys/types.h>
  848. #include <signal.h>
  849. #include <sys/siginfo.h>
  850.  
  851. main()
  852. {
  853.     signal(SIGPIPE,SIG_IGN);
  854.     pause();
  855. }
  856.  
  857. and compile it with cc xx.c -o xx /usr/ucblib/libucb.a
  858.  
  859. (John Sully observes that this is definitely wrong; /usr/ucb/cc should have
  860. been used rather than "cc ... -L/usr/ucblib -lucb" or the equivalent "cc ...
  861. /usr/ucblib/libucb.a".)
  862.  
  863. If you run the program and then signal it with a SIGPIPE, the program
  864. will die, even though you've told it to ignore SIGPIPE.
  865.  
  866. The fix is difficult unless you've got source because there's a missing 'else'
  867. clause from the signal() code. This is the only signal fault I've found in
  868. the BSD signal functions, details of the rumoured sigvec problem would be
  869. useful?
  870.  
  871. If you're trying to compile an application you could change the application
  872. code to do the following, this does work..
  873.  
  874. void
  875. catch(s)
  876. int    s;
  877. {
  878.     /* DO NOTHING */
  879.     ;
  880. }
  881.  
  882. main()
  883. {
  884.     signal(SIGPIPE,catch);
  885.     pause();
  886. }
  887.  
  888. SUMMARY
  889. You can only change a signal handler to a function handler, any number of
  890. times.  Any attempt to set the handler to SIG_DFL, or SIG_IGN will fail.
  891.  
  892. This bug has given some people working with X11R5 aggro, causing the X server
  893. to die when you close a client. 
  894.  
  895.   Christoph Badura <bad@flatlin.ka.sub.org> confirms this bug
  896. He has sent USL a source fix.  It appears already to have been fixed in Dell
  897. 2.2.
  898. ------------------------------------------------------------------------------
  899.  
  900. 3. Possible string library problems
  901.    There are also persistent rumors of problems in the BSD-emulation string
  902. libraries.  I have not been able to pin down specifics on this.
  903.  
  904. 4. USL's ndbm support is broken.
  905.    Christoph Badura <bad@generics.ka.sub.org> reports "The ndbm functions in
  906. the ucb library are broken [apparently due to a compiler of optimizer bug in cc
  907. -- ed.].  Try makeing the whatis data base for /usr/share/man with Tom
  908. Christiansen's perl rewrite of man.  The easiest way to fix this is to compile
  909. ndbm.c with gcc -fpcc-struct-return -traditional (gcc1.40 or 2.2 will do
  910. nicely).  This option is only available to the SVR4 vendors."
  911.  
  912. 5. An include file is missing
  913.    Both 4.0.3 and 4.0.4 USL versions are missing the documented dial.h
  914. file from their /usr/include directory.  Dell 2.1 has it.
  915.  
  916. 6. sscanf(3) has a potential bug
  917.    Anthony Shipman <als@bohra.cpg.oz.au> reports: " I found the following bug
  918. in SCO Unix 3.2.* and I think it may be common to many AT&T derived Unixes.
  919.  
  920. sscanf() calls _doscan() to read from a pretend file.  The file
  921. uses the string as a buffer and a fake file descriptor of 60 (=_NFILE).  
  922. Since _NFILE (for SCO UNIX) is 60 it assumes that fd 60 can never be open.
  923.  
  924. Then when fscanf() hits the end of the string it calls _filbuf() to read
  925. into the buffer (which is the string) from fd 60.  This should fail with
  926. an errno=9 and then _filbuf() sets EOF and it all terminates.
  927.  
  928. However in SCO Unix you can reconfigure the kernel to increase the number
  929. of files per process to a recommended maximum of 150.  If you do this then
  930. your program might have fd 60 open one day.  Then sscanf() will read from this
  931. file overwriting your string.  The byte count to the read() in _filbuf() 
  932. is some undefined but large value so a lot of memory will be overwritten.  In
  933. my case the string was on the stack so my stack was wiped.
  934.  
  935. In short if you configure your kernel to have NOFILES > _NFILE ie more than
  936. the default then sscanf() is a time bomb in your code."
  937.  
  938. 7. Compiler problems
  939.    Ronald Guilmette <rfg@ncd.com> also reports the following:
  940.  
  941. ------------------------------------------------------------------------------
  942. /* Here is a bug in the original SVR4 C compiler (aka C Issue 5) which
  943.    effectively prevents you from making good use of the `const' and
  944.    `volatile' qualifiers defined by ANSI C in conjunction with pointer
  945.    types and typedef statements.  Compile this code and you will get:
  946.  
  947.    "qualifiers.c", line 23: left operand must be modifiable lvalue: op "="
  948.  
  949.    ...if your copy of the svr4 C compiler still has the bug.  Note that
  950.    given these declarations, the ANSI C standard say that the thing pointed
  951.    to by the variable `pci' should be considered to be constant... not the
  952.    variable `pci' itself.  (The GCC compiler, either version 1.x or version
  953.    2.x, correctly compiles this example without complaint.)
  954. */
  955.  
  956. typedef const int *ptr_to_const_int;
  957.  
  958. ptr_to_const_int pci;
  959.  
  960. int i;
  961.  
  962. void main ()
  963. {
  964.   pci = &i;
  965. }
  966. ------------------------------------------------------------------------------
  967. /* Here is a subtle bug in the original SVR4 C compiler (aka C Issue 5)
  968.    which prevents you from first declaring a tagged type (i.e. a struct
  969.    type or a union type) in a parameter list, and then defining that tagged
  970.    type later on within the same scope.  (Note that according to the ANSI C
  971.    standard, the scope in which parameters get declared and the outermost
  972.    block of a function body are one and the same scope.  Thus, this really
  973.    is legal ANSI C code!)
  974.  
  975.    Try compiling this with your C compiler on SVR4.  If your compiler still
  976.    has the bug, you will get:
  977.  
  978.    "tagged_type.c", line 24: warning: dubious tag declaration: struct S
  979.    "tagged_type.c", line 28: warning: improper member use: i
  980.    "tagged_type.c", line 28: warning: improper member use: i
  981.    "tagged_type.c", line 31: warning: dubious tag declaration: struct S
  982.    "tagged_type.c", line 35: warning: improper member use: i
  983.    "tagged_type.c", line 35: warning: improper member use: i
  984.  
  985.    (The GCC compiler also had this bug in version 1.x, but it has been fixed
  986.    in version 2.x.)
  987. */
  988.  
  989. void foobar1 (arg)        /* use old-style without prototypes */
  990.     struct S *arg;
  991. {
  992.   struct S { int i; };        /* define the type `struct S' */
  993.  
  994.   arg->i = arg->i;        /* legal according to ANSI C rules! */
  995. }
  996.  
  997. void foobar2 (struct S *arg)    /* use new-style with prototypes */
  998. {
  999.   struct S { int i; };        /* define the type `struct S' */
  1000.  
  1001.   arg->i = arg->i;        /* legal according to ANSI C rules! */
  1002. }
  1003. ------------------------------------------------------------------------------
  1004. /* Here is a serious bug in the original SVR4 `dump' program which dumps
  1005.    out parts of object files in either plain hex form or symbolically.
  1006.  
  1007.    To see the `dump' program get a segfault and die, save this code under
  1008.    the name `dump-bug.c' and then do:
  1009.  
  1010.     cc -g -c dump-bug.c
  1011.     dump -v -D dump-bug.o
  1012.  
  1013.    The bug arises whenever `dump' tries to read Dwarf debugging information
  1014.    for an array of pointers to any "user defined" type (e.g. `struct S' in
  1015.    this example).  Past that point, `dump' is totally confused, so further
  1016.    Dwarf debugging information finally causes it to go belly-up.
  1017. */
  1018.  
  1019. struct S { int i; };
  1020. struct S *array[10];
  1021. int j;
  1022. ------------------------------------------------------------------------------
  1023. It appears that the svr4 C compiler (for x86 machines) doesn't conform real
  1024. well to either the letter or the spirit of the IEEE 754 floating-point
  1025. standard.  In particular, "unordered comparisons" and other operations on
  1026. NaNs don't always produce the result that that the IEEE 754 standard calls
  1027. for.
  1028.  
  1029. An AT&T source comments: "This is documented in the SVID as a future direction.
  1030. We do not support NaNs in -Xa and -Xt modes, only in -Xc.  Try
  1031. isnan(sqrt(-1.0)) to determine which modes support it."
  1032. ------------------------------------------------------------------------------
  1033.  
  1034. The compiler fails to issue diagnostics for cases where a floating point
  1035. literal is given which exceeds the range of its type (either float or
  1036. double).  Actually this one could be argued either way, since IEEE FP
  1037. format includes "infinities" and the compiler probably just changes any
  1038. FP value which is out of range for its type into either positive infinity
  1039. or negative infinity (as appropriate).
  1040.  
  1041. The compiler fails to issue diagnostics in cases where a typedef name is
  1042. reused to declare a formal parameter, as in:
  1043.  
  1044. -----------------------------------------------------------------------
  1045. typedef int FOO;
  1046. void bar (FOO)
  1047.     int FOO;
  1048. {
  1049. }
  1050. -----------------------------------------------------------------------
  1051.  
  1052. The compiler crashes on the following invalid input:
  1053.  
  1054. -----------------------------------------------------------------------
  1055. int i;
  1056. volatile void *pvv;
  1057.  
  1058. void pvv_test ()
  1059. {
  1060.   (i ? *pvv : *pvv);    /* ERROR */
  1061. }
  1062. -----------------------------------------------------------------------
  1063.  
  1064. The compiler fails to issue diagnostics for cases where an attempt is
  1065. made to "forward declare" an enum type (without also defining it), as
  1066. in:
  1067.  
  1068. -----------------------------------------------------------------------
  1069. enum enum0 *ep;       /* ERROR */
  1070. -----------------------------------------------------------------------
  1071.  
  1072. The compiler rejects the following code with an error, although there
  1073. seems to be no good reason why it should (because no object is being
  1074. declared).
  1075.  
  1076. -----------------------------------------------------------------------
  1077. #include <limits.h>
  1078.  
  1079. typedef char array_type[ULONG_MAX];
  1080. -----------------------------------------------------------------------
  1081.  
  1082. VI. The FUBYTE Problem
  1083.  
  1084. (Thanks to Christoph Badura <bad@flatlin.ka.sub.org> for this info)
  1085.  
  1086. The kernel function fubyte() is documented to return a positive value when
  1087. given a valid user space address and -1 otherwise. In the latter case u.u_error
  1088. is set to EFAULT.  USL SysV R4.0.3 has a sign extension bug in the
  1089. implementation of fubyte() for local file descriptors (i.e. not opened via
  1090. RFS), which causes fubyte() to return negative values if the byte fetched has
  1091. its high bit set. This bug doesn't affect STREAMS drivers, as they don't call
  1092. (and in fact are normally unable to call) fubyte().  Thus writing a byte with
  1093. the high bit set to certain character device drivers returns with -1 and errno
  1094. set to EFAULT.
  1095.  
  1096. The bug may affect any character device driver that calls fubyte(). It's not
  1097. limited to serial card drivers. The bug is noticed most often with serial card
  1098. drivers, since uucp uses byte values > 127 very early during g-protocol setup
  1099. and drivers for serial cards tend to use fubyte() quite often.
  1100.  
  1101. Note also that the bug's effect is different if the driver checks for a -1
  1102. return value of fubyte() or just a negative one. In the former case it is
  1103. possible to pass bytes with the 8 bit set through fubyte(), except for 0xff
  1104. which is -1 in two's complement. That makes the bug more obscure.
  1105.  
  1106. The fix is easy.  First, make a backup copy of the kernel object file
  1107. /etc/conf/pack.d/kernel/vm.o!  A disassembly of vm.o(lfubyte) should reveal
  1108. *exactly* one mov[s]bl (move byte to long w/sign extend).  That one needs to be
  1109. patched into a movzbl (zero extend). The difference is one bit in the second
  1110. byte of the opcode.
  1111.  
  1112. The movsbl has the bit pattern 00001111 1011111w mod/rm-byte.
  1113. The movzbl has the bit pattern 00001111 1011011w mod/rm-byte.
  1114.  
  1115. The 'w' bit is 0 for the instruction in question. So the opcodes are 0f be and
  1116. 0f b6. Here is the diff -c from dis -F lfubyte showing the patch applied to
  1117. the Dell 2.1 kernel:
  1118.  
  1119. *** vm.o    Mon Mar  9 00:31:38 1992
  1120. --- vm.o.org    Mon Mar  9 00:32:40 1992
  1121. ***************
  1122. *** 22,28 ****
  1123.       11c90:  85 c0                 testl  %eax,%eax
  1124.       11c92:  75 09                 jne    0x9 <11c9d>
  1125.       11c94:  8b 45 08              movl   8(%ebp),%eax
  1126. !     11c97:  0f b6 00              movzbl (%eax),%eax
  1127.       11c9a:  89 45 fc              movl   %eax,-4(%ebp)
  1128.       11c9d:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1129.       11ca7:  83 3d dc 13 00 00 00  cmpl   $0x0,0x13dc
  1130. --- 22,28 ----
  1131.       11c90:  85 c0                 testl  %eax,%eax
  1132.       11c92:  75 09                 jne    0x9 <11c9d>
  1133.       11c94:  8b 45 08              movl   8(%ebp),%eax
  1134. !     11c97:  0f be 00              movsbl (%eax),%eax
  1135.       11c9a:  89 45 fc              movl   %eax,-4(%ebp)
  1136.       11c9d:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1137.       11ca7:  83 3d dc 13 00 00 00  cmpl   $0x0,0x13dc
  1138.  
  1139. Of course there is a workaround at the driver level.  Canonically, one would do
  1140. this by checking for fubyte() returning -1 *and* u.u_error being set to EFAULT
  1141. (u.u_error is cleared upon entering a system call).  However, in R4.0.3
  1142. fubyte() does NOT set u.u_error.  It *does* set u.u_fault_catch.fc_errno.
  1143.  
  1144. Cristoph reports that Dell V.4 can be object-patched successfully to fix this.
  1145. I'm told that the offending 11c97 is at exactly the same address in the
  1146. Consensys 1.3 kernel.  I do not know the status of the other ports.
  1147.  
  1148. Another poster (Marc Boucher <marc@cam.org>) adds:
  1149.  
  1150. On ESIX SVR4.0.3 Rev. A, the instruction movsbl in question can be changed to
  1151. movzbl (as described above) with a binary-editor on file
  1152. /etc/conf/pack.d/kernel/vm.o. At offset 0x11eb0, change 0xbe to 0xb6.
  1153.  
  1154. Before patching, verify that your /etc/conf/pack.d/kernel/vm.o is the same as
  1155. mine!  On my system, the /bin/sum generated checksum of vm.o was "4440 222".
  1156.  
  1157. The problem results from a sign-extension bug.  The function lfubyte(), which
  1158. is called by fubyte(), is declared as
  1159.  
  1160. int lfubyte(char *addr);    /* actually caddr_t */
  1161.  
  1162. The byte is fetched with
  1163.  
  1164.     val = *addr;
  1165.  
  1166. which triggers sign extension.  Casting addr to a unsigned char * or declaring
  1167. it as such solves the problem.
  1168.  
  1169. This bug is still present in stock USL 4.0.4.  However, it has been fixed in
  1170. Dell 2.2.
  1171.  
  1172. VI. Destiny and Dell
  1173.  
  1174. A source at at UNIX System Labs Europe claims that `Destiny' (the new Release
  1175. 4.2) incorporates all of Dell UNIX's fixes to 4.0.3; thus, any bug for which a
  1176. Dell fix is indicated above should be gone in Destiny.
  1177. --
  1178.     Send your feedback to: Eric Raymond = esr@snark.thyrsus.com
  1179.