home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / answers / usl-bugs < prev    next >
Internet Message Format  |  1993-08-07  |  88KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!spool.mu.edu!agate!library.ucla.edu!news.mic.ucla.edu!magnesium.club.cc.cmu.edu!news.sei.cmu.edu!cert.org!netnews.upenn.edu!dsinc!gvls1!boojum!esr
  2. From: esr@snark.thyrsus.com (Eric S. Raymond)
  3. Newsgroups: comp.unix.sys5.r4,comp.unix.pc-clone.32bit,comp.bugs.sys5,news.answers
  4. Subject: Known Bugs in the USL UNIX distribution
  5. Message-ID: <1mMD8p#M7bHGP74mn36O7fG8Zm0smCcO=esr@boojum.thyrsus.com>
  6. Date: 5 Aug 93 16:27:16 GMT
  7. Expires: 4 Aug 93 23:30:00 GMT
  8. Sender: esr@boojum.thyrsus.com (Eric S. Raymond)
  9. Followup-To: comp.unix.pc-clone.32bit
  10. Lines: 2102
  11. Approved: news-answers-request@MIT.Edu
  12. Xref: senator-bedfellow.mit.edu comp.unix.sys5.r4:4553 comp.unix.pc-clone.32bit:5794 comp.bugs.sys5:1881 news.answers:11155
  13.  
  14. Archive-name: usl-bugs
  15. Last-update: 05 Aug 1993
  16. Supersedes: <unknown>
  17. Version: 17.0
  18.  
  19. Many FAQs, including this one, are available via FTP on the archive site
  20. rtfm.mit.edu (aka pit-manager.mit.edu or 18.172.1.27) in the directory
  21. pub/usenet/news.answers.  The name under which this FAQ is archived appears in
  22. the Archive-name line above.  This FAQ is updated monthly; if you want the
  23. latest version, please query the archive rather than emailing the overworked
  24. maintainer.
  25.  
  26. What's new in this issue:
  27.    * New bug info (see below)
  28.    * Instructions for fixing the FUBYTE problem under Del 2.2.
  29.  
  30. *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH ***
  31.  
  32.   May's new bug (II.43) is still *really serious*.  Get after your
  33. vendor to fix it ASAP!
  34.  
  35. *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH ***
  36.  
  37. (In the table below, bugs new this issue are marked with a ** at the
  38. left margin; old bugs for which information has been added are marked
  39. with *)
  40.  
  41. 0. Table of Contents
  42. I. Introduction
  43. II. General Bugs
  44.     1. UNIX kernel must lie below the 1024-cylinder mark
  45.     2. Suid programs dump core when signalled
  46.     3. DMAs on large ISA machines may fail
  47.     4. There is a cylinder limit on disk size
  48.     5. more(1) doesn't handle SIGWINCH
  49.     6. X performance problem
  50.     7. C shell background process termination logs you out
  51.     8. A security hole in login
  52.     9. COFF problems with long filenames
  53.     10. Flakeouts in the Wangtek device driver
  54.     11. A kernel declaration bug
  55.     12. Reading tar archives with cpio foos up on multiply-linked files
  56.     13. Process accounting is broken
  57.     14. tar(1) foos up in the presence of symbolic links
  58.     15. Symbolic links can interfere with shellscript execution
  59.     16. Piping a csh builtin causes the shell to hang.
  60.     17. tar(1) fails to restore adjacent symbolic links properly
  61.     18. COFF binaries linked with curses(3) and shared libc hang
  62.     19. shl hangs, sxt devices bad
  63.     20. num-lock prevents mouse from working properly
  64.     21. adjtime() doesn't work
  65.     23. cron mail doesn't go through aliasing
  66.     24. fragility in xterm
  67.     25. csh lossage due to bad optimization
  68.     26. Bug in cp(1)
  69.     27. tbl -me doesn't work
  70. *   28. who -r fragility leads to boot-time problems
  71.     29. at(1) breaks here-documents in shell scripts
  72.     30. UHC mouse driver ignores the middle button.
  73.     31. mmap acces doesn't update file mod times
  74.     32. AT&T select(2) is incompatible with BSD select(2)
  75.     33. (4.2) The login program requires its PPID to be 1
  76.     34. (4.2) Bad MAXMINOR values can make the system unbootable
  77.     35. Incompatible change in TZ interpretation
  78.     36. Nulls in pixmaps can crash X
  79.     37. Potential security hole in SVr4s using sendmail
  80.     38. Reporting bug in df on non-root filesystems
  81.     39. tar writes -v output to stdout, not stderr
  82.     40. SIGPIPE is delayed and not reliable
  83.     41. /usr/lib/acct/fwtmp doesn't work
  84.     42. whatis database is full of garbage.
  85.     43. mmap is seriously broken
  86. **  44. a bug in xterm
  87. **  45. DrawText16() bug in XWIN
  88. **  46. output redirection with exec fails in sh
  89. **  47. rm fails to reject . or .. arguments
  90. III. Serial-port and tty administration problems
  91.     1. Dropout problems with tty devices
  92.     2. Quick port setup option in sysadm is broken
  93.     3. ttymon drops DTR when it shouldn't
  94.     4. ttymon doesn't drop DTR when it should
  95.     5. (4.2) Terminating cu to a direct line locks up the port
  96. *   6. Hardware flow control bug breaks streaming data transfers
  97.     7. Bad interaction between ttymon and networking
  98. IV. Networking and File-Sharing Bugs
  99.     1. NFS locking is unusably slow
  100.     2. UFS file system problems
  101.     3. Byte-order problem with NFS when accessing Sun disks
  102.     4. Under weird circumstances, lseek on UFS may cause corruption
  103.     5. FTP problems
  104.     6. A bug in the WD80x3 support
  105.     7. Security hole near fingerd
  106.     8. Fatal bug in priority-band message handling.
  107.     9. SVr4.0.4 TCP/IP routing is broken
  108.     10. df(1) on NFS volumes returns bad data
  109.     11. rsh hogs the processor
  110. **  12. MTU for remote networks ignored
  111. **  13. Bug in remote printing.
  112. V. SCSI Support Problems
  113.     1. sar is confused by SCSI
  114.     2. A configuration problem
  115.     3. Synchronous SCSI hang problem
  116.     4. ps chokes on commands that do SCSI I/O
  117.     5. Transfer speed problems with Adaptec 1542B on 486s
  118.     6. df gives inaccurate values for large SCSI partitions
  119. VI. Development Tools Problems
  120.     1. General UCB library brokenness
  121.     2. USL emulation of BSD signals doesn't work
  122.     3. Possible string library problems
  123.     4. USL's ndbm support is broken.
  124.     5. An include file is missing
  125.     6. sscanf(3) has a potential bug
  126.     7. shmat(2) vs. vfork(2)
  127.     8. FIONREAD fails on regular files
  128.     9. fread(3) does the wrong thing on pipes and FIFOs
  129.     10. putw appears to be broken
  130.     11. Compiler problems
  131.     12. getlogin() doesn't work
  132.     13. syslog routines don't work
  133.     14. Bogus `r' in xt driver configuration flags
  134.     15. ioctl for kernel symbol fetches fails (4.2)
  135. **  16. Bug in cc optimizer (4.2.1)
  136. **  17. /usr/ucb/install uses missing group "staff"
  137. VII. The FUBYTE Problem *
  138. VIII. Destiny and Dell
  139.  
  140. I. Introduction
  141.  
  142. This posting lists known bugs in System V Release 4 implementations, and known
  143. fixes applied by various porting houses (there's also random bits of
  144. information about SCO UNIX here and there).  It was formerly part of the
  145. 386-buyers-faq issues 1.0 through 4.0, and is still best read in conjunction
  146. with the pc-unix/software FAQ descended from that posting.
  147.  
  148. This document is maintained and periodically updated as a service to the net by
  149. Eric S.  Raymond <esr@snark.thyrsus.com>, who began it for the very best
  150. self-interested reason that he was in the market and didn't believe in plonking
  151. down several grand without doing his homework first (no, I don't get paid for
  152. this, though I have had a bunch of free software and hardware dumped on me as a
  153. result of it!).  Corrections, updates, and all pertinent information are
  154. welcomed at that address.
  155.  
  156. This posting is periodically broadcast to the USENET group comp.unix.sysv386
  157. and to a list of vendor addresses.  If you are a vendor representative, please
  158. check to make sure the information on your company is current and correct.  If
  159. it is not, please email me a correction ASAP.  If you are a knowledgeable user
  160. of any of these products, please send me a precis of your experiences for the
  161. improvement of future issues.
  162.  
  163. The bug descriptions often include indications of fixes by the various porting
  164. houses to their current releases.  These are:
  165.  
  166. Consensys UNIX Version 1.3            abbreviated as "Cons" below
  167. Dell UNIX Issue 2.2                abbreviated as "Dell" below
  168. Esix Revision A                    abbreviated as "Esix" below
  169. Micro Station Technology SVr4 UNIX        abbreviated as "MST" below
  170. Microport System V Release 4.0 version 4    abbreviated as "uPort" below
  171. UHC Version 3.6                    abbreviated as "UHC" below
  172. SCO Open DeskTop 1.1                abbreviated as "SCO" below
  173.  
  174. II. General Bugs
  175.  
  176. 1. UNIX kernel must lie below the 1024-cylinder mark
  177.    Bela Lubkin says "SCO's boot filesystem must lie below 1024 cylinder mark;
  178. anything else can be anywhere.  This is more-or-less a limitation of the BIOS
  179. interface that the bootstrap loader must use.  Could be circumvented by going
  180. directly to controller hardware in the bootstrap loader, but that would be
  181. horrendously complex with all the controllers & host adapters to be supported."
  182.    Actually this is not quite right.  It's the *kernel* that must lie below
  183. the 1K-cylinder mark; the rest of the root partition could extend above it.
  184. But since partition endpoints are the only way to control where physical
  185. blocks get allocated, it comes to the same thing
  186.    Roger Knopf <rogerk@sco.COM> adds: "The 1024 cylinder limit applies
  187. not only to the kernel but also to /boot. Both are read in while we
  188. are using the BIOS to talk to the hard disk. There are 10 bits set
  189. aside in the register for cylinders in the INT 13 call, hence 1024
  190. cylinders. There are a few controllers that allocate 2 more bits (they
  191. are taken away from the space allocated for head bits, I recall). It
  192. is trivial to modify all the relevant boot code to use these bits IF
  193. YOU KNOW THAT THE CONTROLLER WILL USE THEM but I know of no way to
  194. reliably determine that this is the case.  Once the kernel is loaded
  195. we use 16 bits everywhere to hold the cylinder number."
  196.  
  197. 2. Suid programs dump core when signalled
  198.    Mark Snitily of SGCS says that under many SVr4s, signalling a
  199. process that is running suid root will cause it to core-dump.  He says
  200. Dell and MST have fixed this, and SCO doesn't suffer from this.
  201.  
  202. 3. DMAs on large ISA machines may fail
  203.    On ISA machines with more that 16MB of RAM, SVr4 may try to do DMA
  204. from outside the bus's address space, causing serious problems.  UNIX ought
  205. to do an in-memory copy to within the low 16MB but the USL base code doesn't.
  206.    Dell says they've fixed this, and that's been confirmed by a user.
  207.    UHC says they've fixed this; they add that the special buffer-allocation
  208. logic to handle the problem can be turned off with a tunable kernel parameter
  209. if you've got less than 16M.
  210.    Microport says they've fixed this in their new 4.1 release, shipping early
  211. March.
  212.    Esix offers a patch to correct this problem.
  213.    SCO used to have a similar bug but fixed it long ago.
  214.    John Sully <jms@mport.com> writes: "This was due to a bug in pre version 4
  215. dma code.  The USL code has always at least attempted to do a copy from low
  216. memory to high memory on systems with more than 16Mb of RAM.  By the way UHC is
  217. wrong; the buffer allocation code only comes into play if you have more than
  218. 16Mb of memory.  You can turn it off if you have a machine (ie. an EISA bus)
  219. which will allow you to do DMA above 16Mb.  You *must* have this tunable
  220. (MAXDMAPAGE) turned on if you are using *ISA* bus masters in a system with more
  221. than 16Mb of ram.  Unfortunately doing this will affect all drivers which do
  222. dma as there is no good way to do this on a per-driver basis."
  223.  
  224. 4. There is a cylinder limit on disk size
  225.    Stock USL code is limited to 1,024 cylinders per Winchester, which
  226. might cause problems with some disk drives.
  227.    Microport, Dell, Esix, MST, and UHC have fixed this.
  228.  
  229. 5. more(1) doesn't handle SIGWINCH
  230.    It doesn't get its window size from the stty/termio structures, so it
  231. doesn't cope with SIGWINCH properly.
  232.  
  233. 6. X performance problem
  234.    Stock X11R4 and R5 (at least prior to 1.2E) is said to hog the
  235. processor if you use the LOCALCONNECT option.  Jan Brittenson
  236. <bson@gnu.ai.mit.edu> posted the following workaround:
  237.  
  238.    I don't know what causes the standard X server to hog the CPU, but
  239. it can be avoided. Use the following program instead of xinit. Compile
  240. it with `$CC -O -o xserv xserv.c -lX11' where CC is either
  241. /usr/ccs/bin/cc or gcc. Set DISPLAY and XINITRC and run `xserv' from
  242. your home directory. This is just a q&d hack, and not really a
  243. substitute for xinit -- but it works.
  244.  
  245. /* xserv.c -- start X server
  246.  
  247.    Start X server. Similar to xinit, but intended to
  248.    circumvent the X386 CPU Hog Mode
  249.  
  250.    Jan Brittenson, June 2 1992  05:15 am
  251.    with corrections by Adam Donnison <adam@shinto.saki.com.au> Tue, 2 Mar 1993
  252. */
  253.  
  254. #include <stdio.h>
  255. #include <sys/types.h>
  256. #include <signal.h>
  257. #include <setjmp.h>
  258. #include <unistd.h>
  259. #include <libgen.h>
  260.  
  261. #include <X11/Xlib.h>
  262. #include <X11/Xos.h>
  263. #include <X11/Xmu/SysUtil.h>
  264.  
  265.  
  266. extern int errno;
  267.  
  268. /* This may need to be "/usr/X386/bin/X386" */
  269. #define DEFAULT_XPATH "/usr/bin/X11/X"
  270.  
  271. /* Start X server. Fork-exec server, passing the DISPLAY environment
  272.    variable. Wait for server to get up and running (at which point it
  273.    passes back a SIGUSR1), at which point the user xinitrc file is run. */
  274.  
  275. #define XINITRC ".xinitrc"
  276. #define DEFAULT_XCOMMAND "xterm -g +1+1 -n login -display :0"
  277.  
  278. extern void *malloc (), free ();
  279. extern char *basename (), *getenv (), *strcpy ();
  280.  
  281. /* X stuff */
  282. Display *top_display;
  283.  
  284.  
  285. /* This is supposed to be in libgen.a... */
  286. static char
  287. *basename (s0)
  288.   char *s0;
  289. {
  290.   register char *s1;
  291.  
  292.   for (s1 = s0 + strlen (s0) - 1;
  293.        s1 > s0 && *s1 != '/'; s1--);
  294.  
  295.   if (*s1 == '/')
  296.     return s1+1;
  297.  
  298.   return s1;
  299. }
  300.  
  301. jmp_buf sigusr1_frame;
  302.  
  303. static void
  304. caught_sigusr1 (int dummy) { longjmp (sigusr1_frame, !0); }
  305.  
  306.  
  307. static char
  308. *dispname (s0)
  309.   char *s0;
  310. {
  311.   register char *s1;
  312.  
  313.   for (s1 = s0 + strlen (s0) - 1;
  314.        s1 > s0 && *s1 != ':'; s1--);
  315.  
  316.   return s1;
  317. }
  318.  
  319.  
  320. /* No arguments */
  321. int
  322. main (argc, argv)
  323. int argc;
  324. char **argv;
  325. {
  326.   char *xserver_file, *xinitrc_file, *home_path, *display, *display_X_arg;
  327.   int xserver_pid, orgmask;
  328.   
  329.   
  330.   /* Not that it really matters, just to avoid being used as a direct
  331.      replacement for xinit. */
  332.   
  333.   if (argc != 1)
  334.     {
  335.       fprintf (stderr, "usage: %s\n", basename (*argv));
  336.       exit (1);
  337.     }
  338.   
  339.   
  340.   /* Resolve xinitrc path. This is done before the server is
  341.      started. */
  342.   
  343.   if (!(home_path = getenv ("HOME")))
  344.     home_path = "/etc";
  345.   
  346.   if (!(xinitrc_file = getenv ("XINITRC")))
  347.     {
  348.       xinitrc_file = malloc (strlen (home_path) + 1 + strlen (XINITRC) + 1);
  349.       sprintf (xinitrc_file, "%s/%s", home_path, XINITRC);
  350.     }
  351.   else
  352.     xinitrc_file = strdup (xinitrc_file);
  353.  
  354.  
  355.   /* Resolve display */
  356.   if (!(display = getenv ("DISPLAY")))
  357.     display = display_X_arg = ":0.0";
  358.   else
  359.     display_X_arg = dispname (display);
  360.  
  361.  
  362.   /* Tell server to notify us when up and running */
  363.   signal (SIGUSR1, SIG_IGN);
  364.   orgmask = sigblock (sigmask (SIGUSR1));
  365.  
  366.   /* Start server */
  367.   if (!(xserver_pid = vfork ()))
  368.     {
  369.       xserver_file = DEFAULT_XPATH;
  370.       
  371.       execl (xserver_file, xserver_file, display_X_arg, NULL);
  372.  
  373.       fprintf (stderr, "%s: can't exec %s (errno = %d) -- start-up aborted\n",
  374.                basename (*argv), xserver_file, errno);
  375.       exit (1);
  376.     }
  377.  
  378.   if (xserver_pid < 0)
  379.     {
  380.       fprintf (stderr, "%s: can't fork (errno = %d) -- start-up aborted\n",
  381.                basename (*argv), errno);
  382.       
  383.       exit (1);
  384.     }
  385.   
  386.   /* Await signal from server */
  387. #if 0
  388.   /* Why the #@$*! doesn't this work?! */
  389.   sigsetmask (orgmask);
  390.   alarm (20);
  391.   sigpause (sigmask (SIGUSR1) | sigmask (SIGALRM));
  392. #else
  393.   sleep (5);
  394. #endif
  395.  
  396.   /* Open display */
  397.   if (!(top_display = XOpenDisplay (display)))
  398.     {
  399.       fprintf (stderr, "%s: unable to open display '%s' -- start-up aborted\n",
  400.                basename (*argv), display);
  401.       exit (1);
  402.     }
  403.   
  404.   /* Execute xinitrc file */
  405.   if (system (xinitrc_file) < 0)
  406.     system (DEFAULT_XCOMMAND);
  407.       
  408.   /* Close display */
  409.   XCloseDisplay (top_display);
  410.  
  411.   /* Terminate server */
  412.   kill (xserver_pid, SIGTERM);
  413.  
  414.   /* Finished */
  415.   free (xinitrc_file);
  416. }
  417.  
  418. 7. C shell background process termination logs you out
  419.    In C shell, unless "ignoreeof" is set, termination of a background
  420. process will log you out.  With "ignoreeof" set, just the message
  421. "Use logout to exit" will be printed.
  422.  
  423. 8. A security hole in login
  424.    David Wexelblat <dwex@mtgzfs3.att.com> reports: "There is a HUGE security
  425. hole in /bin/login in all USL derived SVR4s before 4.0.4.  Refer to CERT
  426. advisory CA-91:08, dated 5/23/91.  This is known to be present in AT&T SVR4
  427. 2.1, and Microport SVR4 3.1.  ESIX claims to have fixed it, Microport reports
  428. that it is fixed in 4.1.  I won't give any more details unless necessary.
  429. Suffice to say that this bug allows any non-privileged user on an SVR4 system
  430. to get read-write access to any file on the system."
  431.  
  432. 9. COFF problems with long filenames
  433.    A source at Dell urges: "Our SVR4v2 did some stuff that USL didn't get
  434. around to until SVR4v4.  Try Dell UNIX 2.1 with a COFF program on a large UFS
  435. filesystem in a directory with long names.  Runs on Dell UNIX.  Breaks on
  436. others."  I don't have more definite info yet.
  437.  
  438. 10. Flakeouts in the Wangtek device driver
  439.    Dell reports that USL's Wangtek device driver is seriously flaky.  "How'd
  440. you like a multi volume backup where the second and subsequent volumes don't
  441. follow on from the previous volumes?"  UHC confirms this and is actively
  442. working on the problem.
  443.    An anonymous SCOer says "The QIC02 tape controller `standard' is seriously
  444. flaky.  Our driver's in pretty good shape but nobody will ever have a truly
  445. solid driver that supports every QIC02 controller you can find."
  446.    Gordon Ross <gwr@mc.com> reports: "Actually, the SCSI tape target driver
  447. `st01' has a similar problem at version 4.0.3 which I corrected while I worked
  448. on the SVR4 code.  The correction was provided to the support group at USL.
  449. The actual problem was that the SCSI tape would return a `check status'
  450. completion code which was just trying to inform the driver of the arrival
  451. of the `logical end of media' indication but the driver was treating it
  452. as an error.  The tape drive had in fact written the data, but the driver
  453. incorrectly assumed that the "check status" return meant that it failed.
  454. The result of this is that when you write into the end of the tape, you
  455. can read back one more "chunk" than yu wrote.  Of course, cpio does not
  456. like this at all when doing multi-volume backups..."
  457.  
  458. 11. A kernel declaration bug
  459.     A botch in USL's /etc/conf/pack.d/kernel/space.c (which is present in
  460. Consensys 1.3, Dell 2.1, Esix 4.0.3A, Microport 4.0.3 and 4.0.4 and may also be
  461. present in other SVr4s) can step on the linesw[] table.  The problem is that
  462. the domain name array initialization is wrong and too short; thus, when it's
  463. set, data past the end of the array can be stomped.  To fix this, find the
  464. following near line 247:
  465.  
  466.     char srpc_domain[] = SRPC_DOMAIN;
  467.  
  468. and change it to
  469.  
  470.     char srpc_domain[SYS_NMLN] = SRPC_DOMAIN;
  471.  
  472. then rebuild the kernel.
  473.    Microport officially knows about this bug and plans to fix it in a
  474. near-future update release.  It has been fixed in Dell 2.2.
  475.  
  476. 12. Reading tar archives with cpio foos up on multiply-linked files
  477.     Paul De Bra <debra@info.win.tue.nl> reports the following:
  478.     In theory, cpio(1) is supposed to be able to read tar(1) archives.  In
  479. practice...don't try it.  Multiply-linked files will be extracted from the
  480. archive, whether or not they match the current pattern and whether or not
  481. you have selected 'u'.  This happens even if you use the `t' option, so
  482. it's not even save to list the archive files!  
  483.  
  484. 13. Process accounting is broken
  485.     In 4.0.3, process accounting doesn't work.  From examining the accounting
  486. scripts, it appears that /usr/lib/acct/accton is supposed to set a return code
  487. depending on whether accounting was switched on already or not.  However, it
  488. always returns the same result - accounting switched off.  This means that the
  489. /usr/lib/acct/ckpacct script, which is run every hour to keep the proccess
  490. accounting log in check, instead turns off accounting the first time it is run
  491. after booting.  The same happens with the nightly /usr/lib/acct/monacct
  492. program.
  493.    I don't yet know whether this bug is present in 4.0.4.  It is definitely
  494. un-fixed in Dell 2.1 and Consensys 1.3.  In Dell 2.2 the return bug is fixed,
  495. but accounting isn't automatically enabled at boot time.
  496.  
  497. 14. tar(1) foos up in the presence of symbolic links
  498.     Tar can get the names of symbolic links wrong when creating an archive.
  499. This bug can be demonstrated by doing the following:
  500.  
  501.    mkdir t
  502.    cd t
  503.    touch a 1234567890
  504.    ln -s 1234567890 b
  505.    ln -s a c
  506.    tar vcf ../t.tar .
  507.  
  508.    The output generated by tar is:
  509.  
  510.    a ./ 0 tape blocks
  511.    a ./a 0 tape blocks
  512.    a ./1234567890 0 tape blocks
  513.    a ./b symbolic link to 1234567890
  514.    a ./c symbolic link to a234567890
  515.  
  516. (Note the above commands should be done in the order shown and in a new
  517. directory)  This bug is nasty.  Recommended solution: use GNU tar.
  518.    This is reported from Esix 4.0.3 and Consensys 1.3, but probably exists on
  519. other SVr4s as well.  It has been fixed in Dell 2.2.
  520.  
  521. 15. Symbolic links can interfere with shellscript execution
  522.    There is a problem running #! scripts when symbolic links are involved.
  523. Typing in the following from a command shell demonstrates the problem:
  524.  
  525.    mkdir a b
  526.    ln -s a c
  527.    cd a
  528.    cat > script <<!
  529.    #!/bin/sh
  530.    echo Hello
  531.    !
  532.    chmod 755 script
  533.    cd ../b
  534.    ln -s ../c/script .
  535.    ./script
  536.  
  537. The message generated from the last line is:
  538.  
  539.      a/script: a/script: cannot open
  540.  
  541.    This is reported from Esix 4.0.3, Consensys 1.3, and Dell 2.2, but
  542. probably exists on other SVr4s as well.
  543.  
  544. 16. Piping a csh builtin causes the shell to hang.
  545.    While running csh, this can be demonstrated by some of the following:
  546.  
  547.    echo Hello | cat
  548.    history | more
  549.  
  550. (A solution to this one is use tcsh-6.02.)
  551.    This is reported from Esix 4.0.3 and Consensys 1.3, but probably exists on
  552. other SVr4s as well.  It is reported fixed in Dell 2.2.
  553.  
  554. 17. tar(1) fails to restore adjacent symbolic links properly
  555.   Arthur Krewatt <...!rutgers!mcdhup!kilowatt!krewat> reports:
  556.   SVR4 tar has another strange bug. Seems if when restoring files, you
  557. restore one file that is a link, say "a ->/a/b/c/d/e" and there is another
  558. link just after it called "b ->/a/b/c" tar will restore it as "b ->/a/b/c/d/e"
  559. This just seems to be a lack of the NULL at the end of the string, like
  560. someone did a memmov or memcpy(dest,src,strlen(src)); where it should be
  561. strlen(src)+1 to include the NULL.
  562.  
  563. 18. COFF binaries linked with curses(3) and shared libc hang
  564.    ...eating the CPU.  Cause unknown.
  565.  
  566. 19. shl hangs, sxt devices bad
  567.    shl(1) does not work.  Try creating a layer and doing an 'ls'.  Your session
  568. hangs.  Bruce Momjian <root%candle.uucp@bts.com>, who reported this bug, says
  569. he believes it is the sxt devices which are broken.  It definitely exists in
  570. Consensys 1.3.
  571.  
  572. 20. num-lock prevents mouse from working properly
  573.    When using the Motif window manager, if your num lock is on, your mouse
  574. clicks are not recognized by the window manager.  The mouse still works in
  575. xterm(1).  This is allegedly fixed in Destiny (4.2).
  576.    Under Dell 2.2 if num lock is on there's no problem, but if scroll lock
  577. is on then mouse clicks aren't recognised.
  578.  
  579. 21. adjtime() doesn't work
  580.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 adjtime() doesn't.
  581. Calling `date -a' works to adjust the time slowly.
  582.  
  583. 23. cron mail doesn't go through aliasing
  584.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 cron mail to adm
  585. doesn't get redirected by the aliases file.
  586.  
  587. 24. fragility in xterm
  588.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6, doing ~! from
  589. a cu in xterm kills xterm.  This has been fixed in Dell 2.2.
  590.  
  591. 25. csh lossage due to bad optimization
  592.   If a csh user sources a non-existent file in their .cshrc (eg, source .alias,
  593. where .alias doesn't exist), then the system will hang for a couple of minutes.
  594. Eventually the user get an "Out of memory" error and the console logs "NOTICE:
  595. out of swap space - Insufficient memory to allocate 2 pages - system call
  596. failed".
  597.   This appears to be due to over-optimization of code surrounding a longjmp
  598. call.
  599.   (There are numerous other reports of memory leak bugs in csh).
  600.  
  601. 26. Bug in cp(1)
  602.    If ``copy'' encounters a directory before a file, it dumps core ...
  603.  
  604. --- cut ---
  605. cd /tmp
  606. mkdir copybug jnk
  607. cd jnk
  608. mkdir directory
  609. >file
  610. cp -r * /tmp/copbug
  611. --- cut ---
  612.  
  613. This was reported from Consensys 4.0.3 but is probably a generic SVr4 bug.
  614. It appears to have been fixed in ESIX SVR4.0.3A and Dell 2.2.
  615.  
  616. 27. tbl -me doesn't work
  617.    Wolfgang Denk reports that trying to use "tbl -me" for any input file causes
  618. tbl to quit.  The problem is that newer tbl versions don't accept [nt]roff
  619. contol lines (".rm @W") after .TS.
  620.  
  621. 28. who -r fragility leads to boot-time problems
  622.   It coredumps if the name of the timezone (TZ) is longer than three characters
  623. and the length is a multiple of four.  This can be a real problem for European
  624. sites...  and is potentially more hazardous than immediately apparent as _a
  625. lot_ of the initialization scripts (rc1.d, rc2.d) use ``who -r'' to see if the
  626. machine is in single- or multi-user mode.  And when ``who'' bombs out, the
  627. ``set'' command is iven an empty command-line and can't do much else than print
  628. the shell variables, $1-$9 remain empty ... meaning that more or less all the
  629. scripts fail in various ways and the system has an exceptionally hard time
  630. coming up.
  631.    Peter Wemm <peter@DIALix.oz.au> reports that this bug was present in Dell
  632. 2.0, fixed in Dell 2.1, but reappeared in Dell 2.2.  Dell says it's a generic
  633. USL bug.
  634.    There is an easy workaround; make sure /etc/inittab is an odd number of
  635. characters long.  The bug is causes by an off-by-one in a buffer malloc.
  636.  
  637. 29. at(1) breaks here-documents in shell scripts
  638.    at adds gratuitous empty lines to the job submitted by the user.
  639. This prevents shell here-documents from working.
  640.  
  641. 30. UHC mouse driver ignores the middle button
  642.    This may be a generic USL problem, but Dell (at least) has fixed it.  UHC
  643. says they have a patch for it, but I haven't seen the patch.
  644.  
  645. 31. mmap acces doesn't update file mod times
  646.    Peter Wemm <peter@DIALix.oz.au> reports that under SVr4, if one mmap()'s a
  647. file, and writes to it via the mapped memory, when the disk is updated, the
  648. modification time does not update.
  649.  
  650. 32. AT&T select(2) is incompatible with BSD select(2)
  651.  
  652. Paul Eggert <eggert@twinsun.com>, as quoted by James Buster <bitbug@lynx.com>
  653. reports: 
  654.  
  655. The select() system call waits for read, write, or exception activity
  656. on a set of file descriptors, and yields an integer telling you how
  657. much activity it found.
  658.  
  659. BSD's select(N,&R,&W,&E,&T) can yield up to 3*N, because BSD's select()
  660. counts the number of bits that it turns on in in the R, W, and E
  661. arguments, and R, W, and E each contain one bit per file descriptor.
  662. However, System V Release 4 v2.1's select(N,&R,&W,&E,&T) yields at most N,
  663. because SVR4's select() just counts the number of active file
  664. descriptors, regardless of how many bits it turns on.
  665.  
  666. For example, the following code checks file descriptor 0.  In BSD, this
  667. code can set n to 2 if file descriptor 0 is ready for both reading and
  668. writing.  However, in SVR4, this code sets n to at most 1, because only
  669. file descriptor 0 is active.
  670.  
  671.     int n;
  672.     fd_set r, w;
  673.     FD_ZERO(r);  FD_SET(0, &r);
  674.     FD_ZERO(w);  FD_SET(0, &w);
  675.     n = select(1, &r, &w, (fd_set*)0, (struct timeval*)0);
  676.  
  677. At least one widely used piece of software depends on the BSD
  678. behavior, namely X11R5 (see Xt/NextEvent.c).  In this application, the
  679. bug's symptoms are subtle and are rarely encountered, but they do
  680. exist.
  681.  
  682. Most of X11R5's calls to select() don't care about this difference,
  683. but the following files in the X11R5 distribution contain calls to
  684. select() that may be affected by this bug:
  685.  
  686.     contrib/lib/i18nXView2/lib/libxview/notify/ndetselect.c
  687.         contrib/lib/xview3/lib/libxview/notify/ndetselect.c
  688.         mit/fonts/server/os/waitfor.c
  689.         mit/lib/Xt/NextEvent.c
  690.         mit/server/os/WaitFor.c
  691.  
  692. (Note: this is a very old bug.  Paul Eggert tells me that William Kucharski reported this bug to AT&T in 1989 when he ported X11R3!)
  693.  
  694. 33. (4.2) The login program requires its PPID to be 1
  695.    Rick Richardson reports: "The "/bin/login" program has been changed to be
  696. hardwired to require its PPID to be "1".  In all other versions of UNIX, it is
  697. sufficient that there be an /etc/utmp entry.  This bug was reported to USL, and
  698. I did get a fixed "login" program from them, but the fix did not make it into
  699. the release.  I don't know how mere mortals get the fix at this point."
  700.  
  701. 34. (4.2) Bad MAXMINOR values can make the system unbootable
  702.     Rick Richardson reports: "If MAXMINOR is stune'ed to the maximum value,
  703. 0x3fff (18 bits), then the kernel will refuse to boot, cycling up to driver
  704. initialization and then doing a processor recent.  Interestingly, this bug was
  705. not in the beta release, but was in the final release."
  706.  
  707. 35. (4.2) Incompatible change in TZ interpretation
  708.    Rick Richardson reports: "While not really a bug, this is a surprise.  In
  709. 4.2, the TZ variable was given a new meaning.  Rather than the traditional
  710. CST6CDT type of value, it now looks like ":US/Central".  This causes 3.2 and
  711. 4.0 binaries which use the date/time routines to report GMT time.  I have no
  712. idea why another variable name was not choosen.  I've taken to aliasing the
  713. binaries, e.g. "TZ=CST6CDT svr4binary"."
  714.   Mike "Ford" Ditto <ford@omnicron.com> corrects this.  "This change
  715. was made in 4.0, not 4.2, and 4.0 binaries should have no problem with
  716. the new format.  Some 4.0 systems use the new format by default.  The
  717. old format should be avoided unless SVR3 binaries are in use, since
  718. the new features of the time conversion libraries are only available
  719. if the new format is used."
  720.   Christoph Badura points out that the time functions still read the old
  721. TZ format, so you can set TZ=CST6DT or whatever and only the new features
  722. will be disabled.
  723.  
  724. 36. Nulls in pixmaps can crash X
  725.    Rick Richardson reports: "Displaying XPM2 pixmaps which have NULLS in them
  726. will crash the X server.  Admittedly, this is not much of a bug, since these
  727. are ill-formed or corrupted pixmaps.  But the server should stay up, even in
  728. these conditions.  A little error checking needed."
  729.  
  730. 37. Potential security hole in SVr4s using sendmail
  731.    Christoph Badura writes: "/usr/ucblib/aliases contains an alias for
  732. decode that feeds straight into uudecode.  I don't know under what uid
  733. uudecode gets invoked, but if it's root anyone can overwrite any file
  734. on a SVR4 system running the stock sendmail.  [Under Dell UNIX] t
  735. appears that the files get created with a user-ID of "daemon".  Not
  736. nice but better than root."
  737.  
  738. 38. Reporting bug in df on non-root filesystems
  739.    Paul Debra <debra@win.tue.nl> discovered that if df(1) is run on a
  740. filesystem other than root with a n argument of `.', the file system
  741. name is always reported as '/'.  This does *not* happen if you give
  742. it $PWD as argument.
  743.    This bug is present in Dell 2.2.
  744.  
  745. 39. tar writes -v output to stdout, not stderr
  746.    This is an incompatible, undocumented change from earlier UNIXes and
  747. royally screws up invocations like /bin/tar cvf - foo | /bin/tar tf - that
  748. previously worked.
  749.    Observed in ESIX 4.0.3A and 4.0.4, Dell 2.2; probably generic.  It
  750. also existed in SCO ODT and Xenix before 2.0 and 3.2v4, but has been fixed in
  751. these most recent versions.
  752.  
  753. 40. SIGPIPE is delayed and not reliable
  754.    Wolfgang Denk reports a kernel bug in src/uts/i386/fs/fifofs/fifovnops.c
  755. that results in SIGPIPE not getting raised immediately by failed writes.
  756. You can reproduce this with the following program:
  757.  
  758.     1    #include <stdio.h>
  759.     2    #include <signal.h>
  760.     3
  761.     4    extern int errno;
  762.     5
  763.     6    int sp();
  764.     7
  765.     8    int eop = 0;
  766.     9
  767.    10    char *line = "This is garbage.\n";
  768.    11
  769.    12    main () {
  770.    13        int i;
  771.    14        int l = strlen (line);
  772.    15
  773.    16        signal (SIGPIPE, sp);
  774.    17        for (;;) {
  775.    18    /*
  776.    19            for (i=0; i<10000; ++i) ;
  777.    20    */
  778.    21            if (write(1, line, l) != l) {
  779.    22                fprintf (stderr, "write error, errno=%d, eop=%d\n",
  780.    23                    errno, eop);
  781.    24                fflush (stderr);
  782.    25                exit (errno);
  783.    26            }
  784.    27        }
  785.    28    }
  786.    29
  787.    30    int sp()
  788.    31    {
  789.    32        fprintf (stderr, "SIGPIPE\n");
  790.    33        fflush (stderr);
  791.    34        eop = 1;
  792.    35    }
  793.  
  794. To test this, pipe its reslt to ls.
  795.  
  796. He writes: "That is, you can't be sure that SIGPIPE will be raised when a pipe
  797. breaks. Adding a short delay (for instance by uncommenting the for loop around
  798. line 19) gives _always_ SIGPIPE -- but usually you don't want to have
  799. additional delays in your program :-("
  800.  
  801.    Bernard Fouche <bernard@cpio1.fr.mugnet.org> observes that this is
  802. not necessarily a bug.  He writes: "Compile your example with the
  803. following change :
  804.  
  805.         - do not include your delay loop.
  806.         - add a line between line 24 and 25. This line will be :
  807.                         sleep(60);
  808.           This change will make a.out stay alive for 1 minute before
  809.           exiting.
  810.         - recompile, run with 'a.out|ls'.
  811.         - do 'ps -le |grep a.out'.
  812.  
  813. What you'll see is that a.out is now running in the background and its
  814. father is init(1)! So the return value of write(2) (EIO) can now be
  815. understood.
  816.  
  817. The only thing that I can tell is that pipes, that are now based on
  818. streams in SVR4, have a more complex behavior than in SVR3.2 but I
  819. would not call problem #40 a 'bug'. It can be related to the shell
  820. that ran the command and/or the scheduler and/or the stream subsystem."
  821.  
  822. 41. /usr/lib/acct/fwtmp doesn't work
  823.    John F. Haugh reports that under Dell UNIX the /usr/lib/acct/fwtmp command
  824. does not work as described in the man page; the output contains no line
  825. feeds and appears to be garbage.  I have verified this.
  826.    This is probably a generic SVr4 bug.
  827.  
  828. 42. whatis database is full of garbage.
  829.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports: "Both under ESIX
  830. 4.0.3 and 4.0.4, whatis database contains an awful lot of garbage, such as
  831. nroff macros. In addition, quite a lot of man pages mentioned are missing, and
  832. several available man pages are not mentioned. Since makewhatis is broken (at
  833. least under 4.0.3A), this cannot be repaired easily.  ESIX blamed USL for
  834. this."
  835.  
  836. 43. mmap is seriously broken
  837.  
  838. (thanks to Peter Wemm  <peter@zeus.dialix.oz.au> for a detailed report.)
  839.  
  840. ALL SVR4.0s have/had a nasty kernel bug that causes seemingly random executable
  841. and shared library corruption, and also unleashes a SERIOUS security bug. The
  842. "Copy-on-Write" mechanism within the kernel has bugs.  It is sufficient to say
  843. that the security related bug allows any user with shell and compiler access to
  844. WRITE to any file that they can read.
  845.  
  846. SVR4.2 has been fixed for some time.  ICL apparently fixed it in their sparc
  847. reference port (and x86 port), which means that Solaris2.x do not have the
  848. bugs.
  849.  
  850. The most common symptom of shared library corruption is that programs
  851. simply core dump when you attempt to access a non existing file.
  852.  
  853. $ more /notexisting
  854. Segmentation Fault (core dumped).
  855.  
  856. To recover from this, restore /usr/lib/libc.so.1 from the distribution media.
  857.  
  858. The security bugs have no known workaround, other than crippling the mmap()
  859. function in the kernel.
  860.  
  861. Dell has produced a fix for their release 2.2 systems. The patch is
  862. available from dell1.dell.com:/support2.2/CoW.t
  863.  
  864. Although it has not been tested, it is very unlikeley that Dell's patch will
  865. work on any other SVR4/386, as it replaces two kernel modules, and Dell's
  866. kernel has autoconfiguration extensions that are not present in other systems.
  867.  
  868. Dell 2.2 has got a STREAMS optimizer function enabled in the system that joins
  869. together small adjacent streams messages.  There were bugs in the early USL
  870. versions of this, but for 2.2, Dell enabled it after applying a fix from USL.
  871. It seems that in some rare circumstances, some machines are quite unstable with
  872. this enabled as default.  support2.2/CoW.t also disables the optimization to
  873. improve stability.  This brings Dell 2.2 into line with the other SVR4.0.4
  874. systems.
  875.  
  876. 44. a bug in xterm
  877.  
  878. Nickolay Saukh <nms@ussr.eu.net> reports ""
  879.  
  880. 45. DrawText16() bug in XWIN
  881.    Nickolay Saukh <nms@ussr.eu.net> reports "xterm strips off the eight bit of
  882. first character in line. This bug was present in x11r5 but fixed by some
  883. patch. I have no exact info under my thumb."
  884.    (Can anyone else confirm this bug?)
  885.  
  886. 46. output redirection with exec fails in sh
  887.    Andreas Luik <luik@isa.de> reports: "In Bourne shell scripts, the output of
  888. all following commands may be redirected using the "exec" builtin with an
  889. output redirection, e.g.
  890.     
  891.             exec > LOG
  892.             
  893. If such a construct is used in a for loop with a variable filename for the
  894. redirection, e.g. exec > $f, only the first output redirection is executed in
  895. the SVR4 /bin/sh.  It works correctly in /bin/ksh as well as in the HPUX, SunOS
  896. 4.1 and AIX Bourne shells."
  897.  
  898. 47. rm fails to reject . or .. arguments
  899.    Andreas Luik <luik@isa.de> reports: "rm does not check for `.' and `..'
  900. arguments.  The rm program should check for the arguments `.' and `..' (at
  901. least if called with the -r option) and ignore this arguments with the message
  902. "rm: cannot remove `.' or `..'". All implementation I'm aware of perform this
  903. check. As far as I know, this check is also in the SVR4 sources but implemented
  904. incorrect. This bug should be fixed for security reasons."
  905.  
  906. III. Serial-port and tty administration problems
  907.    Nickolay Saukh <nms@ussr.eu.net> reports "XWIN bug for DrawText16(). If one
  908. tries to output text line with more then one font, then text segment with
  909. second font (and subsequent segments) displayed shifted to left. This bug also
  910. fixed by some patch to x11r5."
  911.    (Can anyone else confirm this bug?)
  912.  
  913. 1. Dropout problems with tty devices
  914.    The most serious problem anyone has reported is that the USL asy driver is
  915. flaky and occasionally drops characters at above 4800 baud.
  916.    Microport, Dell, Esix, and UHC say that they believe they've fixed this.
  917. However, Dell, at least, was mistaken when they first made this claim; a more
  918. detailed description of the problem is given below.  I have been assured that
  919. this is on the fix list for the next Dell release.
  920.    Bela Lubkin at SCO comments "386 interrupt latency vs. unbuffered UARTs.
  921. This is a tough problem.  Nobody's driver should drop characters with a
  922. turned-on 16550.  It's not so easy with a 16450.  Anyone with 16450s or lower
  923. should be able to solve their problems by dropping in a 16550."
  924.  
  925. 2. Quick port setup option in sysadm is broken
  926.    In 4.0.3 sysadm, the quick port setup option, which is used to add and
  927. delete terminal ports, is seriously broken.  The script modifies /etc/conf/*
  928. files, and has incorrect minor numbers, sets the 5th field of sdevice.d to Y
  929. when it should be N, and is missing columns for node.d.  See
  930. /usr/sadm/sysadm/bin/q-add.  This bug is present in USL 4.2 as well
  931. (certainly in Consensys V.4.2).
  932.  
  933. 3. ttymon drops DTR when it shouldn't
  934.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 the ttymon(1)
  935. utility for HDB uucp drops DTR every few weeks.  The workaround is to disable
  936. and re-enable it.
  937.    The SVr4.2 ttymon is even more broken; it *never* raises DTR after the
  938. first outgoing call.  Jeremy Chatfield at IF has confirmed that this is a
  939. real bug in the USL sources and is on his urgent-fix list.
  940.  
  941.    In the May 10, 1993 issue of Open Systems Today, page 70, Jason Levitt
  942. describes some of his ttymon problems.  He has a file posted on ftp.uu.net
  943. under /published/open-systems-today/other/svr42uucp.tar; This tar file
  944. contians a fixed ttymon program along with a text file describing setting
  945. up ttymon and uucp so that it works pretty well.
  946.  
  947. 4. ttymon doesn't drop DTR when it should
  948.    Stephen Hebditch <steveh@orbital.demon.co.uk> reports from a Dell
  949. 2.2 system:
  950.    "When a user logs out, ttymon does not appear to lower the DTR line for
  951. a sufficiently long enough time to always cause the modem to drop
  952. carrier. The WorldBlazer modem here is set to its default of 50ms DTR
  953. detection time - the minimum time allowable - but around 2 times out of
  954. 10, when a user logs out it will not drop carrier although the DTR
  955. light on its front panel can be seen to blink momentarily.
  956.    Disabling service for a particular device (e.g. using 'pmadm -d -p
  957. ttymon3 -s 00') will only work if ttymon hasn't spawned a child process
  958. for that port.
  959.    According to the manual "ttymon should exit if no one types anything in
  960. <timeout> seconds after the prompt is sent". Occasionally when hanging
  961. up an outgoing connection, spurious characters can trigger ttymon into
  962. thinking that there is a new user wanting to log in. Because it has
  963. seen these characters, ttymon will then not time-out, locking up that
  964. port until the controlling ttymon child process is killed."
  965.    See the fix note attached to III.3.
  966.  
  967. 5. (4.2) Terminating cu to a direct line locks up the port
  968.     The problem is the C2 security mechanisms.  Terminating cu with ~.
  969. doesn't tear them down correctly.  Subsequently, another cu(1) will be
  970. able to get at the port, but utilities which try to get at it directly (i.e.,
  971. cat or stty) won't be.
  972.     Rick Richardson <rick@digibd.com> adds: "The "cu" problem where ports
  973. can't be used by stty, seyon, or other programs once "cu" has had its way
  974. with them:  This problem apparently affects any program (cu, uucp) that uses
  975. the DIAL(3) routines.  Those routines have been modified to use the "cs"
  976. connection server daemon to open the port and/or dial a phone number on behalf
  977. of the client (though you'd hardly realize this from reading the manual page).
  978. The "cs" daemon does *something*, where *something* is not known yet, which
  979. causes all subsequent termio type ioctl's to fail.  This bug has been reported
  980. to USL and Univel, but no fix has been forthcoming."
  981.     He continues: "I had our streams device driver guy put in a version of one
  982. of our serial port drivers with debugging turned on, and he said that it looked
  983. like the driver "close" routine was never getting called - possibly because the
  984. device close call only happens on the last close of a device, and the
  985. connection server has still got the port open.  This theory would seem to
  986. indicate that "cu" and "uucp" are fine, but that the connection server is
  987. broken.  We don't really know, though -- its just a theory.
  988.    See the fix note attached to III.3.
  989.  
  990. 6. Hardware flow control bug breaks streaming data transfers
  991.    Stephen Hebditch <steveh@orbital.demon.co.uk> reports from a Dell
  992. 2.2 system:
  993.    "There is a definite problem with hardware flow control. If
  994. characters are being continually sent to the modem with no break, then
  995. after around 40K or so the asy driver will ignore the fact that the
  996. modem has lowered the CTS line and will keep on sending.  Up to that
  997. point it will correctly stall when the CTS line is lowered. If there
  998. is a break in sending, then flow control will work correctly once
  999. more.  This means that streaming protocols such as Z-Modem will break
  1000. but simpler protocols like UUCP g which don't fill up the modem buffer
  1001. will work correctly."
  1002.    Your editor has seen this one himself while attempting to use rz
  1003. for uploads to his friendly Internet site, as was his wont under SVr3.
  1004. I now get around this by using ymodem protocol for uploads.
  1005.    This is probably a generic bug in 4.0.4 serial handling.
  1006.  
  1007. 7. Bad interaction between ttymon and networking
  1008.    Stephen Hebditch <steveh@orbital.demon.co.uk> reports from a Dell
  1009. 2.2 system:
  1010.   "A problem with ttymon, in.telnetd and in.rlogind. When a user logs out,
  1011. wrong entries are written to utmp and wtmp. This results in utmp and
  1012. wtmp containing a new record for that user for a session starting at
  1013. the time that they logged out. This results in some programs (finger
  1014. for example) showing that users are logged in when they are not and
  1015. means that login accounting is not possible."
  1016.    See the fix note attached to III.3.
  1017.  
  1018. IV. Networking and File Sharing Bugs 
  1019.  
  1020. 1. NFS locking is unusably slow
  1021.    Randy Terbush <randy@dsndata.dsndata.com> has posted code which
  1022. demonstrates a serious bug in the SVr4 NFS locking daemon.
  1023.    In his own words: "The symptoms are ~30% cpu usage by 'lockd' and
  1024. severe slowing of the machines on the network.  This program
  1025. demonstates that it takes ~20 seconds to obtain locks from an ailing
  1026. 'lockd'.  We have verified that this bug does not exist in HPUX 8.0x."
  1027.    Randy's code is too large to be included here.  He is, quite
  1028. rightly, exercised at USL's exceedingly slow response to this problem.
  1029. The comment in his makefile reads, in part:
  1030.  
  1031. # USL has admitted to the existance of this bug in version 4.0, 4.1,
  1032. # and 4.2 of their distributed and yet to be released sources.  This is
  1033. # a network crippling problem that they have refused to fix until
  1034. # release 4.3, which will be OVER 1 YEAR from today. (29 Oct 1992)
  1035. # If your version of 'lockd' exhibits this same problem, I would
  1036. # strongly urge you to contact your vendor and ask them to put some
  1037. # pressure on USL to fix this problem.  SVR4 is virtually useless in a
  1038. # network of shared resources while this problem exists.
  1039.  
  1040. 2. UFS file system problems
  1041.    In stock USL 4.0.3, you can't use a UFS file system as the root; the system
  1042. hangs if you try.  Consensys, Dell, Esix, Microport, MST, UHC, and ESIX all
  1043. appear to have fixed this.
  1044.    David Aitken, the UNIX product manager at UHC, writes "The ufs as root file
  1045. system [problem] was not really a bug, just a little oversight on USL's part -
  1046. we have fixed it completely by adding one line to the /stand/boot script:
  1047. rootfstype=ufs!"  He adds that they've been using ufs on their lab machines for
  1048. over 10 months with no trouble, and the latest UHC release defaults to ufs if
  1049. you have more than 120MB of disk.
  1050.  
  1051. 3. Byte-order problem with NFS when accessing Sun disks
  1052.    Christoph Badura <bad@generics.ka.sub.org> notes that the stock USL resolver
  1053. library suffers from serious confusion about the byte order in the
  1054. socketaddr_in structure.  This bug is acknowledged by USL for the 4.0.4
  1055. release.  A symptom of this bug is that Sun disks will not mount correctly over
  1056. NFS. As a workaround, try removing the references to /usr/lib/resolv.so from
  1057. /etc/netconfig and rebooting your system.  Unfortunately, this will mean
  1058. you can't use nameservers.
  1059.    Alan Batie <batie@agora.rain.com> writes: "Actually, you don't have to
  1060. remove resolv.so, just put tcpip.so first and have a hosts file with the names
  1061. of hosts you want to do NFS mounts from.  This way you can use nameservers for
  1062. most things."
  1063.  
  1064. 4. Under weird circumstances, lseek on UFS may cause corruption
  1065.   Christoph Badura <bad@generics.ka.sub.org> reports that a UFS lseek() to an
  1066. offset which is a multiple of 4096 but not a multiple of 8192, followed by a
  1067. write(), may corrupt the file being written.  The bug shows up only, if the
  1068. file has no pages in the page pool associated with it at the seek offset and at
  1069. 4k before the seek offset.  He has sent USL kernel fix for this, which was
  1070. included in 4.0.4.
  1071.  
  1072. 5. FTP problems
  1073.   The in.ftpd on SVR4.0.3 does not support all the commands listed in RFC 959.
  1074. When recent SCO UNIX/ODT versions ftp to SVR4.0.3, the SVR4 side will refuse,
  1075. drop the connection, and core dump after you authenticate.  This is because the
  1076. SCO end sends the 'SYST' command ala RFC 959, and the SVR4.0.3 end doesn't
  1077. recognise it.  Some ports have fixed this.
  1078.   Christoph Badura adds: "The bug is do to a longjmp(3) on a sigjmpbuf obtained
  1079. by sigsetjmp(3). ARGH. Testing led to a bug in the original BSD sources, which
  1080. is still present in the NET/2 ftpd.  "
  1081.  
  1082. 6. A bug in the WD80x3 support
  1083.    MST reports a serious bug in the SVr4 kernel support for this card.  Here's
  1084. how to reproduce it:
  1085.  
  1086.     server: init 3 and share (export) /usr for example.
  1087.  
  1088.     client: mount -F nfs server:/usr /mnt
  1089.         cd /mnt
  1090.         find . -print | cpio -ocBuv > /dev/null
  1091.  
  1092.     what happens:
  1093.         server and client will "hang" together.
  1094.  
  1095.     "cue":
  1096.         hit keys on server and/or client, hang will go away
  1097.         for 10-20 seconds temporarily.  Yank BNC connectors
  1098.         do the same trick.
  1099.  
  1100.    They say they've heard from customers that this happens on Dell, UHC as well
  1101. as USL 4.0.4.  PCNFS/BWNFS network xcopy suffers this as well.  Client can be a
  1102. Sun Sparc for that matter.
  1103.  
  1104. 7. Security hole near fingerd
  1105.    Jerry Whelan <guru@stasi.bradley.edu> reports:
  1106.     We encountered a cute security hole in AT&T SVR4 2.1 (which I believe
  1107. translates to USL 4.0.2).  It apparently was fixed in AT&T SVR4 3.0.  The
  1108. hole related to the finger daemon.  If a user set his .plan to a symbolic
  1109. link pointing to a protected file (such as /etc/shadow, or somebody's
  1110. mail file) then fingering the user would cause the finger daemon to read
  1111. that file and display it.
  1112.     I don't know if the bug exists in any other vendor's versions of 4.0.2.
  1113.     We replaced our fingerd with gnu finger, only to find the same problem.
  1114. I sent the changes back to the gnu finger developer, but I don't think a
  1115. newer fixed version has been officially released yet.
  1116.    Steve Peltz <peltz@cerl.uiuc.edu> writes: "The fix to the fingerd problem
  1117. (pointing a .plan file to a protected file and thus getting read access to it)
  1118. can be fixed by changing inetd.conf to not give root privileges to the fingerd
  1119. process. It seems like overkill to have fingerd set to the user id of the
  1120. person you're fingering to see if you should have access to the file."
  1121.  
  1122. 8. Fatal bug in priority-band message handling.
  1123.    Douglas C. Schmidt" <schmidt@liege.ICS.UCI.EDU> reports:
  1124.    There is a bug with handling priority-band messages that causes several
  1125. System V Release 4 versions (particularly Solaris 2.1) to crash.  The following
  1126. code replicates the problem.  Sun has been notified and claims they will fix
  1127. this problem in the next release (2.2?).
  1128.  
  1129. /* This program causes System V Release 4 to crash! */
  1130. #include <sys/types.h>
  1131. #include <sys/fcntl.h>
  1132. #include <stdio.h>
  1133. #include <stropts.h>
  1134.  
  1135. #define FIFO "/tmp/foo"
  1136. #define BIGFILE "/usr/dict/words"
  1137.  
  1138. static int
  1139. do_child (int fifo_fd)
  1140. {
  1141.   struct strbuf msg;
  1142.   char   buf[BUFSIZ];
  1143.   
  1144.   msg.maxlen = sizeof buf;
  1145.   msg.buf    = buf;
  1146.  
  1147.   do
  1148.     {
  1149.       int flags = 0;
  1150.  
  1151.       if (getmsg (fifo_fd, 0, &msg, &flags) != -1)
  1152.     (void) printf ("(%2d) (%2d): %s", 
  1153.                msg.len - sizeof (int), *(int *) msg.buf, msg.buf + sizeof (int));
  1154.       else
  1155.     return -1;
  1156.     }
  1157.   while (msg.len != 0);
  1158.  
  1159.   return 0;
  1160. }
  1161.  
  1162. static int
  1163. do_parent (int fifo_fd)
  1164. {
  1165.   FILE *fp;
  1166.   char buf[BUFSIZ];
  1167.  
  1168.   (void) srand ((unsigned) time (0));
  1169.  
  1170.   if ((fp = fopen (BIGFILE, "r")) == 0)
  1171.     return -1;
  1172.  
  1173.   while (fgets (buf + sizeof (int), sizeof buf, fp) != 0)
  1174.     {
  1175.       struct strbuf msg;
  1176.       int           band = rand () % 11;
  1177.  
  1178.       msg.buf = buf;
  1179.       msg.len = strlen (buf + sizeof (int)) + 1 + sizeof (int);
  1180.       *(int *) buf = band;
  1181.  
  1182.       if (putpmsg (fifo_fd, 0, &msg, band, MSG_BAND) == -1)
  1183.     return -1;
  1184.     }
  1185.   return 0;
  1186. }
  1187.  
  1188. int
  1189. main (void)
  1190. {
  1191.   int fd;
  1192.  
  1193. #if defined (TEST_FIFO)  
  1194.   (void) unlink (FIFO);
  1195.   
  1196.   if (mkfifo (FIFO, 0666) == -1)
  1197.     perror ("mkfifo"), exit (1);
  1198. #else
  1199.   int pipe_fds[2];
  1200.  
  1201.   if (pipe (pipe_fds) == -1)
  1202.     perror ("pipe"), exit (1);
  1203. #endif
  1204.  
  1205.   switch (fork ())
  1206.     {
  1207.     case -1:
  1208.       perror ("fork"), exit (1);
  1209.     /* NOTREACHED */
  1210.     case 0:
  1211. #if defined (TEST_FIFO)
  1212.       if ((fd = open (FIFO, O_RDONLY)) == -1)
  1213.     return -1;
  1214. #else
  1215.       fd = pipe_fds[0];
  1216.       close (pipe_fds[1]);
  1217. #endif 
  1218.       if (do_child (fd) == -1)
  1219.     perror ("do_child"), exit (1);
  1220.  
  1221.       break;
  1222.     default:
  1223. #if defined (TEST_FIFO)
  1224.       if ((fd = open (FIFO, O_WRONLY)) == -1)
  1225.     return -1;
  1226. #else
  1227.       fd = pipe_fds[1];
  1228.       close (pipe_fds[0]);
  1229. #endif
  1230.       if (do_parent (fd) == -1)
  1231.     perror("do_parent"), exit (1);
  1232.       break;
  1233.     }
  1234.   return 0;    
  1235. }
  1236.  
  1237. 9. SVr4.0.4 TCP/IP routing is broken
  1238.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports:
  1239.    "I found a problem with ESIX 4.0.4 TCP/IP routing. I'm not sure if it's also
  1240. present in other SVR4 flavors.  The problem is that once a system has received
  1241. an ICMP route redirect message, it is supposed to store the new route in its
  1242. routing tables.  This does not work properly, which is revealed by ping(1)ing
  1243. to a host though a gateway in a more complex network configuration.  For almost
  1244. every packet is sent to another gateway than the one which corresponds with the
  1245. network of the destination.  This in turn leads to an enormous amount of ICMP
  1246. messages, which leads to bad network thoughput.  We also had some mysterious
  1247. crashes until we decided to change the network configuration to circumvent this
  1248. problem."
  1249.    (This seems very likely to be a generic SVr4 problem).
  1250.  
  1251. 10. df(1) on NFS volumes returns bad data
  1252.    Raymond Nijssen reports from Esix 4.0.3A and 4.0.4: " Diskspace figures of
  1253. NFS mounted filesystems reported by both /bin/df and /usr/ucb/df are 4 times
  1254. too big."
  1255.  
  1256. 11. rsh hogs the processor
  1257.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports from Esix 4.0.3A and
  1258. 4.0.4: "The rsh command hogs the CPU. On an empty system, `rsh foo -n bar'
  1259. takes 1 second kernel-mode CPU per second elapsed."
  1260.  
  1261. 12. MTU for remote networks ignored
  1262.    Nathan D. Lane <nathan@seldon.foundation.tricon.com> reports: "Esix 4.0.4
  1263. ignores the MTU for remote networks.  I have PPP setup on my RS/6000 and the
  1264. Esix box connects via ethernet to the RS/6000.  Packets are always sent out
  1265. "full size" by the Esix machine, no matter where their destination.  It is my
  1266. understanding that, when routing to a remote network where the MTU is a)
  1267. unknown or b) set to something lower than 1536, the originating machine should
  1268. make the packets smaller.  Instead, when the Esix box blasts out its packets
  1269. across the PPP link, it sends them full size, making the other end do *a lot*
  1270. of packet reassembly.""
  1271.    This has not been confirmed on other ports, but seems likely to be
  1272. a generic SVR4 problem.
  1273.  
  1274. 13. Bug in remote printing.
  1275.    A couple of USENETters have reported that the remote-printing support for
  1276. lpr (the System V print spooler) is broken in SVr4.0.  Printing is done
  1277. correctly, but the job is not then removed from the print queue on either
  1278. system.
  1279.  
  1280. V. SCSI Support Problems
  1281.  
  1282. 1. sar is confused by SCSI
  1283.    Sar -d doesn't work on SCSI drives.  Dell fixed this in 2.1 and it's
  1284. reported to work OK in Esix 4.0.3A; no report of any other SVr4 having fixed
  1285. this yet.  SCO fixed it in 3.2.4.  Appears to be fixed in USL 4.2.
  1286.  
  1287. 2. A configuration problem
  1288.    Stock USL 4.0 requires you to jumper your SCSI devices to fixed IDs
  1289. during installation (it can be changed to any other ID after).  Specifically,
  1290. the tape must be ID 6.
  1291.    Dell says they've fixed this.  The requirement is definitely still present
  1292. in Esix and Consensys 1.3.  UHC thinks they've fixed this, but their 4.0.3.6
  1293. release still seems to demand ID 1 to install.
  1294.    I've seen an email report that USL 4.2 still has this problem.  But after
  1295. publishing this, I got a request for more info from Mike Drangula
  1296. <miked@usl.com> at USL.  He wrote:
  1297.  
  1298. >                                                                 As far as
  1299. > I know ( and I wrote the SCSI configuration tools for 4.2 ), there is only
  1300. > one case where a device is required to be at a particular SCSI ID, unless
  1301. > you count the requirement that the HBA be at ID 7.
  1302. > The only requirement for a given SCSI id is that, on a SCSI-based MCA
  1303. > machine that uses IBM's SCSI Host Adapters, the boot disk must be at ID 6
  1304. > if there is more than one disk installed on the HBA.
  1305. > The old requirement that the tape be set to SCSI ID 6 is no longer in effect.
  1306. > If your HBA will support booting from it, there is not even a requirement 
  1307. > that the boot SCSI disk be at SCSI ID 0.  The only requirement for disks is 
  1308. > that the boot disk must have the lowest SCSI ID of any DISKS on the system
  1309. > ( except in the already noted case of MCA SCSI )
  1310.  
  1311. Give Mike a hand for actually reading this bug list.
  1312.  
  1313. 3. Synchronous SCSI hang problem
  1314.    David Wexelblat <dwex@mtgzfs3.att.com> reports: "Stock SVR4.0.3 will hang
  1315. the SCSI bus with a 1542 in synchronous mode.  Dell fixed this, and this has
  1316. been given to Microport [ed note: Microport 4.0.4 and Consensys 4.0.3 have
  1317. fixed the problem; MST UNIX and Esix 4.0.3 still have this problem; I have not
  1318. yet been able to determine if ESIX 4.0.4 does].  In the file /sbin/bcheckrc,
  1319. change the line:
  1320.  
  1321.     echo MARK > /dev/rswap
  1322.  
  1323. to
  1324.         
  1325.     echo MARK | dd of=/dev/rswap bs=512 conv=sync > /dev/null 2>&1
  1326.  
  1327. The magic is apparently the conv=sync, which forces a 512 byte block
  1328. to be written.  The original echo writes 4 bytes, which apparently causes
  1329. synchronous SCSI to go out to lunch.
  1330.  
  1331. Now, you ask, how can I fix this, since the system won't boot?  There are
  1332. a couple of methods.  First, if possible, disable synchronous negotiation
  1333. (1542 jumper J5-1 removed, plus whatever you may need to do to your drive).
  1334. Then boot up, edit /sbin/bcheckrc, then shutdown, restrap for synchronous,
  1335. then reboot.  Everything should be OK.
  1336.  
  1337. That's the easy way.  Unfortunately, some hard drives will only work
  1338. in synchronous mode.  Well, you can still recover from this phenomenon.
  1339. Here's how:
  1340.  
  1341.         1) Install on your hard drive
  1342.         2) Boot from the first boot floppy.  When it tells you to, insert
  1343.            the second boot floppy.  At the first prompt, hit <DEL> to
  1344.            break out to a shell.
  1345.         3) Mount your hard drive under /mnt with the following command
  1346.            (replace FS-TYPE with s5, s52, or ufs, whichever you used for
  1347.            for your root partition):
  1348.  
  1349.                 /etc/fs/FS-TYPE/mount /dev/dsk/c0t0d0s1 /mnt
  1350.  
  1351.         4) Now edit /mnt/sbin/bcheckrc:
  1352.  
  1353.                 ed /mnt/sbin/bcheckrc
  1354.  
  1355.            You may want the 'ed' man page handy (I barely remember how to
  1356.            to use 'ed' :->).  For simplicity, you can delete/comment out
  1357.            the offending line, then replace it with the correct line later.
  1358.         5) Unmount the hard drive:
  1359.  
  1360.                 umount /mnt
  1361.  
  1362.         6) Reboot from the hard drive.  Everything should come up OK. and
  1363.            you can finish editing /sbin/bcheckrc, if necessary.
  1364.  
  1365. Note that you perform these actions at your own risk.  The first version was
  1366. performed by me on Microport SVR4, and the second was performed by someone
  1367. else (on my suggestion) on ESIX SVR4."
  1368.    This problem appears to be fixed on Consensys 1.3 and Dell 2.1; also
  1369. (pace David's remark) in ESIX 4.0.4, which has
  1370.  
  1371.     echo MARK | /sbin/dd.arch conv=sync > /dev/rswap 2> /dev/null
  1372.  
  1373. 4. ps chokes on commands that do SCSI I/O
  1374.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6, ps
  1375. doesn't work when a SCSI command in progress. It stops printing at the
  1376. process executing the scsi command.
  1377.   This is still broken in Dell 2.2 and ESIX 4.0.3.
  1378.  
  1379. 5. Transfer speed problems with Adaptec 1542B on 486s
  1380.   If a system mount or install fails, try setting the DMA speed to 5MB/s,
  1381. rather than the default 5.7MB/s.  This is accomplished by removing the jumper
  1382. shorting the 12th pin pair of jumper block 5.
  1383.  
  1384. 6. df gives inaccurate values for large SCSI partitions
  1385.    Derek Terveer <derek.terveer@stpaul.gov> reports "I was on a Esix 4.0.4
  1386. system recently with a >1024 cylinder (i.e., ~1.05 GB disk) and the df command
  1387. was giving wildly inaccurate values.  I presume that this has something to do
  1388. with the size of the partitions, because it works just fine on a system with
  1389. smaller drives and partitions."
  1390.  
  1391. VI. Development Tools Problems
  1392.  
  1393. 1. General UCB library brokenness
  1394.    The BSD compatibility libraries were badly broken in USL code.  A Dell
  1395. source adds "That meant that almost all the apps derived from them were broken
  1396. too.  Most stuff like automount will die when you send a SIGHUP, instead of
  1397. rereading the map file.  You can get a system into very strange states when
  1398. that happens."
  1399.    John Sully <jms@mport> of Microport opines: "This is a bug in automount
  1400. itself rather than BSD compatibility, since the automount which comes with SVR4
  1401. is not compiled with the BSD libraries.  (isn't this comforting??  :-()."
  1402.  
  1403.    Peter Wemm <peter@DIALix.oz.au> reports "There is a very simple and reliable
  1404. sure to this sort of thing: Using your favourite hex editor, change all
  1405. instances of "signal" in the binary file to "sigset".  Most BSD code assumes
  1406. that signal() auto-rearms after handling a signal.  On SVR4, signal() does not,
  1407. but sigset() is argument compatible, and has BSD semantics."
  1408.  
  1409.    Esix and UHC's BSD libraries are USL stock.  I don't yet know
  1410. the status of other ports.  Microport has run into things they think may be
  1411. symptoms of this but have no fix yet.
  1412.  
  1413.    John Sully <jms@mport> of Microport counters with: "One common thread I find
  1414. on reading of these problems is that the BSD compatibility libraries are
  1415. *misused*. [...] The problem is that BSD and SYSV have similarly named .h files
  1416. which sometimes contain different definitions for objects with the same name.
  1417. This has been known to cause all sorts of problems because the SYSV headers are
  1418. picked up and then the calls are satisfied from the BSD library rather than the
  1419. shared object library.  I have found that if you use /usr/ucb/cc that the BSD
  1420. compatibility is much less broken than it would seem at first because it
  1421. ensures that the correct headers are picked up."
  1422.  
  1423.    However, note that there is at least one *real* bug known --- as of 4.0.4
  1424. the signal emulation cannot explicitly set a handler to SIG_DFL or SIG_IGN.
  1425.  
  1426.    Developers should be very careful that if they use -L/usr/lib/ucb -lucb 
  1427. the cc used is also the Berkeley cc.
  1428.  
  1429. 2. USL emulation of BSD signals doesn't work
  1430.    A different source reports that the the USL implementatation of BSD signals
  1431. is broken in both 4.0.3 and 4.0.4; in particular, the sigvec() family doesn't
  1432. work properly.  It is possible to make minor tweaks to source to make such apps
  1433. work properly with the native USL signals implementation.
  1434.  
  1435.    Here's more on the signals problem, thanks to Richard <rc@siesoft.co.uk>:
  1436. ------------------------------------------------------------------------------
  1437. The problem is to do with the signal() function that is within the BSD
  1438. compatability libc. 
  1439.  
  1440. To reproduce the problem do the following:
  1441.  
  1442. #include <stdio.h>
  1443. #include <sys/types.h>
  1444. #include <signal.h>
  1445. #include <sys/siginfo.h>
  1446.  
  1447. main()
  1448. {
  1449.     signal(SIGPIPE,SIG_IGN);
  1450.     pause();
  1451. }
  1452.  
  1453. and compile it with cc xx.c -o xx /usr/ucblib/libucb.a
  1454.  
  1455. (John Sully observes that this is definitely wrong; /usr/ucb/cc should have
  1456. been used rather than "cc ... -L/usr/ucblib -lucb" or the equivalent "cc ...
  1457. /usr/ucblib/libucb.a".)
  1458.  
  1459. If you run the program and then signal it with a SIGPIPE, the program
  1460. will die, even though you've told it to ignore SIGPIPE.
  1461.  
  1462. The fix is difficult unless you've got source because there's a missing 'else'
  1463. clause from the signal() code. This is the only signal fault I've found in
  1464. the BSD signal functions, details of the rumoured sigvec problem would be
  1465. useful?
  1466.  
  1467. If you're trying to compile an application you could change the application
  1468. code to do the following, this does work..
  1469.  
  1470. void
  1471. catch(s)
  1472. int    s;
  1473. {
  1474.     /* DO NOTHING */
  1475.     ;
  1476. }
  1477.  
  1478. main()
  1479. {
  1480.     signal(SIGPIPE,catch);
  1481.     pause();
  1482. }
  1483.  
  1484. SUMMARY
  1485. You can only change a signal handler to a function handler, any number of
  1486. times.  Any attempt to set the handler to SIG_DFL, or SIG_IGN will fail.
  1487.  
  1488. This bug has given some people working with X11R5 aggro, causing the X server
  1489. to die when you close a client. 
  1490.  
  1491.   Christoph Badura <bad@flatlin.ka.sub.org> confirms this bug
  1492. He has sent USL a source fix.  It appears already to have been fixed in Dell
  1493. 2.2.
  1494. ------------------------------------------------------------------------------
  1495.  
  1496. 3. Possible string library problems
  1497.    There are also persistent rumors of problems in the BSD-emulation string
  1498. libraries.  I have not been able to pin down specifics on this.
  1499.  
  1500. 4. USL's ndbm support is broken.
  1501.    Christoph Badura <bad@generics.ka.sub.org> reports "The ndbm functions in
  1502. the ucb library are broken [apparently due to a compiler of optimizer bug in cc
  1503. -- ed.].  Try makeing the whatis data base for /usr/share/man with Tom
  1504. Christiansen's perl rewrite of man. 
  1505.    The easiest way to fix this is to compile GNU's replacement ndbm.c with gcc
  1506. -fpcc-struct-return -traditional (gcc1.40 or 2.2 will do nicely) and install it
  1507. in your C library.  Source is available for FTP from prep.ai.mit.edu.
  1508.  
  1509. 5. An include file is missing
  1510.    Both 4.0.3 and 4.0.4 USL versions are missing the documented dial.h
  1511. file from their /usr/include directory.  Dell 2.[12] has it.
  1512.  
  1513. 6. sscanf(3) has a potential bug
  1514.    Anthony Shipman <als@bohra.cpg.oz.au> reports: " I found the following bug
  1515. in SCO Unix 3.2.* and I think it may be common to many AT&T derived Unixes.
  1516.  
  1517. sscanf() calls _doscan() to read from a pretend file.  The file
  1518. uses the string as a buffer and a fake file descriptor of 60 (=_NFILE).  
  1519. Since _NFILE (for SCO UNIX) is 60 it assumes that fd 60 can never be open.
  1520.  
  1521. Then when fscanf() hits the end of the string it calls _filbuf() to read
  1522. into the buffer (which is the string) from fd 60.  This should fail with
  1523. an errno=9 and then _filbuf() sets EOF and it all terminates.
  1524.  
  1525. However in SCO Unix you can reconfigure the kernel to increase the number
  1526. of files per process to a recommended maximum of 150.  If you do this then
  1527. your program might have fd 60 open one day.  Then sscanf() will read from this
  1528. file overwriting your string.  The byte count to the read() in _filbuf() 
  1529. is some undefined but large value so a lot of memory will be overwritten.  In
  1530. my case the string was on the stack so my stack was wiped.
  1531.  
  1532. In short if you configure your kernel to have NOFILES > _NFILE ie more than
  1533. the default then sscanf() is a time bomb in your code."
  1534.  
  1535. This is alleged to have been fixed in SVr4, but I haven't been able to
  1536. confirm the fix.  Bob Tinsmamn of SCO support writes: "We're fixing it
  1537. too, in a maintenance supplement to the Development System that will
  1538. come out at the end of this year or the beginning of 1993, known as
  1539. Development System Maintenance Supplement 4.2 or MSD 4.2."
  1540.  
  1541. 7. shmat(2) vs. vfork(2)
  1542.    The shmat(2) call is known to interact bady with vfork(2).  Specifically,
  1543. if you attach a shared-memory segment, vfork(), and then the child releases
  1544. the segment, the parent loses it too!  Workaround; use fork(2).
  1545.    UHC and Microport both suspect that they still have this bug and opine that
  1546. anyone who uses vfork deserves to lose.  Dell has no plans to fix it.
  1547.  
  1548.    John Sully <jms@mport.com> writes: "This is not a bug.  It is completely
  1549. consistent with the semantics of a change to the address space of the child.
  1550. Think about it: any change to the address space of a child process created by
  1551. vfork(2) is reflected in the parent since the child is actually executing in
  1552. the parent's address space.  Therefore if the child changes the address space
  1553. (in this case by releasing the shared memory segment) what should happen?
  1554. Right, the parent should have the same change happen.  And what does happen?
  1555. The segment is released in the parent.  One can argue about the braindead
  1556. semantics of vfork(2) all day, but the fact remains that this is exactly what
  1557. one would expect to happen.  To quote from the manual page:
  1558.  
  1559.      [...] vfork differs  from fork  in
  1560.      that the    child  borrows    the parent's *memory* and thread of
  1561.      control until a call to execve or an exit (either by a  call
  1562.      to     exit  or  abnormally.) [ emphasis added ]
  1563.  
  1564. and later:
  1565.  
  1566.      It does not work, however, to return while
  1567.      running in    the child's  context  from  the     procedure  which
  1568.      called vfork since    the eventual return from vfork would then
  1569.      return to a no longer existent  stack  frame.
  1570.  
  1571. Please note that the entire address space of the parent is used by
  1572. the child created by vfork(2).  The manual page also points out
  1573. several other caveats involved in doing anything to the parent's
  1574. address space except successfully calling an exec family function or
  1575. _exit (note it specifically says *not* to call exit(2)).  I do not believe 
  1576. that having a shared memory segment disappear from the parent's address 
  1577. space is out of line after reading the man page for vfork(2).
  1578.  
  1579. It is interesting to note that Sun after implementing its new VM system in
  1580. SunOS 4.0 initially had no plans to support vfork, since they felt that the COW
  1581. semantics of the new fork would provide the necessary efficiency gain.  Indeed
  1582. they found that most programs which used vfork worked just fine by doing
  1583. -Dvfork=fork.  All that is, except for a certain popular command interpreter
  1584. [ed: can you say C shell?].  So we are stuck with the legacy of this braindead
  1585. system call.
  1586.  
  1587. BTW, Microport has no plans to fix this :-)."
  1588.  
  1589. 8. FIONREAD fails on regular files
  1590.   Christoph Badura <bad@generics.ka.sub.org> reports that the FIONREAD ioctl()
  1591. fails on regular (disk) files.  He has sent USL a one-line kernel fix.
  1592.  
  1593. 12. fread(3) does the wrong thing on pipes and FIFOs
  1594.    Ed Hall <edhall@rand.org> writes: "Unlike the raw read() system call,
  1595. fread() is supposed to be able to make several partial reads to satisfy the
  1596. data requested by its arguments.  The exceptions are an EOF or an error on the
  1597. stream.  This characteristic is quite useful when moving data through pipes or
  1598. over network connections, since partial reads are quite common in these cases.
  1599. Well, the version of fread() in ESIX 4.0.3 (and likely other Sys5R4's) only
  1600. does a single physical read, and if it only satifies part of the requested
  1601. number of bytes, that's all you get.  This can sting you even if you carefully
  1602. check the value returned by fread(), since the value returned is rounded down
  1603. to the number of complete "nitems" read, although your position in the stream
  1604. can be up to size-1 bytes beyond that point.  Neither ferror() nor feof()
  1605. indicate anything is wrong when this happens."
  1606.    This bug (which is also present in 4.0.4) is serious and nasty and should
  1607. be high on every porting house's list to fix.  It appears to be peculiar to
  1608. USL 4.0.3 and 4.0.4; 4.0.2 does *not* have it, nor does SCO.
  1609.    A USL source claims it has been fixed in 4.1.
  1610.  
  1611. 10. putw appears to be broken
  1612.    There is a bug in the ESIX SVR4.0.3A putw() routine in the C shared
  1613. library which is probably USL's.  The following program demonstrates
  1614. it:
  1615.  
  1616. /* compile with: cc -o file file.c */
  1617. #include <stdio.h>
  1618. main()
  1619. {
  1620.     int i;
  1621.     for (i=0; i<1022; ++i) {
  1622.         putchar('1');
  1623.     }
  1624.     putw(-11, stdout);
  1625.     for (i=0; i<1022; ++i) {
  1626.         putchar('1');
  1627.     }
  1628. }
  1629.  
  1630. The putw() routine does not output 4 bytes, as it should.  It may be
  1631. there is some interaction with buffer flushing that is causing the
  1632. problem.  Also, note that if you change the sign of the first argument
  1633. to putw(), the program works fine.
  1634.  
  1635. 11. Compiler problems
  1636.    Ronald Guilmette <rfg@ncd.com> also reports the following:
  1637.  
  1638. ------------------------------------------------------------------------------
  1639. /* Here is a bug in the original SVR4 C compiler (aka C Issue 5) which
  1640.    effectively prevents you from making good use of the `const' and
  1641.    `volatile' qualifiers defined by ANSI C in conjunction with pointer
  1642.    types and typedef statements.  Compile this code and you will get:
  1643.  
  1644.    "qualifiers.c", line 23: left operand must be modifiable lvalue: op "="
  1645.  
  1646.    ...if your copy of the svr4 C compiler still has the bug.  Note that
  1647.    given these declarations, the ANSI C standard say that the thing pointed
  1648.    to by the variable `pci' should be considered to be constant... not the
  1649.    variable `pci' itself.  (The GCC compiler, either version 1.x or version
  1650.    2.x, correctly compiles this example without complaint.)
  1651. */
  1652.  
  1653. typedef const int *ptr_to_const_int;
  1654.  
  1655. ptr_to_const_int pci;
  1656.  
  1657. int i;
  1658.  
  1659. void main ()
  1660. {
  1661.   pci = &i;
  1662. }
  1663. ------------------------------------------------------------------------------
  1664. /* Here is a subtle bug in the original SVR4 C compiler (aka C Issue 5)
  1665.    which prevents you from first declaring a tagged type (i.e. a struct
  1666.    type or a union type) in a parameter list, and then defining that tagged
  1667.    type later on within the same scope.  (Note that according to the ANSI C
  1668.    standard, the scope in which parameters get declared and the outermost
  1669.    block of a function body are one and the same scope.  Thus, this really
  1670.    is legal ANSI C code!)
  1671.  
  1672.    Try compiling this with your C compiler on SVR4.  If your compiler still
  1673.    has the bug, you will get:
  1674.  
  1675.    "tagged_type.c", line 24: warning: dubious tag declaration: struct S
  1676.    "tagged_type.c", line 28: warning: improper member use: i
  1677.    "tagged_type.c", line 28: warning: improper member use: i
  1678.    "tagged_type.c", line 31: warning: dubious tag declaration: struct S
  1679.    "tagged_type.c", line 35: warning: improper member use: i
  1680.    "tagged_type.c", line 35: warning: improper member use: i
  1681.  
  1682.    (The GCC compiler also had this bug in version 1.x, but it has been fixed
  1683.    in version 2.x.)
  1684. */
  1685.  
  1686. void foobar1 (arg)        /* use old-style without prototypes */
  1687.     struct S *arg;
  1688. {
  1689.   struct S { int i; };        /* define the type `struct S' */
  1690.  
  1691.   arg->i = arg->i;        /* legal according to ANSI C rules! */
  1692. }
  1693.  
  1694. void foobar2 (struct S *arg)    /* use new-style with prototypes */
  1695. {
  1696.   struct S { int i; };        /* define the type `struct S' */
  1697.  
  1698.   arg->i = arg->i;        /* legal according to ANSI C rules! */
  1699. }
  1700. ------------------------------------------------------------------------------
  1701. /* Here is a serious bug in the original SVR4 `dump' program which dumps
  1702.    out parts of object files in either plain hex form or symbolically.
  1703.  
  1704.    To see the `dump' program get a segfault and die, save this code under
  1705.    the name `dump-bug.c' and then do:
  1706.  
  1707.     cc -g -c dump-bug.c
  1708.     dump -v -D dump-bug.o
  1709.  
  1710.    The bug arises whenever `dump' tries to read Dwarf debugging information
  1711.    for an array of pointers to any "user defined" type (e.g. `struct S' in
  1712.    this example).  Past that point, `dump' is totally confused, so further
  1713.    Dwarf debugging information finally causes it to go belly-up.
  1714. */
  1715.  
  1716. struct S { int i; };
  1717. struct S *array[10];
  1718. int j;
  1719. ------------------------------------------------------------------------------
  1720. It appears that the svr4 C compiler (for x86 machines) doesn't conform real
  1721. well to either the letter or the spirit of the IEEE 754 floating-point
  1722. standard.  In particular, "unordered comparisons" and other operations on
  1723. NaNs don't always produce the result that that the IEEE 754 standard calls
  1724. for.
  1725.  
  1726. An AT&T source comments: "This is documented in the SVID as a future direction.
  1727. We do not support NaNs in -Xa and -Xt modes, only in -Xc.  Try
  1728. isnan(sqrt(-1.0)) to determine which modes support it."
  1729. ------------------------------------------------------------------------------
  1730.  
  1731. The compiler fails to issue diagnostics in cases where a typedef name is
  1732. reused to declare a formal parameter, as in:
  1733.  
  1734. -----------------------------------------------------------------------
  1735. typedef int FOO;
  1736. void bar (FOO)
  1737.     int FOO;
  1738. {
  1739. }
  1740. -----------------------------------------------------------------------
  1741.  
  1742. The compiler crashes on the following invalid input:
  1743.  
  1744. -----------------------------------------------------------------------
  1745. int i;
  1746. volatile void *pvv;
  1747.  
  1748. void pvv_test ()
  1749. {
  1750.   (i ? *pvv : *pvv);    /* ERROR */
  1751. }
  1752. -----------------------------------------------------------------------
  1753.  
  1754. The compiler fails to issue diagnostics for cases where an attempt is
  1755. made to "forward declare" an enum type (without also defining it), as
  1756. in:
  1757.  
  1758. -----------------------------------------------------------------------
  1759. enum enum0 *ep;       /* ERROR */
  1760. -----------------------------------------------------------------------
  1761.  
  1762. The compiler rejects the following code with an error, although there
  1763. seems to be no good reason why it should (because no object is being
  1764. declared).
  1765.  
  1766. -----------------------------------------------------------------------
  1767. #include <limits.h>
  1768.  
  1769. typedef char array_type[ULONG_MAX];
  1770. -----------------------------------------------------------------------
  1771.  
  1772. 12. getlogin() doesn't work
  1773.    Robert Withrow <witr@rwwa.com> reports "The posix function
  1774. getlogin() doesn't work on most svr4s (at least up to SVR4.0.3.0...
  1775. cuserid() *does* work, but it makes porting a pain.  Try it some time
  1776. and perhaps add it to your list."
  1777.    Raymond Nijssen  <raymond@woensel.es.ele.tue.nl> confirms this and
  1778. adds that this bug (due to utmp and wtmp file corruptions [possibly
  1779. caused by ttymon bugs described above --- ed.]) breaks executables such
  1780. as talk(1).
  1781.  
  1782. 13. syslog routines don't work
  1783.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports: "Under ESIX 4.0.3,
  1784. syslog routines are unusable. They are slightly better under 4.0.4, but still
  1785. severely broken."
  1786.    "In addition, replacing the syslogd executable that comes with Esix with the
  1787. one provided by Marc Boucher (marc@cam.org) shows that the syslog() call itself
  1788. is sane. It's available from ftp.cam.org."
  1789.  
  1790. 14. Bogus `r' in xt driver configuration flags
  1791.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports: "Both under ESIX
  1792. 4.0.3 and 4.0.4, the `r' flag is present in the third column of
  1793. /etc/conf/cf.d/mdevice for the [n][s]xt drivers, suggesting that these drivers
  1794. would be required for relinking the kernel. This is not the case. I saw at
  1795. least one release of Dell SVR4 in which this was ok."  (Making this change
  1796. reduces the kernel's size somewhat.)
  1797.  
  1798. 15. ioctl for kernel symbol fetches fails
  1799. Trying to obtain kernel values of certain symbols fails.  The 
  1800. two symbols from the kernel that are quite useful are "avenrun" and
  1801. "total" which as far as I can tell are defined in the "mm" driver.
  1802. This bug manifests itself in applications like "top", "u386mon" ...
  1803. One used to use the nlist() function call, but according to the man page
  1804. for nlist() it should not be used due to the dynamic loading and unloading
  1805. of drivers that can happen at any time in the "life" of a V.4.2 kernel.
  1806.  
  1807. Try the sample hack below to see if your system has the same problem.
  1808.  
  1809. #include <sys/types.h>
  1810. #include <sys/stat.h>
  1811. #include <fcntl.h>
  1812. #include <sys/ksym.h>
  1813.  
  1814. main()
  1815. {
  1816.     int fd=0;
  1817.     long ar[3];
  1818.     struct mioc_rksym k;
  1819.  
  1820.     fd = open("/dev/kmem", O_RDONLY);
  1821.     k.mirk_buflen = sizeof(ar);
  1822.     k.mirk_buf = (void *)&ar;
  1823.     k.mirk_symname = "avenrun";
  1824.     if((ioctl(fd, MIOC_READKSYM, &k))==-1)    {
  1825.         perror("ioctl");
  1826.         exit(1);
  1827.     }
  1828.     printf("%d %d %d\n",ar[0],ar[1],ar[2]);
  1829.     close(fd);
  1830. }
  1831.  
  1832. Thanks to David P. Cutter <dpc@shady.grail.com> for reporting this.
  1833.  
  1834. 16. Bug in cc optimizer (4.2.1)
  1835.  
  1836.    Nickolay Saukh <nms@ussr.eu.net> reports a bug in
  1837. cc, the Optimizing C Compilation System  (CCS) 2.0  07/24/92 
  1838.  
  1839. If you have global (external) structure/union with name 'tr'
  1840. commands to access very first member (with zero offset) are
  1841. garbled. Simple text to reproduce the bug
  1842.  
  1843.     struct _tr {
  1844.         int    aa;
  1845.         int    bb;
  1846.     } tr;
  1847.  
  1848.     void
  1849.     foo(int zz) {
  1850.         tr.aa = zz;
  1851.     }
  1852.  
  1853. Here is the result of cc -O -S foo.c
  1854.  
  1855.     .file    "ccbug.c"
  1856.     .version    "01.01"
  1857.     .type    foo,@function
  1858.     .text
  1859.     .globl    foo
  1860.     .align    4
  1861.  
  1862.     .nopsets    "cc"
  1863.     .align    16
  1864. foo:
  1865.     movl    4(%esp),%eax
  1866.     movl    %eax,&r
  1867.              ^------------- <<<< THE BUG
  1868.     ret    
  1869.     .align    16,7,4
  1870.     .size    foo,.-foo
  1871.     .ident    "acomp: (CCS) 2.0  07/24/92 "
  1872.     .data
  1873.     .comm    tr,8,4
  1874.     .text
  1875.     .ident    "optim: (CCS) 2.0  07/24/92 "
  1876.  
  1877. **  17. /usr/ucb/install uses missing group "staff"
  1878.    /usr/ucb/install uses the group name "staff" as the default group to install
  1879. programs. As this group does not exist in /etc/group, the installation will
  1880. fail.  I would suggest changing the /etc/group file like in Solaris as follows:
  1881.  
  1882.         nuucp::9:root,nuucp
  1883.         staff::10:
  1884.  
  1885. VII. The FUBYTE Problem
  1886.  
  1887. (Thanks to Christoph Badura <bad@flatlin.ka.sub.org> for this info)
  1888.  
  1889. The kernel function fubyte() is documented to return a positive value when
  1890. given a valid user space address and -1 otherwise. In the latter case u.u_error
  1891. is set to EFAULT.  USL SysV R4.0.3 has a sign extension bug in the
  1892. implementation of fubyte() for local file descriptors (i.e. not opened via
  1893. RFS), which causes fubyte() to return negative values if the byte fetched has
  1894. its high bit set. This bug doesn't affect STREAMS drivers, as they don't call
  1895. (and in fact are normally unable to call) fubyte().  Thus writing a byte with
  1896. the high bit set to certain character device drivers returns with -1 and errno
  1897. set to EFAULT.
  1898.  
  1899. The bug may affect any character device driver that calls fubyte(). It's not
  1900. limited to serial card drivers. The bug is noticed most often with serial card
  1901. drivers, since uucp uses byte values > 127 very early during g-protocol setup
  1902. and drivers for serial cards tend to use fubyte() quite often.
  1903.  
  1904. Note also that the bug's effect is different if the driver checks for a -1
  1905. return value of fubyte() or just a negative one. In the former case it is
  1906. possible to pass bytes with the 8 bit set through fubyte(), except for 0xff
  1907. which is -1 in two's complement. That makes the bug more obscure.
  1908.  
  1909. The fix is easy.  First, make a backup copy of the kernel object file
  1910. /etc/conf/pack.d/kernel/vm.o!  A disassembly of vm.o(lfubyte) should reveal
  1911. *exactly* one mov[s]bl (move byte to long w/sign extend).  That one needs to be
  1912. patched into a movzbl (zero extend). The difference is one bit in the second
  1913. byte of the opcode.
  1914.  
  1915. The movsbl has the bit pattern 00001111 1011111w mod/rm-byte.
  1916. The movzbl has the bit pattern 00001111 1011011w mod/rm-byte.
  1917.  
  1918. The 'w' bit is 0 for the instruction in question. So the opcodes are 0f be and
  1919. 0f b6. Here is the diff -c from dis -F lfubyte showing the patch applied to
  1920. the Dell 2.1 kernel:
  1921.  
  1922. *** vm.o    Mon Mar  9 00:31:38 1992
  1923. --- vm.o.org    Mon Mar  9 00:32:40 1992
  1924. ***************
  1925. *** 22,28 ****
  1926.       11c90:  85 c0                 testl  %eax,%eax
  1927.       11c92:  75 09                 jne    0x9 <11c9d>
  1928.       11c94:  8b 45 08              movl   8(%ebp),%eax
  1929. !     11c97:  0f b6 00              movzbl (%eax),%eax
  1930.       11c9a:  89 45 fc              movl   %eax,-4(%ebp)
  1931.       11c9d:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1932.       11ca7:  83 3d dc 13 00 00 00  cmpl   $0x0,0x13dc
  1933. --- 22,28 ----
  1934.       11c90:  85 c0                 testl  %eax,%eax
  1935.       11c92:  75 09                 jne    0x9 <11c9d>
  1936.       11c94:  8b 45 08              movl   8(%ebp),%eax
  1937. !     11c97:  0f be 00              movsbl (%eax),%eax
  1938.       11c9a:  89 45 fc              movl   %eax,-4(%ebp)
  1939.       11c9d:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1940.       11ca7:  83 3d dc 13 00 00 00  cmpl   $0x0,0x13dc
  1941.  
  1942. Of course there is a workaround at the driver level.  Canonically, one would do
  1943. this by checking for fubyte() returning -1 *and* u.u_error being set to EFAULT
  1944. (u.u_error is cleared upon entering a system call).  However, in R4.0.3
  1945. fubyte() does NOT set u.u_error.  It *does* set u.u_fault_catch.fc_errno.
  1946.  
  1947. Cristoph reports that Dell 2.1 can be object-patched successfully to fix this.
  1948. I'm told that the offending 11c97 is at exactly the same address in the
  1949. Consensys 1.3 kernel.  
  1950.  
  1951. At vm.o:fa7d in Dell 2.2 there's a movzbl (%edx),%edx; same instruction,
  1952. different target register.  Here's the relevant diff output:
  1953.  
  1954. *** vm.o-old    Wed Jul  7 03:13:11 1993
  1955. --- vm.o    Wed Jul  7 03:13:00 1993
  1956. ***************
  1957. *** 25,31 ****
  1958.         fa76:  85 c0                  testl  %eax,%eax
  1959.         fa78:  75 09                  jne    0x9 <fa83>
  1960.         fa7a:  8b 55 08               movl   8(%ebp),%edx
  1961. !       fa7d:  0f b6 12               movzbl (%edx),%edx
  1962.         fa80:  89 55 fc               movl   %edx,-4(%ebp)
  1963.         fa83:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1964.         fa8d:  83 3d dc 13 00 00 00   cmpl   $0x0,0x13dc
  1965. --- 25,31 ----
  1966.         fa76:  85 c0                  testl  %eax,%eax
  1967.         fa78:  75 09                  jne    0x9 <fa83>
  1968.         fa7a:  8b 55 08               movl   8(%ebp),%edx
  1969. !       fa7d:  0f be 12               movsbl (%edx),%edx
  1970.         fa80:  89 55 fc               movl   %edx,-4(%ebp)
  1971.         fa83:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1972.         fa8d:  83 3d dc 13 00 00 00   cmpl   $0x0,0x13dc
  1973.  
  1974. Applying this patch produces a working kernel.
  1975.  
  1976. I do not know the status of the other ports.
  1977.  
  1978. Another poster (Marc Boucher <marc@cam.org>) adds:
  1979.  
  1980. On ESIX SVR4.0.3 Rev. A, the instruction movsbl in question can be changed to
  1981. movzbl (as described above) with a binary-editor on file
  1982. /etc/conf/pack.d/kernel/vm.o. At offset 0x11eb0, change 0xbe to 0xb6.
  1983.  
  1984. Before patching, verify that your /etc/conf/pack.d/kernel/vm.o is the same as
  1985. mine!  On my system, the /bin/sum generated checksum of vm.o was "4440 222".
  1986.  
  1987. The problem results from a sign-extension bug.  The function lfubyte(), which
  1988. is called by fubyte(), is declared as
  1989.  
  1990. int lfubyte(char *addr);    /* actually caddr_t */
  1991.  
  1992. The byte is fetched with
  1993.  
  1994.     val = *addr;
  1995.  
  1996. which triggers sign extension.  Casting addr to a unsigned char * or declaring
  1997. it as such solves the problem.
  1998.  
  1999. This bug is still present in stock USL 4.0.4.  However, it has been fixed in
  2000. Dell 2.2.
  2001.  
  2002. Raymond Nijssen contributes the following:
  2003.  
  2004. ---- README --------------------------------------------------------------->8--
  2005. This shell script was written to help out people who are less experienced in
  2006. patching kernel binaries.
  2007. This version can be used to fix the fubyte bug in follwing SVR4 flavors:
  2008.  
  2009.     ESIX 4.0.3A
  2010.     ESIX 4.0.4
  2011.     Dell 2.1
  2012.     Consensys 1.3
  2013.  
  2014. You need sdb and your system has to be able to rebuild the kernel. 
  2015.  
  2016. After the patch is applied, you have to rebuild the kernel by running
  2017. /etc/conf/bin/idbuild and /etc/conf/bin/idreboot for the patch to take effect.
  2018.  
  2019. You have to be root to do all this.
  2020. The program will ask for your confirmation before it changes anything.
  2021.  
  2022. Please do make a backup first, and remember that you can select the old kernel
  2023. (/stand/unix.old) at boot time by pressing the space bar at the 'Booting the
  2024. ESIX system....' prompt, in case the system fails to boot from the patched
  2025. kernel, though this is higly unlikely.
  2026.  
  2027. Systems to which this patch was applied have been running flawlessly
  2028. for several months, in case you have doubts...
  2029.  
  2030. Happy patching!
  2031. --------------------------------------------------------------------------->8--
  2032.  
  2033. ----- fbfix --------------------------------------------------------------->8--
  2034. #!/bin/sh
  2035. #
  2036. #    Copyright (c) 1993  Raymond X.T. Nijssen  (raymond@woensel.es.ele.tue.nl)
  2037. #               All Rights Reserved
  2038. #
  2039.  
  2040. # the bug...
  2041. #
  2042. b=fubyte
  2043.  
  2044. # offsets according to flakey USL sdb.  gdb and dis say something different
  2045. esix403_o=0x11eb0
  2046. esix404_o=0x11683  
  2047. dell21_o=0x11c98    #dell 2.1
  2048. cons13_o=$dell21_o  #consensys 1.3
  2049.  
  2050. # data
  2051. v=0x458900be #old 
  2052. r=0x458900b6 #new
  2053.  
  2054. # file
  2055. f=/etc/conf/pack.d/kernel/vm.o
  2056.  
  2057. # progs
  2058. s=/usr/ccs/bin/sdb
  2059. i=/etc/conf/bin/idbuild
  2060.  
  2061. c='\c';t='\t';n='\n';N=/dev/null
  2062.  
  2063. # aux
  2064. pe() if [ -n "$e" ];then echo ${n}ERROR: $e $n;e="";fi
  2065. yn() { while :;do echo $n$1 [$2] $c;read a;if [ -z "$a" ];then a=$2;fi
  2066.  case "$a" in y*)return 0;;n*)return 1;;*)echo Answer 'y' or 'n';;esac;done;}
  2067. cr() if id|grep "^uid=0">$N;then return 0
  2068.  else e="Only root may patch the kernel";return 1;fi
  2069. ab() { echo ${n}FATAL: $e$n;exit 1;}
  2070. ac() { pe;yn "Continue ?" "y";return;}
  2071. qu() { R="";if [ -n "$1" ];then d="[$1] :";else d=":";fi
  2072.  while [ -z "$R" ];do echo ${n}Enter the $2 $d $c;read a
  2073.   if [ "$a" ];then R=$a;elif [ -n "$1" ];then R=$1;
  2074.   else e="No $2 entered";ac||exit 0;fi;done;}
  2075.  
  2076.  
  2077. # main
  2078. if [ ! -t 0 ];then e="This program must not be piped into a shell";ab;fi
  2079. if [ ! -f $s ];then e="$s not found";ab;fi
  2080. if [ ! -f $f ];then e="$f not found";ab;fi
  2081. if [ ! -f $i ];then e="$i not found";ab;fi
  2082.  
  2083. echo $n$n${t}YOU are responsible for running this program.$n$n${t}Clauses 9 and 10 of the GNU GENERAL PUBLIC LICENSE$n${t}apply to this program.$n$n${t}If you continue, you thereby agree that its author, $n${t}nor his employer, nor anybody else except yourself, has any $n${t}liablity for any loss, damage etc. etc.$n
  2084.  
  2085. ac||exit 1
  2086.  
  2087. echo $n$n${t}Fixable versions with the $b bug$n$n$t$t[1]$t ESIX 4.0.3A$n$t$t[2]$t ESIX 4.0.4$n$t$t[3]$t DELL 2.1$n$t$t[4]$t Consensys 1.3$n
  2088. R=1;qu "$R" "SVR4 flavor this system is running"
  2089. case $R in 1)o=$esix403_o;; 2)o=$esix404_o;;3)o=$dell21_o;; 4)o=$cons13_o;;
  2090.  *)e="Invalid answer";ab;;esac
  2091.  
  2092. echo $n${t}Looking for replacement target ... $c
  2093. if echo $o:?lx|$s -e $f 2>$N|grep $o/$v>$N;then echo found
  2094.  if yn "Do you want to patch the kernel now?" "n";then
  2095.   cr||ab
  2096.   qu "$f.orig" "name of backup file"
  2097.   if [ -f $R ];then e="File $R already exists";ab;fi
  2098.   if cp $f $R;then echo $n${t}Copied $f to $R;else e="Failed to write $R";ab;fi
  2099.   if echo $o!$r|$s -e -w $f>$N 2>&1;then
  2100.    echo ${n}Fixed $b bug, you may now run $i and reboot$n;else e="$s failed";pe
  2101.    if cp $R $f;then echo $n${t}Copied $R to $f;else e="Restore $f failed";pe;fi
  2102.    e="Patch failed!!";ab;fi
  2103.  fi
  2104. else echo not found;e="Replacement target not found at expected offset";ab;fi
  2105. --------------------------------------------------------------------------->8--
  2106.  
  2107. VIII. Destiny and Dell
  2108.  
  2109. A source at at UNIX System Labs Europe claims that `Destiny' (the new Release
  2110. 4.2) incorporates all of Dell UNIX's fixes to 4.0.3; thus, any bug for which a
  2111. Dell fix is indicated above should be gone in Destiny.
  2112. --
  2113.     Send your feedback to: Eric Raymond = esr@snark.thyrsus.com
  2114.