zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Julien Nicoulaud <julien.nicoulaud@gmail.com>
Cc: John Ramsden <ramsdenj@riseup.net>,
	Mailing-list zsh-workers <zsh-workers@zsh.org>
Subject: Re: Bug - invalid pointer
Date: Sat, 14 Apr 2018 12:34:27 -0700	[thread overview]
Message-ID: <CAH+w=7bTg1JrO=KYQmcobWL+EW_WxioWxD1cuS0aWRYb1bjmSQ@mail.gmail.com> (raw)
In-Reply-To: <CA+mcLN7EkzRcQFGfcxsE67ZooT_mcwg23=O7kBngCPyaVhjsCw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2075 bytes --]

On Sat, Apr 14, 2018 at 3:20 AM, Julien Nicoulaud <
julien.nicoulaud@gmail.com> 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;
     }

  reply	other threads:[~2018-04-14 19:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-14  2:00 John Ramsden
2018-04-14  2:16 ` Bart Schaefer
2018-04-14  3:19   ` John Ramsden
2018-04-14  3:57     ` Bart Schaefer
2018-04-14  5:34       ` John Ramsden
2018-04-14 10:20         ` Julien Nicoulaud
2018-04-14 19:34           ` Bart Schaefer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-04-13 21:56 John Ramsden
2018-04-14  1:29 ` Bart Schaefer
2018-04-14  1:43   ` John Ramsden
2018-04-14  1:57     ` Bart Schaefer

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='CAH+w=7bTg1JrO=KYQmcobWL+EW_WxioWxD1cuS0aWRYb1bjmSQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=julien.nicoulaud@gmail.com \
    --cc=ramsdenj@riseup.net \
    --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).