For a book-length document, using the memoir documentclass, inputting many files, and using many packages, the pdf index has two pages of utter junk, consisting of per-cent signs and spaces, as shown in the screen shot below.
Given that the document is so complicated, I am unable to reproduce the behavior with a simple document so as to get a MWE.
The very last thing in my document source (in a subsidiary file) is:
\printindex\cleardoublepage%
%
\endinput
The end of my .ind is:
\item \idxmark{Zorn's Lemma}, \hyperpage{121}
\subitem \gobbleone , \also{Hausdorff maximal principle}{121}
\item \idxmark{Zorn's lemma}, \mainref{114}, \hyperpage{114--117}
\end{theindex}
The definition of \idxmark from my preamble is:
\newcommand{\idxmark}[1]{{\let\gobbleone\relax\markboth{\sffamily\bfseries#1}{\sffamily\bfseries#1}}#1}
The unremarkable .ist file is:
% MakeIndex style file
% output main entry <entry> as: \item \idxmark{<entry>},
item_0 "\n\\item \\idxmark{"
delim_0 "}, "
% not forgetting the subitem case
item_x1 "} \n \\subitem "
headings_flag 1
heading_prefix "{\\medskip\\hfill\\large\\textsf{\\textbf{"
heading_suffix "}}\\hfill}\\medskip\\nopagebreak\n"
Any idea of what the source of this very peculiar output might be? or at least how to proceed to find its cause?

\RequirePackage[2018/11/30]{latexrelease}to the top of your document? – Robert Nov 10 '19 at 18:16\RequirePackage[2018/11/30]{latexrelease}then it causes havoc on compiling at all. E.g., it chokes on various pdf figures (with "Argument of\@tempa has an extra }" error), telling me that\textprimeis already unavailable in T1 encoding; or telling me that various math command such as\vecare already defined. My document uses MathTime Pro 2, fonts but similar obstacles occur if I try to usenewtxfonts orcmplusamssymbfonts. – murray Nov 10 '19 at 19:54\RequirePackagebut instead include the suggested code from the first method in https://tex.stackexchange.com/a/513685/13492, then the index error disappears! So it looks like it is that bug. – murray Nov 10 '19 at 20:04