I specified the spacing in my document (before and after titles of chapter, section, subsection etc.). It works with first five chapters and their sections, subsections and so on but somehow it doesn't with the chapter 6, and then works again with chapter 7.
\documentclass[12pt, a4paper, twoside]{report}
\titlespacing*{\chapter}{0pt}{0pt}{12pt}
\titlespacing*{\section}{0pt}{12pt}{12pt}
\titlespacing*{\subsection}{0pt}{12pt}{12pt}
\begin{document}
\chapter{Cel pracy}
\input{wstep}
\chapter{Barwa}
\input{barwa}
\section{Mieszanie barw}
\input{barwa_mieszanie}
\chapter{Rachunek trójchromatyczny}
\input{rachunek_trojchromatyczny}
\chapter{Układy barw}
\input{ukladybarw}
\chapter{Obliczenia kolorymetryczne}
\input{obliczenia_kolorymetryczne}
\chapter{Złudzenia}
\input{zludzenia}
\chapter{Program komputerowy}
\input{programowanie}
\end{document}
The first five chapters looks like this (and it's ok):
and then it's ok again.
Does anybody know how to fix this?
edit: Everything's ok when I input something under chapter and second section but when it comes to type something under first section, it looks like on the picture 1.

\flushbottomand the top of the next page is a large unbreakable box. – David Carlisle Jan 04 '17 at 12:12! Undefined control sequence. <recently read> \titlespacing– David Carlisle Jan 04 '17 at 12:15