Say we have a vector function $\vec{D}$ defined in some region on whose boundary its divergence goes to infinity and inside we have $\nabla \cdot \vec{D}=\rho$.
Then is it valid to use the Gauss divergence theorem here? That is can we say :
$\int_{V}(\nabla \cdot \vec{D}) d v=\int_{V} \rho d v$ , hence
$\int_{s} D\cdot d s =\int_{V} \rho d v$
(This is done by Griffiths while discussing electric displacement in his electrodynamics textbook.)