Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening new interactive shell results in recursion, segfault 11 #463

Closed
ncs-msmith opened this issue Jul 27, 2016 · 6 comments
Closed

Opening new interactive shell results in recursion, segfault 11 #463

ncs-msmith opened this issue Jul 27, 2016 · 6 comments
Labels
wontfix A bug report that is rejected because the fix should be external

Comments

@ncs-msmith
Copy link
Contributor

ncs-msmith commented Jul 27, 2016

Shell: bash
Operating system: OSX 10.11.6
Liquid Prompt version (tag, commit): 488bb59

Opening a new interactive shell from a shell with liquidprompt enabled results in recursion, and fails with segfault 11. Unsetting PROMPT_COMMAND and launching an interactive shell works fine.

[foobar:~] $ export | grep PROMPT
declare -x PROMPT_COMMAND="_lp_set_prompt"
[foobar:~] $ bash -l
Segmentation fault: 11
[foobar:~] 139 $ export PROMPT_COMMAND=""
[foobar:~] 139 $ bash -l
[foobar:~] $ echo "yay no more error"
yay no more error
[foobar:~] $ exit
logout
[foobar:~] 139 $

Some of the output with set -x enabled in liquidprompt:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ _lp_set_prompt
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local -i err=0
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((  err != 0  ))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LP_ERR=
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local 'IFS=
'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local GREP_OPTIONS=
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ eval '_lp_set_prompt
history -a; history -c; history -r'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ _lp_set_prompt
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local -i err=0
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((  err != 0  ))
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LP_ERR=
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local 'IFS=
'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local GREP_OPTIONS=
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ eval '_lp_set_prompt
history -a; history -c; history -r'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ _lp_set_prompt
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local -i err=0
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((  err != 0  ))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LP_ERR=
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local 'IFS=
'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ local GREP_OPTIONS=
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ eval '_lp_set_prompt
history -a; history -c; history -r'

In my case I am sourcing liquidprompt when the shell is interactive:

[[ $- = *i* ]] && source ~/liquidprompt/liquidprompt
@ncs-msmith
Copy link
Contributor Author

proposed fix: #464

@dolmen
Copy link
Collaborator

dolmen commented Jul 29, 2016

PROMPT_COMMAND is NOT exported by LiquidPrompt.
If this variable finishes exported it a bug somewhere else in your .bash_profile/.bashrc.

@dolmen dolmen added the wontfix A bug report that is rejected because the fix should be external label Jul 29, 2016
@dolmen
Copy link
Collaborator

dolmen commented Jul 29, 2016

Same issue as #450.

@dolmen
Copy link
Collaborator

dolmen commented Aug 31, 2016

@ncs-msmith Have you verified that your issue is similar to #450?

@dolmen
Copy link
Collaborator

dolmen commented Sep 17, 2016

@ncs-msmith Ping

@ncs-msmith
Copy link
Contributor Author

Yep, you were correct, same as #450. Thanks!

dolmen added a commit that referenced this issue Sep 23, 2016
Some users have a broken .bashrc that exports PROMPT_COMMAND. In this
configuration _lp_set_prompt is in PROMPT_COMMAND when liquidprompt starts so
prompt_on puts it in LP_OLD_PROMPT_COMMAND. This leads to a infinite
recursion as _lp_set_prompt runs $LP_OLD_PROMPT_COMMAND.

To work around those broken environments we now fix the environment by
unexporting PROMPT_COMMAND.
Gerschtli pushed a commit to Gerschtli/liquidprompt that referenced this issue Oct 27, 2016
Some users have a broken .bashrc that exports PROMPT_COMMAND. In this
configuration _lp_set_prompt is in PROMPT_COMMAND when liquidprompt starts so
prompt_on puts it in LP_OLD_PROMPT_COMMAND. This leads to a infinite
recursion as _lp_set_prompt runs $LP_OLD_PROMPT_COMMAND.

To work around those broken environments we now fix the environment by
unexporting PROMPT_COMMAND.
Gerschtli added a commit to Gerschtli/liquidprompt that referenced this issue Oct 27, 2016
…ed' into feature/calc-cksum-only-if-enabled

* origin/feature/calc-cksum-only-if-enabled:
  Only calculate hash for ssh host color if option is enabled
  CHANGES: Credit @Rycieos for liquidprompt#461
  LP_COLOR_HOST_HASH: simplify
  Fix computing hostname hash on SunOS
  don't try to unexport PROMPT_COMMAND on bash < 4.2 (GH liquidprompt#474)
  Fix LP_ENABLE_FQDN regression: s/_LP_HOST_SYMBOL/LP_HOST_SYMBOL/ GH liquidprompt#472
  unexport PROMPT_COMMAND (GH liquidprompt#450, liquidprompt#463)
  Fix up awk script and make readable
  CHANGES: release 1.11
  ISSUE_TEMPLATE: request shell name
Gerschtli added a commit to Gerschtli/liquidprompt that referenced this issue Oct 27, 2016
…only-if-enabled

* origin/master:
  CHANGES: Credit @Rycieos for liquidprompt#461
  LP_COLOR_HOST_HASH: simplify
  Fix computing hostname hash on SunOS
  don't try to unexport PROMPT_COMMAND on bash < 4.2 (GH liquidprompt#474)
  Fix LP_ENABLE_FQDN regression: s/_LP_HOST_SYMBOL/LP_HOST_SYMBOL/ GH liquidprompt#472
  unexport PROMPT_COMMAND (GH liquidprompt#450, liquidprompt#463)
  Fix up awk script and make readable
  CHANGES: release 1.11
  ISSUE_TEMPLATE: request shell name

Conflicts:
	liquidprompt
pkkolos pushed a commit to pkkolos/liquidprompt that referenced this issue Nov 21, 2016
Some users have a broken .bashrc that exports PROMPT_COMMAND. In this
configuration _lp_set_prompt is in PROMPT_COMMAND when liquidprompt starts so
prompt_on puts it in LP_OLD_PROMPT_COMMAND. This leads to a infinite
recursion as _lp_set_prompt runs $LP_OLD_PROMPT_COMMAND.

To work around those broken environments we now fix the environment by
unexporting PROMPT_COMMAND.
jpluimers pushed a commit to jpluimers/liquidprompt that referenced this issue Jan 7, 2017
Some users have a broken .bashrc that exports PROMPT_COMMAND. In this
configuration _lp_set_prompt is in PROMPT_COMMAND when liquidprompt starts so
prompt_on puts it in LP_OLD_PROMPT_COMMAND. This leads to a infinite
recursion as _lp_set_prompt runs $LP_OLD_PROMPT_COMMAND.

To work around those broken environments we now fix the environment by
unexporting PROMPT_COMMAND.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix A bug report that is rejected because the fix should be external
Projects
None yet
Development

No branches or pull requests

2 participants