mendex/upmendex と makeindex での空入力に対する挙動の違い

Re: mendex/upmendex と makeindex での挙動の違い

- t tk の投稿
返信数: 1
こちらは、WindowsのWSLの ubuntu (Ubuntu 22.04.2 LTS) です。
お示しになったスクリプトで Segmentation fault は再現しません。

makeindex, mendex, upmendex のversionは以下。

This is makeindex, version 2.15 [TeX Live 2022/dev] (kpathsea + Thai support).
This is mendex version 3.5 [13-Jun-2021] (utf8.uptex) (TeX Live 2022/dev).
This is upmendex version 0.57 [ICU 70.1] (TeX Live 2022/dev).
This is mendex version 3.8 [09-Feb-2025] (utf8.uptex) (TeX Live 2026/dev).
This is upmendex version 1.20 [ICU 76.1] (TeX Live 2026/dev).
t tk への返信

Re: mendex/upmendex と makeindex での挙動の違い

- はやて (h20y6m) の投稿
Ubuntu 22.04.5 LTS on WSL の TeX Live 2024 ですが、
Valgrind で --malloc-fill=CD とかすると SEGV 再現できますね
(mendex が debug ビルドでないのでどこで落ちてるかわかりませんが……)

$ valgrind --malloc-fill=CD mendex -s test.ist < test.ind
==1044== Memcheck, a memory error detector
==1044== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1044== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==1044== Command: mendex -s test.ist
==1044==
This is mendex version 3.6 [12-Jun-2022] (utf8.uptex) (TeX Live 2024).
Scanning style file ./test.ist.(guessed encoding #3: ASCII = utf8)...done.
Scanning input file stdin....done (2 entries accepted, 0 rejected).
2 entries accepted, 0 rejected.
Sorting index....done(0 comparisons).
Sorting pages....done(2 comparisons).
Making index file.\begin{theindex}

==1044== Use of uninitialised value of size 8
==1044==    at 0x4043C7: ??? (in /usr/local/texlive/2024/bin/x86_64-linux/mendex)
==1044==    by 0x406BBE: ??? (in /usr/local/texlive/2024/bin/x86_64-linux/mendex)
==1044==    by 0x4081F0: ??? (in /usr/local/texlive/2024/bin/x86_64-linux/mendex)
==1044==    by 0x4028F6: ??? (in /usr/local/texlive/2024/bin/x86_64-linux/mendex)
==1044==    by 0x488CD8F: (below main) (libc_start_call_main.h:58)
==1044==
==1044== Invalid read of size 1
==1044==    at 0x4043C7: ??? (in /usr/local/texlive/2024/bin/x86_64-linux/mendex)
==1044==    by 0x406BBE: ??? (in /usr/local/texlive/2024/bin/x86_64-linux/mendex)
==1044==    by 0x4081F0: ??? (in /usr/local/texlive/2024/bin/x86_64-linux/mendex)
==1044==    by 0x4028F6: ??? (in /usr/local/texlive/2024/bin/x86_64-linux/mendex)
==1044==    by 0x488CD8F: (below main) (libc_start_call_main.h:58)
==1044==  Address 0xffffffffce105a4d is not stack'd, malloc'd or (recently) free'd
==1044==
==1044==
==1044== Process terminating with default action of signal 11 (SIGSEGV)