Molecular-dynamics simulations have been performed to investigate the defect formation associated with the Staebler-Wronski (SW) effect in undoped a-Si:H and the role that H plays in this process. Semiempirical Si-Si and Si-H total-energy functionals were used to obtain the forces needed for these simulations. Two a-Si:H random networks proposed by Guttman and Fong [Phys. Rev. B 26, 6756 (1982)], a monohydride system and a dihydride system, both of which contain 54 Si and 6 H atoms, were used as initial configurations. The bond-breaking model of the SW effect was assumed, and a localized excitation was used to model the nonradiative energy transfer from photoexcited electron-hole pairs to the system. Our results indicate that the monohydride system is considerably more stable against localized excitations than the dihydride system. We also find that, at least within the bond-breaking model, H is probably not involved in the defect formation associated with the SW effect in undoped a-Si:H.