Bug 1344599

Summary: zsh crash during line completion
Product: Red Hat Enterprise Linux 7 Reporter: Marko Myllynen <myllynen>
Component: zshAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Jan Kepler <jkejda>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: jkejda, myllynen, thozza
Target Milestone: rcKeywords: OtherQA, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: zsh-5.0.2-24.el7 Doc Type: If docs needed, set a value
Doc Text:
Needless to document.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 23:03:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marko Myllynen 2016-06-10 07:11:09 UTC
Description of problem:
When testing some completions, zsh crashed. I managed to reproduce it a few times with the RHEL 7 build but never with the latest upstream code so perhaps it's fixed in upstream already.

I'm adding a (private) attachment, the core dump gzipped.

Version-Release number of selected component (if applicable):
zsh-5.0.2-22.el7.x86_64

Comment 3 Kamil Dudka 2016-06-10 10:37:01 UTC
I believe the following off-by-one error fixes would prevent the crash:

https://sourceforge.net/p/zsh/code/ci/844e569b
https://sourceforge.net/p/zsh/code/ci/61deff76

Unfortunately, the interesting values of local variables have been optimized out in your core dump.  Are you able to verify that the above fixes make the problem go away?

Comment 4 Marko Myllynen 2016-06-10 11:03:50 UTC
(In reply to Kamil Dudka from comment #3)
> I believe the following off-by-one error fixes would prevent the crash:
> 
> https://sourceforge.net/p/zsh/code/ci/844e569b
> https://sourceforge.net/p/zsh/code/ci/61deff76
> 
> Unfortunately, the interesting values of local variables have been optimized
> out in your core dump.  Are you able to verify that the above fixes make the
> problem go away?

With zsh-5.0.2-23.el7.x86_64 and those patches I can't reproduce the crash anymore.

Thanks!

Comment 5 Kamil Dudka 2016-06-10 11:31:45 UTC
Thanks for confirmation!  It would be good to have reliable steps to reproduce for QE to create an automatic regression test for this ... but I guess it will not be so easy?

Comment 6 Marko Myllynen 2016-06-10 11:45:32 UTC
(In reply to Kamil Dudka from comment #5)
> Thanks for confirmation!  It would be good to have reliable steps to
> reproduce for QE to create an automatic regression test for this ... but I
> guess it will not be so easy?

Yes, it's a bit tricky, I used PCP upstream zsh completions (merged last night):

http://oss.sgi.com/cgi-bin/gitweb.cgi?p=pcp/pcp.git;a=blob;f=src/zshrc/_pcp

And then basically went thru the list of PCP commands (atop collectl dmcache free iostat ipcs lvmcache numastat shping summary uptime verify) when testing the completions, something like:

$ pcp atop <TAB>^W^W
$ pcp collectl <TAB>^W^W
$ pcp dmcache <TAB>^W^W

Seems that starting from end of the list of commands (i.e., verify) and going backwards it pretty reliably crashes around iostat or free (but then sometimes earlier, sometimes later).

Thanks.

Comment 14 errata-xmlrpc 2016-11-03 23:03:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2152.html