What do you have on each pin (pin 2 in the pictures you included in your post)?
Is there any reason for using INPUT_PULLUP instead of INPUT?
I also tried to test on pin 2 with mode INPUT but It also didn't work. However when I run mode OUTPUT, it worked. As well as with the other pins 0, 1, 3, 10, 11, 12, 13. I use pin 2 because I want to use external interrupt to share data between arduino IDE with node js on Intel Galielo. But the interrupt didn't work because data read from pin 2 is wrong when I push button and don't push , it forever is Zero .
Please post your wiring as well as the button model/hardware, with a picture, if possible.
Also, take into account that there are other methods to share information, e.g. pipes.