Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:in-reply-to:comments:references:to:subject
         :mime-version:content-type;
        bh=1NHJPyaXS8APaNP7M32SMbLlKCQ2ItM0i4Bwof+Nlf4=;
        b=onkg47DTZknOoR8sY3Oskwv2op8Fk4w/LXdWwBYqjRVW38IGmH1bNCvb66/ZgMgG8E
         00yVvFO5FaN0JIE7Wr7jAFFc6jgDzGwBxhF+1vZni5J7GFHWnPPRmo6UPMC/S0gOQtVw
         MT7+S9cfeNSDUoSJ+5Ch2rwMhQkftQAfE8nAWurPcdy5L8OTkBTJcWdwpVnV9DqvFxkX
         rRbdIzk129Szi21HKFm0CXHhi6leKiQlE4tx/Cnj6xR5eYsicEOwKyQalXVVrlQONHwk
         nblrMUHoPFvQ2p0f7CgpwHATYngXbcg2R9PuGelMQB8xCdrG8J1nA0+jDcKbjOSghiwI
         Giag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:mime-version:content-type;
        bh=1NHJPyaXS8APaNP7M32SMbLlKCQ2ItM0i4Bwof+Nlf4=;
        b=dktsRh2BtvXiorXYIkDRVllXhSBrEFsMQyF1nK1+xTD7+ta+9fYNEpNCmblqRw1ZhI
         eLAbIOuMUeHbvdo0WxnVQX3/yiEGJjL3d0MYJ4yq3LCcP32Y4Y1qNpjcil18RGocNIfX
         MfSIRfZkjRNHv+0BRGBuxMmdP9FVL4nBV8ktjonXxXQH5jTDv0M94loaZgWTSRV+TEJk
         8Z5RpKwufC+JhhPdTHzPcoW3taTF+vTk7w38c2s19kugnkcL4XrIctF4StF++4J8IdUl
         WEusynwA4Wom7BlVs+ZYddp0TQL395/mPAKBhyBYRA7cxAe7fGytQX8XLfyQweJ12FTJ
         rxJw==
X-Gm-Message-State: AG10YOQ+A4nFXMAX4RgIM9hn1Ju3Qak7S9SJYEsXQJkLxoWb2v1+hmXGhrDqHirkM+p4kw==
X-Received: by 10.66.141.142 with SMTP id ro14mr909588pab.112.1455272252183;
        Fri, 12 Feb 2016 02:17:32 -0800 (PST)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160212021738.ZM12847@torch.brasslantern.com>
Date: Fri, 12 Feb 2016 02:17:38 -0800
In-Reply-To: <20160211124948.278fb707@pwslap01u.europe.root.pri>
Comments: In reply to Peter Stephenson <p.stephenson@samsung.com>
        "Re: Segfault on completion with interactive mode" (Feb 11, 12:49pm)
References: <CAPdr91afVtwZnv3o9FKqfgMeYg_1Tz9R-ujTVhJUwu4ErNtFng@mail.gmail.com> 
	<160210200147.ZM8455@torch.brasslantern.com> 
	<20160211124948.278fb707@pwslap01u.europe.root.pri>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh-workers@zsh.org
Subject: Re: Segfault on completion with interactive mode
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 37954

On Feb 11, 12:49pm, Peter Stephenson wrote:
} Subject: Re: Segfault on completion with interactive mode
}
} What I saw when I tried this was a crash in singledraw() because
} mgtab[0] was 1, suggesting it as a "marked" null pointer.  So presumably
} this state is incompatible with state required when we call
} singledraw(),

Yes, I saw that as well.

} This appears to be a lot later than anything you're talking about.
 
The long description in my previous message was the result of several
(dozen) passes trying to track down WHY we arrive in singledraw() with
mgtab[0] = 1 in the case of

    zstyle ':completion:*:warnings' format '%BNo matching %b%d'

when the analogous case WITHOUT that style works exactly as designed.

The answer to "why?" appears to be that "compadd -x" has clobbered the
completion groups when displaying the warning.  Thus I believe that we
somehow need to save and restore state around the "compadd -x".  The
right place to do that seems to be in domenuselect() in the branch
that uses showinglist = -2, because it's that call to zrefresh() that
ultimately calls the hookdef that eventually does the "compadd -x".

