Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Crash with virtualenvwrapper_lazy.sh



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.



Messages sorted by: Reverse Date, Date, Thread, Author