Local-density-functional methods are used to examine the behavior of the oxygen defect, gallium vacancy, and related defect complexes trapped at threading-edge dislocations in GaN. These defects are found to be particularly stable at the core of the dislocation where oxygen sits twofold coordinated in a bridge position. ${V}_{\mathrm{Ga}}\ensuremath{-}{\mathrm{O}}_{\mathrm{N}}$ is found to be a deep double acceptor, ${V}_{\mathrm{Ga}}\ensuremath{-}({\mathrm{O}}_{\mathrm{N}}{)}_{2}$ is a deep single acceptor, and ${V}_{\mathrm{Ga}}\ensuremath{-}({\mathrm{O}}_{\mathrm{N}}{)}_{3}$ at the dislocation core is electrically inactive. We suggest that the first two defects are responsible for a deep acceptor level associated with the midgap yellow luminescence band.