Re: Set -o Vi Causes core dump and segmentation fault



UKnicks wrote:
On Sep 4, 2:15 pm, Johnny Rebel <rebel...@xxxxxxxxxxxx> wrote:
1PW wrote:
On 09/03/2008 04:19 PM, Johnny Rebel sent:
Johnny Rebel wrote:
UKnicks wrote:
ALL:
We use a build and customization (B&C) process (a bunch of
scripts) to rebuild boxes after we've installed RHEL5. I believe, not
completely sure, some kernel changes are made. Problem is after we
run our B&C and try to issue a set -o vi command it causes a
segmentation fault and a core dump.
[ I just tried this myself.. I logged onto a remote box... issued a
set -o vi command and nothing happened. The next command I typed,
"ls", caused the box to kick me out. I returned to the same directory
and found a core file]
Testers have reported this doesn't occur before the B&C process. Any
ideas?
I apologize if I've left out any pertinent information. I'll try to
repost it as soon as requested.
Thanx
'set' is internal to the shell I believe - missing dependancy maybe?
`ldd /bin/ksh` ? Maybe try an strace|ptrace to see where it is
yacking... Run the ptrace on echo $$ and see if you can get anything in
a log file somewhere... Just throwing some ideas out.
JR.
Just thinking as well - vi is an alias for vim on Linux, and alias is
also an internal command. Maybe there is an issue with this somewhere?
JR.
Good theories JR. Maybe we'll get more information later on Thursday.
Thanks! Although some people get an icky feeling using the trace
family. :) Here is hoping the issue gets resolved!

JR.

--

Bill will have to take Linux from my cold, dead flippers.

-Tux.



OK! After a day of divide and conquer on 18 scripts we have figured
out who/what the culprit is: Apparently, if your subshell editor is
different from the parent shell's editor it causes this segmentation
fault. The offending line was : export EDITOR=emacs in our /etc/
profile. Our parent shell is bash and the editor is set (by /etc/
profile) as emacs... If you then spawn a ksh subshell ,run set -o vi,
and then type any command it causes the segmentation fault. However if
the parent shell's editor (The bash shell) is set to VI , or is unset
it doesn't cause the error. NO idea why this causes the problem as
we've had this line in our /etc/profile for YEARS now.


Very cool. Glad you have it fixed, and posted back. How come you are
using ksh on Linux anyways? I personally go the other way and put bash
on all Unix systems. That way, most of the things that get changed are
truly bugs/OS features between different flavours. Plus ksh on Unix
systems don't come with source code making it difficult to fix anything.
Just curious why the ksh?

JR.


--

Bill will have to take Linux from my cold, dead flippers.

-Tux.
.



Relevant Pages

  • Re: Set -o Vi Causes core dump and segmentation fault
    ... set -o vi command and nothing happened. ... different from the parent shell's editor it causes this segmentation ... Our parent shell is bash and the editor is set (by /etc/ ... If you then spawn a ksh subshell,run set -o vi, ...
    (linux.redhat)
  • Re: Set -o Vi Causes core dump and segmentation fault
    ... some kernel changes are made. ... set -o vi command and nothing happened. ... different from the parent shell's editor it causes this segmentation ... If you then spawn a ksh subshell,run set -o vi, ...
    (linux.redhat)
  • Re: Beginners questions (tcsh) 1. set histdup 2. ??
    ... > learn two shells, one for interactive, and one for scripting. ... What do you do in your scripts which is the ... SAME as what you do on the command line? ... far more comfortable than those of zsh, bash or ksh. ...
    (comp.unix.shell)
  • Re: Set -o Vi Causes core dump and segmentation fault
    ... set -o vi command and nothing happened. ... After a day of divide and conquer on 18 scripts we have figured ... different from the parent shell's editor it causes this segmentation ... Our parent shell is bash and the editor is set (by /etc/ ...
    (linux.redhat)
  • Re: Beginners questions (tcsh) 1. set histdup 2. ??
    ... >> learn two shells, one for interactive, and one for scripting. ... What do you do in your scripts which is the ... > SAME as what you do on the command line? ... > far more comfortable than those of zsh, bash or ksh. ...
    (comp.unix.shell)