[comp.lang.idl-pvwave] Bug in SunOS 4.1.1 affects IDL

ali@cs.Colorado.EDU (Ali Bahrami) (04/16/91)

						15 April 1991

    A bug in SunOS 4.1.1 can cause transfers of data from IDL to a
    disk file to fail. The relevant Sun Microsystems bug report,
    as retrieved from their Online Bugs Database is as follows:

	      Reference Number:    1052649
	      Synopsis:  write system call is returning EINTR
 
	      Category:  kernel
	      Subcategory:  ufs
	      Releases:  4.1.1
 
	      Hardware:  sun4c_60

	      Description:
	            Customer's programs behave differently on 4.1.1 than
	            on 4.1.  For example, a customer had a program that
	            first sets up a signal handler for the SIGALRM signal,
	            then sets up the ITIMER_REAL alarm to be posted.
	            The program then goes into a loop writing data out
	            to a file.  On 4.1 the kernel restarts the write(2)
	            call. On 4.1.1, the kernel returns EINTR.
	        WORK AROUND:
	            Set ufs_WRITES to 0 with adb.

    Since the problem is in the operating system kernel, it will not
    help to use earlier versions of IDL. Other programs may also exhibit
    the problem. Despite the Sun bug report, we believe the bug
    exists on all systems running SunOS 4.1.1, and not just the
    SparcStation 1 (sun4c_60). Here are the known options for dealing
    with this situation:

	1) If you haven't upgraded to SunOS 4.1.1 yet, wait
	   until Sun clears up this problem.

	2) The bug surfaces when X windows is running, because our
	   X windows driver uses the SIGALRM signal. Therefore, things
	   will work until the first window is created. Note that once
	   a window has been created, deleting it won't help because the
	   timer keeps running.

	2) Sun's software support people tell us that there is an
	   unofficial kernel patch that fixes the problem, and that they
	   are working to get an official patch out. If you are under
	   Sun software maintenance, you should contact them for
	   additional details. Be sure to give them the bug reference
	   number (1052649) when you call.

	3) You can patch the kernel to set ufs_WRITES to 0 with adb,
	   as suggested in the Sun bug report. Directions for doing
	   that are supplied below. We suggest that you try to
	   obtain the Sun patch before considering this approach.
	   
Patching The Operating System Kernel
------------------------------------
    If you wish to patch your kernel, here is a sequence of steps to use.
    Please be aware of the following before proceeding:

	- We have tried this procedure, and believe it is correct.
	  It is supplied in good faith as a service to our customers.
	  However, we cannot be responsible for any damage it causes
	  to your system. Please read it carefully, and only apply if
	  if you are convinced that it is correct.

	- ALWAYS SAVE A COPY OF THE UNALTERED KERNEL. When applying
	  any patches supplied by Sun, always start with the original
	  kernel, and not the one that results from this procedure.

    You should be very careful to issue these commands exactly as shown
    to avoid corrupting your system.

	1) Log in as root. Take the system down to single
	   user mode:
		# shutdown
	2) Make a copy of your existing kernel for safe keeping.
		# cp /vmunix /vmunix_orig
	3) Run adb on the kernel. Note that adb does not supply a prompt.
		# adb -w /vmunix
	4) Change the value of ufs_WRITES to zero.
		_ufs_WRITES?W0
	5) Exit adb.
		$q
	6) Reboot your system.
		# fastboot

    Note that you can always boot the copy of the kernel you saved in
    Step 2 if something should go wrong. From the console monitor prompt:

	> b sd(0,0,0)vmunix_orig

Restoring The Original Kernel
-----------------------------
    If you wish to restore the original operating system kernel:

	1) Log in as root. Take the system down to single
	   user mode:
		# shutdown
	2) Move the patched kernel out of the way and rename the
	   saved one back:
		# mv /vmunix /vmunix_patched
		# mv /vmunix_orig /vmunix
	3) Reboot your system.
		# fastboot
	4) Once you've rebooted, you can delete the patched kernel.
	   Log in as root and issue the command:
		# rm /vmunix_patched

------------------------------------------------------------------------------
 Ali Bahrami			| (303) 786-9900		voice
 Research Systems, Inc.		| (303) 786-9909		fax
 777 29th St., Suite 302	| idl@boulder.colorado.edu	internet
 Boulder, CO 80303		| idl@cololasp			bitnet
				| orion::idl			span
------------------------------------------------------------------------------