In a document I maintain, one of our tables was discovered to be overlapping with the bottom margin. TeX did not produce any error or warning indicating that there was a problem.
The original case is here: https://github.com/cplusplus/draft/issues/1567
Reduced testcase:
\documentclass{memoir}
\usepackage[american]{babel}
\usepackage{longtable}
\setulmarginsandblock{1in}{2in}{*}
\checkandfixthelayout
\makepagestyle{mypage}
\makeevenhead{mypage}{}{This is the top of the page}{}
\makeoddhead{mypage}{}{This is the top of the page}{}
\makeevenfoot{mypage}{}{This is the bottom of the page}{}
\makeoddfoot{mypage}{}{This is the bottom of the page}{}
\pagestyle{mypage}
\begin{document}
\begin{table}
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
\end{table}
\begin{longtable}{l}
longtable \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
\end{longtable}
\begin{longtable}{l}
longtable 2 \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
\end{longtable}
\end{document}

It appears that the problem occurs when a floating table environment and two longtable environments appear on the same page; the second longtable appears to break too late (by the height of the table, I think).
What can I do to systematically avoid this problem, or at least to get TeX to warn if it happens again?
[!ht]as an option for thetableenvironment? – Bernard Mar 22 '17 at 02:38longtablestarts from the current point on the page, which won't, presumably, include the float .... – cfr Mar 22 '17 at 04:28hin will do, I think. You don't need!. (Though you might in the real document, of course.) – cfr Mar 22 '17 at 04:29[!htb]. – Richard Smith Mar 22 '17 at 06:31