Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Infinite loop or memory corruption with zparseopts
- X-seq: zsh-workers 52430
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Infinite loop or memory corruption with zparseopts
- Date: Sun, 24 Dec 2023 10:43:28 -0800
- Archived-at: <https://zsh.org/workers/52430>
- List-id: <zsh-workers.zsh.org>
% zparseopts -a argv -D x
==871924== Invalid read of size 8
==871924== at 0x1DD378: arrlen (utils.c:2311)
==871924== by 0x1E293E: zarrdup (utils.c:4471)
==871924== by 0x215A8E: bin_zparseopts (zutil.c:2016)
==871924== by 0x12BE5C: execbuiltin (builtin.c:506)
==871924== by 0x157197: execcmd_exec (exec.c:4191)
==871924== by 0x150797: execpline2 (exec.c:2003)
==871924== by 0x14F31E: execpline (exec.c:1728)
==871924== by 0x14E574: execlist (exec.c:1482)
==871924== by 0x14DBA2: execode (exec.c:1263)
==871924== by 0x1759ED: loop (init.c:212)
==871924== by 0x17AAAE: zsh_main (init.c:1928)
==871924== by 0x12AEEC: main (main.c:93)
==871924== Address 0x4cdc960 is 0 bytes inside a block of size 8 free'd
==871924== at 0x483CA3F: free (in
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==871924== by 0x1E18B0: freearray (utils.c:4063)
==871924== by 0x1A779F: arrvarsetfn (params.c:4183)
==871924== by 0x1A2B5F: setarrvalue (params.c:2858)
==871924== by 0x1A59DD: assignaparam (params.c:3507)
==871924== by 0x1A5B80: setaparam (params.c:3517)
==871924== by 0x21575E: bin_zparseopts (zutil.c:1972)
==871924== by 0x12BE5C: execbuiltin (builtin.c:506)
==871924== by 0x157197: execcmd_exec (exec.c:4191)
==871924== by 0x150797: execpline2 (exec.c:2003)
==871924== by 0x14F31E: execpline (exec.c:1728)
==871924== by 0x14E574: execlist (exec.c:1482)
==871924== Block was alloc'd at
==871924== at 0x483B7F3: malloc (in
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==871924== by 0x192853: zalloc (mem.c:966)
==871924== by 0x192A04: zshcalloc (mem.c:979)
==871924== by 0x175FC9: parseargs (init.c:308)
==871924== by 0x17A9DD: zsh_main (init.c:1894)
==871924== by 0x12AEEC: main (main.c:93)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author