  S2 has been observed for decades in comets, including comet
67P/Churyumov-Gerasimenko. Despite the fact that this molecule appears
ubiquitous in these bodies, the nature of its source remains unknown. In this
study, we assume that S2 is formed by irradiation (photolysis and/or
radiolysis) of S-bearing molecules embedded in the icy grain precursors of
comets, and that the cosmic ray flux simultaneously creates voids in ices
within which the produced molecules can accumulate. We investigate the
stability of S2 molecules in such cavities, assuming that the surrounding ice
is made of H2S or H2O. We show that the stabilization energy of S2 molecules in
such voids is close to that of the H2O ice binding energy, implying that they
can only leave the icy matrix when this latter sublimates. Because S2 has a
short lifetime in the vapor phase, we derive that its formation in grains via
irradiation must occur only in low density environments such as the ISM or the
upper layers of the protosolar nebula, where the local temperature is extremely
low. In the first case, comets would have agglomerated from icy grains that
remained pristine when entering the nebula. In the second case, comets would
have agglomerated from icy grains condensed in the protosolar nebula and that
would have been efficiently irradiated during their turbulent transport towards
the upper layers of the disk. Both scenarios are found consistent with the
presence of molecular oxygen in comets.
