zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Hahler <dhahler@gmail.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Crash with virtualenvwrapper_lazy.sh
Date: Wed, 27 Aug 2014 22:07:43 +0200	[thread overview]
Message-ID: <53FE3A8F.6000905@thequod.de> (raw)

I have noticed a strange crash during completion, when using virtualenvwrapper's [1] lazy setup.

It does not happen when running zsh inside of zsh (SHLVL=2), or when running it inside of gdb, which makes it hard to debug/trace.
It also does not happen with ~/.zshrc moved away.


TEST CASE:

% source virtualenvwrapper_lazy.sh

This will setup:
compctl -K virtualenvwrapper_load workon

% which virtualenvwrapper_load
virtualenvwrapper_load () {
	if [ -z $VIRTUALENVWRAPPER_LAZY_LOADED ]
	then
		source "$VIRTUALENVWRAPPER_SCRIPT"
		VIRTUALENVWRAPPER_LAZY_LOADED=1 
	fi
}

When using TAB after "workon" then, zsh will crash.


I could track it down to the function `mkvirtualenv`, where commenting parts of the function body  won't crash zsh.
I could not pin-point it to a specific line, but e.g. `workon "$envname"` is involved.

This also happens when commenting the `virtualenvwrapper_initialize` function, and therefore $VIRTUALENVWRAPPER_SCRIPT (virtualenvwrapper.sh) gets only parsed/sourced.

The expected behavior would be that zsh won't crash, and another pressing of TAB is required to get the completions (this is expected, because sourcing virtualenvwrapper.sh will setup the correct/final completion for "workon").

This is a problem that has been confirmed multiple times (e.g. in https://github.com/robbyrussell/oh-my-zsh/issues/2355), which makes it likely that some oh-my-zsh setting is involved.

I have tested it with the latest version of Zsh (Git master).

Please let me know if I can provide more information.

Also, any help with debugging this would be appreciated, of course.


virtualenvwrapper source files:
 - virtualenvwrapper_lazy.sh: https://bitbucket.org/dhellmann/virtualenvwrapper/raw/866ef2e9992dbd8df1996fb9e296d8a7ad2cf08c/virtualenvwrapper_lazy.sh
 - virtualenvwrapper.sh: https://bitbucket.org/dhellmann/virtualenvwrapper/raw/866ef2e9992dbd8df1996fb9e296d8a7ad2cf08c/virtualenvwrapper.sh

1: https://bitbucket.org/dhellmann/virtualenvwrapper


Thanks,
Daniel.


                 reply	other threads:[~2014-08-27 20:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53FE3A8F.6000905@thequod.de \
    --to=dhahler@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).