[comp.unix.i386] Accumulating <defunct> children in vi

tneff@bfmny0.BFM.COM (Tom Neff) (08/21/90)

In article <269@happym.wa.com> irv@happym.wa.com (Irving Wolfe) writes:
>I frequently pipe a paragraph out from vi when I'm writing to a reformatter we
>wrote that adjusts the line lengths and fixes word spacing when possible.
>This has always worked fine.
>
>Tonight I was doing it and after awhile the system ate my text and replaced it
>with "No more processes."  ...

Right.  Nothing specific to SCO UNIX about that.  It's a bug in the
editor -- it doesn't close its pipes properly, so every buffer-filter
operation leaves a defunct process.  The only solution is to close your
file and exit the editor now and then.

If you run into the problem a lot and have the luxury of administering
your own system, you can raise NPROCS a little to give yourself some
breathing room.

-- 
The most common given name in the world is Mohammad; | Tom Neff 
the most common family name in the world is Chang.   |
Can you imagine the enormous number of people in the | tneff@bfmny0.BFM.COM
world named Mohammad Chang? -- Derek Wills           | uunet!bfmny0!tneff

rcd@ico.isc.com (Dick Dunn) (08/22/90)

irv@happym.wa.com (Irving Wolfe) writes:
> I frequently pipe a paragraph out from vi...
...
> Tonight I was doing it and after awhile the system ate my text and replaced it
> with "No more processes."...
...
> ...I had about 20
> <defunct> children of my vi process hanging around.  When I exited vi again,
> they all disappeared...

1.  This doesn't seem specific to SCO; apparently it's in the release
version of vi for V.3.2/386.

2.  (To Irving's later question) No, it's not related to the directory you
were in.

3.  The problem is caused by vi not doing a wait() for the filter
processes.  I don't know whether it's in vi _per_se_ or in some library
code, but a <defunct> process (a "zombie") means it's terminated but the
parent hasn't acknowledged it.

4.  To work around the problem, escape out of vi with :sh, then drop back
in.  Vi has to wait for the shell; in the process of doing so it reaps all
the other zombies.
-- 
Dick Dunn     rcd@ico.isc.com -or- ico!rcd       Boulder, CO   (303)449-2870
   ...Are you making this up as you go along?

irv@happym.wa.com (Irving Wolfe) (08/22/90)

In <269@happym.wa.com> I wrote:

>I frequently pipe a paragraph out from vi when I'm writing to a reformatter 
>...
>after awhile the system ate my text and replaced it with "No more processes."

I've already gotten two mailed replies telling me that this is a "known bug"
in vi.  Funny, it wasn't there in my Motorola UNIX V.2.  

According to one of the responders, ":shell" every once in a while would get 
rid of the <defunct> processes without my having to exit from vi.  I have not 
tried this yet.  

Thanks, responders, and unless you have something different to say, I consider
the question answered.
-- 
 Irving Wolfe    Happy Man Corp.   irv@happym.wa.com    206/463-9399 ext.101
 4410 SW Point Robinson Road,  Vashon Island, WA  98070-7399     fax ext.116
 SOLID VALUE, the investment letter for Benj. Graham's intelligent investors
Information free (sample $10 check or credit card): email patty@happym.wa.com