zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: "crash: free invalid next size (fast)" on completion
Date: Fri, 1 Apr 2022 02:17:38 +0900	[thread overview]
Message-ID: <6DC4B058-93E4-433F-AD8B-C2C8EB06E4DA@kba.biglobe.ne.jp> (raw)
In-Reply-To: <1950010726.626226.1648118876781@mail2.virginmedia.com>


> 2022/03/24 19:47, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> 
>> On 24 March 2022 at 10:12 Johan Ström <johan@stromnet.se> wrote:
>> 
>> 1. Execute ls
>> 2. Use up-arrow, triggers warning:
>>  ==2157023== Invalid read of size 32
>> ==2157023==    at 0x4B7709D: __wmemcmp_avx2_movbe (in /usr/lib/libc.so.6)
>> ==2157023==    by 0x5863FDC: mkundoent (in /usr/lib/zsh/5.8.1/zsh/zle.so)
>> ...
>> ==2157023==  Address 0x5c2de50 is 0 bytes inside a block of size 8 alloc'd
>> ==2157023==    at 0x484ACD3: realloc (in 
>> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
>> ==2157023==    by 0x586404F: setlastline (in /usr/lib/zsh/5.8.1/zsh/zle.so)

I can reproduce this on the latest Arch (glibc-2.35) and Fedora-35 (glibc-2.34),
but not on Fedora-34 (glibc-2.33) or Ubuntu-20.04 (glibc-2.31).

> From circumstantial evidence, I'm guessing that might go away with the following?

No, valgrind still reports it on Arch and Fedora-35.
But I think this is a false positive and we can ignore it.

If I run the following program under valgrind (on Arch/Fedora-35), I get
the same 'Invalid read of size 32' error. I've sent a bug report to valgrind
bug tracker, but haven't got any response yet.

#include <stdlib.h>
#include <wchar.h>
int main()  {
    wchar_t *a, *b;
    int ret;
    a = (wchar_t*)calloc(3, sizeof(wchar_t));
    b = (wchar_t*)calloc(3, sizeof(wchar_t));
    ret = wmemcmp(a, b, 2);
    free(a);
    free(b);
    return ret;
}

  reply	other threads:[~2022-03-31 17:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <df2ea61b-d0ea-ba95-98e0-d0fe84b800d0@stromnet.se>
     [not found] ` <CAH+w=7Yn_jyvHiOtpMAmq8rFESM16LgEdzgGx7t0E+c2ctS1fg@mail.gmail.com>
2022-03-24  7:31   ` Johan Ström
2022-03-24  9:58     ` Peter Stephenson
2022-03-24 10:12       ` Johan Ström
2022-03-24 10:47         ` Peter Stephenson
2022-03-31 17:17           ` Jun. T [this message]
2022-03-31 22:07             ` 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=6DC4B058-93E4-433F-AD8B-C2C8EB06E4DA@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --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).