[comp.unix.wizards] vi dumping core

hans@duttnph.tudelft.nl (Hans Buurman) (08/08/89)

Has anyone seen the following problem ?

(Running SunOs 4.0.1 export on a Sun 4)

If something very unclear has changed in your environment, vi dumps
core on an illegal instruction. This reproduces faithfully, until
you change something else, like setting or unsetting TERMCAP.
Last time this started to happen, I had just changed HACKOPTIONS
into NETHACKOPTIONS.

I reported the bug to Sun in March, when I had just found out I
could get around it by changing TERMCAP. They inquired after my
vt100 for a while and nothing was heard of it since. I'm not sure
whether the problem is Sun-specific though.

Has anyone else seen this ?

	Hans

-----------------------------------------------------------------------------
Hans Buurman                   | hans@duttnph.tudelft.nl
Pattern Recognition Group      | hans@duttnph.UUCP
Faculty of Applied Physics     | mcvax!hp4nl!dutrun!duttnph!hans
Delft University of Technology | tel. 31 - (0) 15 - 78 46 94

hans@duttnph.tudelft.nl (Hans Buurman) (08/15/89)

Two weeks ago I asked if anybody had seen vi dumping core (illegal
instruction) on a Sun4 running SunOs 4.0. The problem seems to be
related to the size of your environment. Below is a summary of the
responses I got. Also enclosed is an excerpt from the Sun bugs data-
base here at Delft University, showing that the bug has been known
to Sun for about a year, but has not been solved yet.

Apparently this information was not available to the Sun engineer
who answered my bug report last March. No wonder they haven't found
the bug yet !

	Hans

Disclaimer: any opinion expressed by me is my own, and not that of
Delft University. Disclaimers of the people below have been deleted
by me.
===============================================================================
From: fletcher@cs.utexas.edu (Fletcher Mattox)

I've seen it here too.  4.0 on a sparc.  Last time I looked at
it, it seemed related to the size of the environment.  Anything
above 1400 bytes ( printenv | wc ) would cause vi to drop core.
I don't have sources, so I couldn't look closer.  If you solve
this, please let me know.

Fletcher
===============================================================================
From: Daniel J. Bernstein <bernstei@hpuxa.ircc.ohio-state.edu>

See whether your environment is very close to an interesting
number of characters long (like 1024). See if you can change
between dumping and not dumping by adding characters to a
random environment variable. Complain fiercely to Sun.
===============================================================================
From: David Trueman <david@cs.dal.ca>

Yes, we have seen your problem.  It also was directory specific for
us (perhaps current directory in the environment).
===============================================================================
From: glenn@mathcs.emory.edu (Glenn Barry)

Hi hans, we've been seeing that exact problem on a sun4/280 on
4.0.1 and 4.0.3 ... i thought it was something funky in our
shared lib libc (we made some mods) that was causing the problem
because i had not heard anyone else (until you) complain about
it.

I too get around it by unsetting $TERMCAP.

do you have a bug number on it and/or any news from sun
since you posted the article to USENET?  Has anybody else
told you they have seen it?
===============================================================================
From: flee@shire.cs.psu.edu (Felix Lee)

Yes, I reported this August last year.  vi dumps core when the length
of your environment + the length of the arguments passed to vi is
something like 1750 characters long.  There's a range of failure of
around 50 characters.  And there are also other ranges of failure,
probably in some trivial arithmetic sequence.

I got a response back that said the problem had been reported
previously, but noone had looked into it yet.  I don't know if it's
been solved yet.
===============================================================================
From: dutrun.uucp!servio!penneyj@uunet.UU.NET (D. Jason Penney)

Yes, and the symptoms are quite similar -- just playing with your
environment table makes the problem go away.

Good luck getting Sun to fix it -- they still can't get a Bourne shell
to work properly (it dies when you define too many environment variables),
and I consider this problem to be trivial by comparison.
===============================================================================
From: the Sun bugs database

 Product:  sunos
 Category:  utility
 Subcategory:  editor
 Release summary: 4.0
 Bug/Rfe:  bug
 State:  dispatched
 Synopsis:  vi core dumps with illegal instruction
 Keywords:  sigill, vi, core, dumps, illegal
 Severity:  2
 Priority:  2
 Description:
      On a very frequent basis, /usr/ucb/vi dies with an illegal
      instruction.  This cannot be made to occur at will, but once
      it begins to occur, it persists until reboot.
      Recompiling vi statically and/or with -g removes the problem.
      I have only heard of this occurring on 4/260 machines
      with SMD disks running 4.0.
 State triggers:
 Comments:
      [elric] This problem appears to be related to the size
              of the environment.  vi will only crash on my
              machine if the size of the environment (as reported
              by `env | wc -c`) is between 1635 and 1662 (inclusive).
      9/7/88 - dyang
      This is also affecting Penn State on their 4/260.  Here is some
      additional information from the customer (flee@blitz.cs.psu.edu):
      vi dumps core when my environment is around 1750 characters long.
      Here is a script of someone else's session:
              Script started on Wed Aug 31 11:49:45 1988
              shire<1>% setenv X abcd
              shire<2>% env | wc
                    22      52    1753
              shire<3>% vi
              [everything fine]
              shire<4>% setenv X abcde
              shire<5>% env | wc
                    22      52    1754
              shire<6>% vi
              Illegal instruction (core dumped)
              shire<7>% exit
              shire<8>% 
              script done on Wed Aug 31 11:50:08 1988
 The range of failure is about 50 characters.  Longer and shorter
      environments work fine.  The location of the range depends on
      random unknown factors, but seems to be consistent for each csh.
      The failure actually depends on the length of the environment
      plus the length of the arguments passed to vi.
      Using ex <NM> and then saying "open" or "vi" works as long as you're
      editing a file.  Running ex with no arguments and then saying
      "open" or "vi" will fail.
      12-14-88 stanton
      Would you like a core file from an occurrance?  If I don't hear soon,
      I'll remove my core file.
      Wed Dec 14 11:31:27 PST 1988 lemke
      i can produce numerous cores if that will help.  i can sometimes
      work around the problem by changing the length of my environment,
      but that doesn't always cut it when vi is executed from another 
      program.
 History:
    
      Release: 4.0
      Hardware version: sun4
    
      Release: 4.0
      Hardware version: sun4
    
      Release: 4.0
      Hardware version: sun4
    
      Release: 4.0
      Hardware version: sun4
    
      Release: 4.0
      Hardware version: sun4
    
      Release: 4.0
      Hardware version: sun3
 Bug End:


-- 
-----------------------------------------------------------------------------
Hans Buurman                   | hans@duttnph.tudelft.nl
Pattern Recognition Group      | hans@duttnph.UUCP
Faculty of Applied Physics     | mcvax!hp4nl!dutrun!duttnph!hans
Delft University of Technology | tel. 31 - (0) 15 - 78 46 94