Let $X$ be a smooth compact oriented 4-manifold with nonempty boundary. Its intersection form $$ Q_X : H^2(X,\partial X;\Bbb Z)/\text{torsion}\times H^2(X,\partial X;\Bbb Z)/\text{torsion}\to \Bbb Z$$ is defined by $Q_X(a,b)=\langle a \cup b, [X]\rangle$, where $[X]$ is the fundamental class of $X$. It is a symmetric bilinear form, so can be represented by a symmetric matrix. $Q_X$ (or $X$) is unimodular if the matrix has determinant $\pm 1$.
It is known that (cf. Gompf & Stipsicz - 4-manifolds and Kirby Calculus, Remark 1.2.11) if $H_1(X;\Bbb Z)=0$, then $X$ is unimodular if and only if $\partial X$ is a disjoint union of integral homology 3-spheres. This is not true if $H_1(X;\Bbb Z)\neq 0$: If $X=S^1\times D^3$ then $b_2(X)=0$ so $Q_X$ is vacuously unimodular but $\partial X=S^1\times S^2$ is not an integral homology 3-spheres.
However, consider the case where $\partial X$ is a disjoint union of rational homology 3-spheres, or equivalently that $H^1(\partial X;\Bbb Z)=0$ (cf. the answer in https://math.stackexchange.com/questions/4941055/for-a-compact-4-manifold-no-2-torsion-in-h-1m-bbb-z-implies-no-2-torsion-i/4941241#4941241). Then is it true that $X$ is unimodular if and only if $\partial X$ is a disjoint union of integral homology 3-spheres? I cannot found an example of a unimodular $X$ such that $H_1(\partial X;\Bbb Z)$ is nonzero torsion.
Actually the case I am interested in is that $\text{rank}(H^2(X,\partial X;\Bbb Z))=1$. In this case $X$ is unimodular if and only if $Q_X(a,a)=\pm 1$ for some $a$. For such $X$ can $H_1(\partial X;\Bbb Z)$ be a nonzero torsion group?