Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug - invalid pointer
- X-seq: zsh-workers 42650
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Julien Nicoulaud <julien.nicoulaud@xxxxxxxxx>
- Subject: Re: Bug - invalid pointer
- Date: Sat, 14 Apr 2018 12:34:27 -0700
- Cc: John Ramsden <ramsdenj@xxxxxxxxxx>, Mailing-list zsh-workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tni27UzRl6LAm/x0nkZGdagyM309jy8XPR3rGQBFm2s=; b=cmjY7MAvM1IzBw6mFNPVNxtwADpYXxKWYC8iShFM7++rWexqUA9Uq6B1agYQO74c8q 4q2mn16NmIMxxLS5AzC0D0imR2So9ULHbf2nTK53Bc71zKMKiBOGEnI9S9hW9RIZ8JTA CjLkKiQm2Y3Q40WYLcqnq+fh5bPqSxQ4UhVmTxrwR8FYbpMcvQCy9wCtmy+Hv4VzGnNb IZhkTj1wmM5e9Fk7BTgmyW6DwAdEYLjPRwuZo3k3HbCXAAB1JDNHPdG5Uo6IOzoOGRdH gbe1DuuppdL60LeUXDmtkALm3x3OknQyMNzhAPbBGNdA0EqozYSwMOCTA1xCTBvEccFL JMrA==
- In-reply-to: <CA+mcLN7EkzRcQFGfcxsE67ZooT_mcwg23=O7kBngCPyaVhjsCw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1523671201.1300523.1337561832.23CF134B@webmail.messagingengine.com> <CAH+w=7b7N7RZFjnt1o8ZmyDHbW9pAZOg0XjnqKS9Vk=9AJ11ow@mail.gmail.com> <674768.793a8c04885b44ab8262babac1a6cd3574623e36@popretr.messagingengine.com> <1523675973.2014280.1337599104.39812D5F@webmail.messagingengine.com> <CAH+w=7aLDRSPr2ag8a2sVG_NiTLdjoytEwy5_65uN+_OghFC+w@mail.gmail.com> <674768.2c957faa3a879a4aca32e4da95aaa067ac459a04@popretr.messagingengine.com> <1523684099.3421841.1337658008.1438CC79@webmail.messagingengine.com> <CA+mcLN7EkzRcQFGfcxsE67ZooT_mcwg23=O7kBngCPyaVhjsCw@mail.gmail.com>
On Sat, Apr 14, 2018 at 3:20 AM, Julien Nicoulaud <
julien.nicoulaud@xxxxxxxxx> wrote:
>
> I bisected it and I think it was introduced by commit 5f6a52c06:
> https://github.com/zsh-users/zsh/commit/5f6a52c06
>
> Hope this helps!
Yes, indeed. From that commit:
> diff --git a/Src/utils.c b/Src/utils.c
>> index 4c0ebe6..74fdac3 100644
>> --- a/Src/utils.c
>> +++ b/Src/utils.c
>> @@ -1832,7 +1832,7 @@ adjustlines(int signalled)
>> else
>> shttyinfo.winsize.ws_row = zterm_lines;
>> #endif /* TIOCGWINSZ */
>> - if (zterm_lines <= 0) {
>> + if (zterm_lines < 0) {
>> DPUTS(signalled, "BUG: Impossible TIOCGWINSZ rows");
>> zterm_lines = tclines > 0 ? tclines : 24;
>> }
>> @@ -1856,7 +1856,7 @@ adjustcolumns(int signalled)
>> else
>> shttyinfo.winsize.ws_col = zterm_columns;
>> #endif /* TIOCGWINSZ */
>> - if (zterm_columns <= 0) {
>> + if (zterm_columns < 0) {
>> DPUTS(signalled, "BUG: Impossible TIOCGWINSZ cols");
>> zterm_columns = tccolumns > 0 ? tccolumns : 80;
>> }
>>
>
That's obviously doing more (or rather less) than it was meant to, the only
intention was to silence the DPUTS().
diff --git a/Src/utils.c b/Src/utils.c
index 180693d..b418517 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1834,8 +1834,9 @@ adjustlines(int signalled)
else
shttyinfo.winsize.ws_row = zterm_lines;
#endif /* TIOCGWINSZ */
- if (zterm_lines < 0) {
- DPUTS(signalled, "BUG: Impossible TIOCGWINSZ rows");
+ if (zterm_lines <= 0) {
+ DPUTS(signalled && zterm_lines < 0,
+ "BUG: Impossible TIOCGWINSZ rows");
zterm_lines = tclines > 0 ? tclines : 24;
}
@@ -1858,8 +1859,9 @@ adjustcolumns(int signalled)
else
shttyinfo.winsize.ws_col = zterm_columns;
#endif /* TIOCGWINSZ */
- if (zterm_columns < 0) {
- DPUTS(signalled, "BUG: Impossible TIOCGWINSZ cols");
+ if (zterm_columns <= 0) {
+ DPUTS(signalled && zterm_columns < 0,
+ "BUG: Impossible TIOCGWINSZ cols");
zterm_columns = tccolumns > 0 ? tccolumns : 80;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author