Running bash does "segmentation fault core dumped"

user101289

I rebooted recently, and now terminal fails to work. If I click the terminal shortcut or use Guake or ctrl-alt-T, the terminal opens briefly with no prompt, then immediately closes again. I installed xterm as well and the same thing happens.

If I use ctrl-alt-F1 to get to a command line session and type gnome-terminal I get the error message:

Failed to parse arguments: Cannot open display

How can I diagnose and fix this?

EDIT TO ADD .bashrc

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
alias zf=/home/julio/ZendFramework-1.12.3/bin/zf.sh

EDIT 2-- adding .profile:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

export SCALA_HOME=/usr/share/scala
export PATH=$PATH:$SCALA_HOME/bin
source ~/.profile
terdon

This has nothing to do with gnome-terminal, when you hit Ctrl Alt F1, logged in from the virtual console and tried running bash, you got a segmentation fault core dumped which means that bash itself crashes.

Anyway, what's happening is that your bash is entering an infinite loop. When bash first starts, it reads ~/.bashrc (actually, this is a simplification, see here for more details). In your case (and in most if not all Ubuntu versions), the default .bashrc, for reasons that have never been clear to me, sources (reads) ~/.profile as well. Now, your ~/.profile includes this line:

source ~/.profile

The result of that is that bash reads ~/.bashrc => reads ~/.profile => reads ~/.profile => reads ~/.profile => reads ~/.profile etc. This is called an endless loop. Eventually, it freaks out and crashes.

Removing the source ~/.profile line from your ~/.profile should set everything back to normal.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

After some commands, bash prints "Segmentation Fault (core dumped)" for unknown reason

분류에서Dev

python Segmentation fault (core dumped)

분류에서Dev

Runtime Error: Segmentation fault (core dumped)

분류에서Dev

segmentation fault (core dumped) in recursive algorithm

분류에서Dev

Python Interactive mode on Arch Linux "Segmentation fault (core dumped)"

분류에서Dev

getting Segmentation fault (core dumped) when using ffmpeg and specifing start time

분류에서Dev

Deleted my /usr/ directory, recovered with chroot now getting a Segmentation fault (core dumped) trying to run Sudo

분류에서Dev

Node 업그레이드 후 'Segmentation fault (core dumped)'오류가 나타납니다. 어떻게 고칠 수 있습니까?

분류에서Dev

Does running "exec echo some; echo test" in bash never print "some test"?

분류에서Dev

Bash script not running as expected

분류에서Dev

Running a command in a new terminal instance in a bash script

분류에서Dev

Bash update list of running jobs with ps

분류에서Dev

vimrc settings not working on git bash running in ConsoleZ

분류에서Dev

"command not found" when running "lessc" from bash

분류에서Dev

Unable to stat itself when running a bash script

분류에서Dev

Does a bash subshell spawn a new `bash` process?

분류에서Dev

What does ${_[0]} mean in bash?

분류에서Dev

What does ${_[0]} mean in bash?

분류에서Dev

What does ${_[0]} mean in bash?

분류에서Dev

Why does bash link to ncurses?

분류에서Dev

Calling multiple bash scripts and running them in parallel, not in sequence

분류에서Dev

How to setup bash in vscode running in WSL2

분류에서Dev

Running tar in a bash script returns "Output with bankrupt according to previous errors"

분류에서Dev

Running multiple bash functions in the background and waiting until they return

분류에서Dev

warning when running simple shell script in bash for ubuntu on windows

분류에서Dev

Capturing kernel error/stack trace after running a command in bash

분류에서Dev

Simple bash script does not want to start at reboot

분류에서Dev

What does the last "-" (hyphen) mean in options of `bash`?

분류에서Dev

why does the mv command in bash delete files?

Related 관련 기사

  1. 1

    After some commands, bash prints "Segmentation Fault (core dumped)" for unknown reason

  2. 2

    python Segmentation fault (core dumped)

  3. 3

    Runtime Error: Segmentation fault (core dumped)

  4. 4

    segmentation fault (core dumped) in recursive algorithm

  5. 5

    Python Interactive mode on Arch Linux "Segmentation fault (core dumped)"

  6. 6

    getting Segmentation fault (core dumped) when using ffmpeg and specifing start time

  7. 7

    Deleted my /usr/ directory, recovered with chroot now getting a Segmentation fault (core dumped) trying to run Sudo

  8. 8

    Node 업그레이드 후 'Segmentation fault (core dumped)'오류가 나타납니다. 어떻게 고칠 수 있습니까?

  9. 9

    Does running "exec echo some; echo test" in bash never print "some test"?

  10. 10

    Bash script not running as expected

  11. 11

    Running a command in a new terminal instance in a bash script

  12. 12

    Bash update list of running jobs with ps

  13. 13

    vimrc settings not working on git bash running in ConsoleZ

  14. 14

    "command not found" when running "lessc" from bash

  15. 15

    Unable to stat itself when running a bash script

  16. 16

    Does a bash subshell spawn a new `bash` process?

  17. 17

    What does ${_[0]} mean in bash?

  18. 18

    What does ${_[0]} mean in bash?

  19. 19

    What does ${_[0]} mean in bash?

  20. 20

    Why does bash link to ncurses?

  21. 21

    Calling multiple bash scripts and running them in parallel, not in sequence

  22. 22

    How to setup bash in vscode running in WSL2

  23. 23

    Running tar in a bash script returns "Output with bankrupt according to previous errors"

  24. 24

    Running multiple bash functions in the background and waiting until they return

  25. 25

    warning when running simple shell script in bash for ubuntu on windows

  26. 26

    Capturing kernel error/stack trace after running a command in bash

  27. 27

    Simple bash script does not want to start at reboot

  28. 28

    What does the last "-" (hyphen) mean in options of `bash`?

  29. 29

    why does the mv command in bash delete files?

뜨겁다태그

보관