A review is given of the results of first principles calculations used to investigate the structures and electronic properties of screw and edge dislocations in GaN. The atoms at the core of the full core screw dislocation possess heavily strained bonds leading to deep gap states. Removing the first shell of Ga and N atoms gives a screw dislocation with a small open core consisting of {101-0} type surfaces. Therefore open-core screw dislocations induce only shallow gap states. In the same way we found the core of the threading edge dislocation to be reconstructed without any deep states. The interaction of oxygen with the cores of open-core screw and edge dislocations is considered and it is found that the impurity has a strong tendency to be bound by Ga vacancies leading to three types of defect trapped in the strain field. We suggest that the most stable defect leads to a poisoning of growth centres on the walls of nanopipes.