Sun-Spots Digest, v6n255

William LeFebvre Sun-Spots-Request at Rice.edu
Thu Oct 13 02:31:44 AEST 1988


SUN-SPOTS DIGEST          Sunday, 9 October 1988      Volume 6 : Issue 255

Today's Topics:
                           Re: cc after dbxtool
                         Re: Aborts after dbxtool
                          Re: gettimeofday() bug
        Re: getting your login environment in command(shell)tools
              Re: Problem with TB+ dialing out at 2400 baud
                       New version of contool: 2.0
                              NULLs in files
                Checking progress of long-running programs
                need Sun Server disk drive/controller info
           How do I get mail(1) to use Return-Path for replys?
          How do I translate x at y to y!x if y is a uucp neighbor?
                             Source for 'S'?
                         PD archiving software ?

Send contributions to:  sun-spots at rice.edu
Send subscription add/delete requests to:  sun-spots-request at rice.edu
Bitnet readers can subscribe directly with the CMS command:
    TELL LISTSERV AT RICE SUBSCRIBE SUNSPOTS My Full Name
Recent backissues are available via anonymous FTP from "titan.rice.edu".
For volume X, issue Y, "get sun-spots/vXnY".  They are also accessible
through the archive server:  mail the request "send sun-spots vXnY" to
"archive-server at rice.edu" or mail the word "help" to the same address
for more information.

----------------------------------------------------------------------

Date:    Wed, 5 Oct 88 14:42:03 EDT
From:    John Delsignore <jdelsign at bfly-vax.bbn.com>
Subject: Re: cc after dbxtool

This is what I believe to be a bug in the Sun OS ptrace()/wait() system
calls.  If a process that is ptrace()'ing another process terminates
abnormally, the debugged process is not cleaned up.  The next process that
executes a wait() system call gets the status of the orphaned (debugged)
process.  Let me demonstate.

First a program that does a wait() system call:
    /* waitx.c */
    main()
    {
	int pid, status;
	pid = wait(&status);
	printf("pid = %d, status = %d\n", pid, status);
    }

Since this programs never creates a child process, the wait() *should*
always fail, right?

In one window I compiled `waitx' and ran it, and it failed just like it is
supposed to.

    # cc -o waitx waitx.c
    # waitx
    pid = -1, status = 0

Then copied waitx to `debugme' just to have something to run dbx on; any
program will do.

    # cp waitx debugme
    # dbx debugme
    Reading symbolic information...
    Read 112 symbols
    (dbx) stop in main
    (1) stop in main
    (dbx) run
    Running: debugme 
    stopped in main at 0x20a4
    main+4:         addl    #-8,a7
    (dbx)

In another window, I ran `ps' to list the pids.

    # ps
      PID TT STAT  TIME COMMAND
    26047 p0 S     0:00 dbx debugme
    26048 p0 T     0:00 debugme

Now kill dbx.  And look for the debugged process.

    # kill -9 26047
    # ps l26048
	  F UID   PID  PPID CP PRI NI ADDR  SZ RSS   WCHAN STAT TT  TIME COMMAND
    1000401 694 26048     1  1  25  0    0   0   0         Z    ?   0:00 <exiting>

Now when I run `waitx', I get the pid of the debugged process.

    # waitx
    pid = 26048, status = 9

The question is, why doesn't init reap this process?  And why is it that
innocent `waitx' gets the status of a pid it knows nothing about?

Here's my best guess at what's going on with dbxtool and cc.  It must be
the case that dbxtool does not properly kill (using ptrace(KILL)) and reap
the debugged process in all cases.  So, the next program that is run and
does a wait() gets the wrong exit status.  `cc' is a compiler driver.  It
runs several processes (e.g., cpp, ccom, as, and ld).  After it starts an
inferior, it must do a wait() to get the status.  If the status is not 0,
then there is no sense in continuing.

The above was done under Sun OS 3.4 on a 3/50 client.  I tried the same
experiment on a vanilla 4.3BSD system and it works properly.  That is,
after the debugger is killed, the debugged process is reaped by init and
does not appear in a `ps' listing and `waitx' fails like it is supposed
to.

Cheers, John D.

------------------------------

Date:    Thu, 6 Oct 88 15:41:54 edt
From:    spr at cs.brown.edu
Subject: Re: Aborts after dbxtool

This is probably an instance of a more general problem that I reported to
sun last year and occurs in all 3.X versions of the operating system on
both sun3's and sun4's.  The problem occurs when dbx is killed while
ptracing a process.  The signal that kills dbx is saved up in some way and
is passed to the next process using the process slot of the ptracedd
process.  csh seems to avoid this, but things run from /bin/sh (including
things run by system(3), i.e. cc) get this signal if they run in that
process slot.  Note that the signal can be delayed indefinitely (until the
slot is used) and that it can go to other users on the same machine just
as easily as the one killing dbx.

------------------------------

Date:    Wed, 5 Oct 88 19:14:10 PDT
From:    wiley!david at csvax.caltech.edu
Subject: Re: gettimeofday() bug
Reference: v6n247

Sven-Ove Westberg writes:
>[The tv_usec part of the output from gettimeofday will be]
>dd00dd where d is any digit 0-9 and 0 is always 0. 
>Sun is the only machine where I found this kind of timegap.
>
>Can someone explain the two 0 in the middle??

It's not a bug, it's a feature!

The clock on the Sun is only accurate to .02 seconds (this may be
different in different models).  If you tried to calculate the rate at
which something happens by calling gettimeofday before and after the event
and dividing by the difference, your program might get a divide by zero
error.  To prevent this, the gettimeofday calls a routine uniqtime which
makes sure the time returned is different for each call to gettimeofday.

-David

------------------------------

Date:    Thu, 6 Oct 88 07:44:52 PDT
From:    jrich at devnet4.hac.com (john richardson)
Subject: Re: getting your login environment in command(shell)tools

Direct reply to orion.mc.duke.edu yielded Returned mail:
Cannot send message for 1 week

I have seen this noted a long time ago in some Sun technical notes.
However, I have had problems with cron jobs using this scheme.  In
particular, I had a statement in .cshrc to build an overly informative
prompt:

set host = `/bin/hostname`
if( $?prompt ) then
	alias heyyou 'set prompt = "\\
$host : $user : `pwd`\\
\! >"'
	heyyou
else
	alias heyyou cat /dev/null
endif
alias a alias
a cd  'cd \!*;heyyou'
a pushd  'pushd \!*;heyyou'
a popd  'popd;heyyou'

This worked fine until I tried running a cron job, that did 'su' to my
user id.  It failed setting the prompt because $user was not defined.
(whoami is one answer, also helps if you become super user sometimes.) I
did some tests and sure enough, $prompt was set for a cron job although I
wouldn't consider it an interactive job.

Possibly a better way to test for interactivity is as follows:

tty -s
if ( $status == 0 ) then
	...interactive processing
endif

Another is to test for the settedness of both user and prompt

if ( $?prompt && $?user ) then
	...interactive processing
endif

By the way, the environment from cron is determined (at least at our
installation) by /etc/rc.  Because of the following statement in /etc/rc

#
#	@(#)rc 1.2 86/08/25 SMI; from UCB 4.2
#

HOME=/; export HOME
PATH=/bin:/usr/bin

cron has a pretty sparse path and attempts to find Berkeley lpr, mail,
etc. all fail or find the wrong program.  I feel that cron should be
started in /etc/rc.local so a system adminstrator could tailor the default
environment for his installation with confidence.  I worry that /etc/rc is
not mine to change.

John Richardson
Hughes Aircraft Company
jrich at devnet4.hac.com
(714) 732-5588

------------------------------

Date:    Thu, 6 Oct 88 09:18:19 EDT
From:    Sergei A. Gourevitch <asg at space.mit.edu>
Subject: Re: Problem with TB+ dialing out at 2400 baud
Reference: v6n248

I have the interface speed locked at 19200 on my TB+  and use automatic
speed determination.(s66=1,s50=0,s51=5). I've had no trouble going into
(or from) a Hayes at 2400 baud.

This is the prefered mode for running the TB+ if the flow control problem
doesn't hurt you; the data rate is highest in this mode because the data
gets to and from the computer the fastest.

Flow control:
	I leave my modems set at
		S58 = 0	no flow control
		S111 = 255  use the other guy's protocol

TB+ to TB+   uucp   s111=30	on the dialing modem
	     kermit      10		"

	Everything works... slip, uucp , tip 
	except... tip really wants there to be flow control   S58=3

I usually don't bother, it doesn't matter at typing speeds. If you wish to
transfer files using tip, you should turn on the flow control.

TB+ to slower modems.   I've never had any trouble without the flow
control.  (I've never tried to transfer large files using tip) I've done
uucp and kermit. 

(Actually, I don't yet have a 19200 baud kermit.. I slow the interface
down to 9600 if I'm dialing out. Incoming is no problem)

Hope this helps.

S.A. Gourevitch
CSR
MIT
asg at space.mit.edu

------------------------------

Date:    Thu, 25 Aug 88 13:03:00 EDT
From:    Chuck Musciano <chuck at trantor.harris-atd.com>
Subject: New version of contool: 2.0

Contool 2.0 is now available.  This version includes the following new
features:

	* use of regular expressions in filter strings
	* automatic reload of filters when ~/.contool is modified
	* ability to load filters from any file
	* protection against text window overflow
	* reworked frame menu for ease of use
	* ability to regain the console attribute

This version is a definite improvement over 1.0 and 1.1.  Comments and bug
reports are always appreciated.

Chuck Musciano
Advanced Technology Department
Harris Corporation
(407) 727-6131
ARPA: chuck at trantor.harris-atd.com

[[ Some of you may have noticed that I am way behind in putting up sources
for distribution.  I hope to catch up in the next few weeks.  Sorry about
the delays.  The shar file for Contool 2.0 is available in the archives
under "sun-source" as "contool.shar", replacing the old version.  The new
file is 57685 bytes long and can be retrieved via anonymous FTP from the
host "titan.rice.edu" or via the archive server.  For more information
about the archive server, send a mail message containing the word "help"
to the address "archive-server at rice.edu".  --wnl ]]

------------------------------

Date:    Thu, 06 Oct 88 11:34:04 -0500
From:    abe at mace.cc.purdue.edu (Vic Abell)
Subject: NULLs in files

Here is a response from Sun on this problem.

   Vic,

   Thanks for the additional info.  In looking through our bugs database,
   I've discovered what appears to be the problem (bug id #1011525).  This
   particular problem relates to a bug with nfs client caching of data.

   Sometimes nfs file data on a client will not be flushed even when this
   data is correct.  This leads to various symptoms, one of which is what
   you have been seeing, corruption of data in the file.

   The good news is that the fix for this bug is slated for inclusion into
   the 4.0.1 release.  Although the date for this release hasn't been
   announced yet, it should not be too much farther off.  If you are
   interested you can contact me via e-mail every week or two and I'll let
   you know the current status of 4.0.1.  The last I heard was that the
   4.0.1 release will be shipped to all contract customers at no extra
   charge.  Other customers (like yourself?) should contact your sales rep
   when 4.0.1 is available for ordering instructions.

   Best regards,

   john

   John J. Chiasson			ARPA:  jchiasson at sun.com
   Sun Microsystems			UUCP:  sun!jchiasson
   Network Technical Support Engineer

The bugs that really bite are always "fixed in the next release."  ;-(

BTW, to respond to the editor's comment on my last posting, the NULLs are
not aligned on block boundaries, and often have been observed within the
first few hundred bytes of the file.

Vic Abell

------------------------------

Date:    Thu, 6 Oct 88 14:29:32 EDT
From:    Bennett Todd <bent!bet at mcnc.org>
Subject: Checking progress of long-running programs

I don't know about flushing buffers, but I have come up with two hacks
that I use to track the progress of long-running programs. I borrowed a
trick from sendmail and have the program overwrite argv with a message
indicating where it is in the run; you can read this via ps(1). If I want
more detailed information I fire up gdb and "attach" to the process, or
fire up dbx and say "debug a.out pid", and examine the internal state of
the program, then let it continue with "detach".  This latter ability is
great for debugging all sorts of other problems as well; I always install
production version of utilities that might not be 100% perfect (which is
to say all of them:-) with "-g" debugger information in them, so if a user
finds a way to hang something I can reach in and debug it, and don't have
to know what they did exactly to reconstruct the situation on a new run
under the debugger. The enhanced ptrace(2) is one of the SunOS features I
like best. I hope other UNIX varients pick up on this one.

-Bennett
bet at orion.mc.duke.edu
(The above "From:" won't work for reply; it's still sendmail 5 Bennett 0)

------------------------------

Date:    6 Oct 88 20:43:00 GMT
From:    coherent!celeste at ames.arc.nasa.gov (Celeste C. Stokely)
Subject: need Sun Server disk drive/controller info

I'm looking for information on SMD disks for my Sun 3/280. I'm interested
in hearing about disks > 1GB, with the new, faster controllers.

I'm afraid I also need a short course on what these new controllers are
all about. I am familiar with a Xylogics 450/451 type.

This disk will replace a Fuji-M2361 Eagle/Xylogics 451 combo. I am keeping
a Hitachi DK815/Xylogics 451.

Also, does anyone have an address/phone number for Ciprico? They certainly
sound worth contacting!

Email to me, please, and I will post a summary if there is sufficient
interest.

Many thanks,

..Celeste Stokely
Coherent Thought Inc.
UUCP:   ...!{ames,sun,uunet}!coherent!celeste  Domain: celeste at coherent.com
Internet: coherent!celeste at ames.arpa or ... at sun.com or ... at uunet.uu.net
VOX:  415-493-8805 
SNAIL:3350 W. Bayshore Rd. #205, Palo Alto CA  94303

------------------------------

Date:    Thu, 6 Oct 88 11:15:39 EDT
From:    lai at vedge.UUCP (David Lai)
Subject: How do I get mail(1) to use Return-Path for replys?

I'm using the standard mail that comes with sun 3.5 for sun3.  Most of the
time I can 'r' reply to mail, but sometimes I cannot.  It seems as if mail
prefers to use the path in From: header instead of the Return-Path:
header, which seems to always contain the proper return path.

Can I tell mail to use Return-Path?

------------------------------

Date:    Thu, 6 Oct 88 11:18:35 EDT
From:    lai at vedge.UUCP (David Lai)
Subject: How do I translate x at y to y!x if y is a uucp neighbor?

Another problem I have is that sending mail to 'foo at bar' returns the
message:

	bar - host unknown

whereas bar is the name of a uucp neighbor.  Can I tell sendmail to look
at the output of uuname and translate foo at bar to bar!foo?

(sun3 running 3.5 in case you're wondering).

------------------------------

Date:    06 Oct 88 14:48:00 EDT
From:    Greg Morrison <MORRISON at CARLETON.BITNET>
Subject: Source for 'S'?

Hi -- would anyone know who I can contact regarding purchase of the 'S'
statistical package for Suns?  The Sun Catalyst issue of August, 1987,
listed 'S-PLUS' as available from Statistical Sciences Inc., in Seattle.
However, their phone number no longer exists, and they are not listed in
the most recent Catalyst, apparently.  I know that the package originated
at Bell Labs, but I don't know who to contact there, whether they still
make it available, etc.  Any information you can provide would be
appreciated.

Greg Morrison   <MORRISON at CARLETON.BITNET>

------------------------------

Date:    Thu, 6 Oct 88 17:24 EDT
From:    davis%blue at sdr.slb.com
Subject: PD archiving software ?

Organization: Schlumberger Cambridge Research
Snail: PO Box 153, Cambridge CB3 0HG, England
Phone: [+44] (0) 223 325282

Any pointers to PD archiving software for Suns? What I'm after is
basically a user front end that lets them queue files for saving to
offline media (the actual save can be carried later by an operator).
Obviously, this is not too difficult to write oneself, but I thought I'd
check first to avoid needless duplication and/or pitfalls.

thanks in advance for any help,

Paul Davis
Schlumberger Cambridge Research

davis%blue at sdr.slb.com

"hows the mail From: line looking these days ?"

[[ Still pretty bad.  I've changed the header so that the return address
you listed in your message appears there.  But the one that I received was
still a jumble of quotes, percents, double colons, underbars, and an
occasional backslash.  --wnl ]]

------------------------------

End of SUN-Spots Digest
***********************



More information about the Comp.sys.sun mailing list