About once out of every four times that I compile a large LaTeX project (about 780 pages) in TeXShop, the console freezes and stops the compiling. The content of the LaTeX files does not seem to affect the freezing--I can compile exactly the same file 2-3 times in a row with no problem and then the next time or two it freezes, and then I can compile it again a few more times. Where it freezes in the document also seems random--sometimes on page 200, another time on page 779.
There is no error thrown, no warning, nothing--it just stops compiling and waits. The console also does not accept further input at that point. But the rest of TeXShop still continues to work fine, so to recover I just have to recompile (twice, since the aux files are all damaged by this). Since the project is big, compiling takes a while, so this is a bother.
I am running TeXShop version Version 4.21 on a 2015 MacBook Air 2.2 GHz Intel Core i7, with 8GB RAM running Mojave (10.14). But I have had this problem for several months, running earlier versions of MacOS and earlier versions of TeXShop. This also happens on my 2013 iMac, 3.5 GHz Intel Core i7, with 24GB RAM, also running Mojave, but also occured on previous versions of MacOS and previous versions of TeXShop.
The command that TeXShop runs to compile is
pdflatex --file-line-error --synctex=1 book.tex
The problem has not yet occurred in the mac terminal when I run the same pdflatex command there (with TeXShop still up and running), so I don't think it is a TeX problem or memory issue.
I would be grateful for any ideas anyone might have for fixing this.