Are you using Pin 3 in your sketch? If so, I would suspect either a bad contact from Uno Pin 3 to the Shield header pin 3, (could also be a bad ("cold") solder joint). You can test (with board powered down) using multimeter, touching pin 3 stub solder joint on bottom side of Uno and top of pin 3 on Uno. If open, push as you did before and see if resistance drops to 0. If already at 0 resistance, attach shield and repeat, with probes at underside of Uno and top of Shield pin 3.