Arduino MEGA reboots with digital pin 5 set to high

I am totally lost.
I placed a button on digital 5, with pull-down resistor, when button pressed it gets +5v.
I also have somewhat complicated sketch which on first button press reads sensor data into attached QuadRAM board, then (on next button press) copies RAM into SD file; it also communicates some data (file name, storage progress etc) on serial LCD.
SD card is located on Adafruit datalogger board.
Libraries loaded are SD, I2cMaster.

Sometimes (without changing anything!) it stops working: when I press the button, the board just reboots; moreover, it reboots with power shortage (!!) - I can see it when LCD backlight blinks. If I just keep the button pressed, all LEDs are down.

When the board gets into that strange mode - it stays there even if I upload some other simple sketch, even with switching power off and on several times. Then, after a while (I still cannot figure after what actions) it gets to normal.

From my experience when any device behaves that strange, it is most probably hardware problem.

But still, - can anybody come up with at least a hint, what could it be (besides faulty board)?

I have a feeling there is some "gray area" related to bootloader issues, when it switches to permanent reset loop or something. Can it be somehow related?

I do understand my description sounds very poor and messy and indeterminate. But so is the problem - it is intermittent and very unstable.

If something has shorted the pull-down resistor, when you press the button you will have a high current draw on the 5V line. This might also happen if pin 5 is accidentally set as a LOW OUTPUT.

Maybe draw a schematic showing how your button is connected.

Solved. Initial assumption was correct - in case of intmittent and strange issues - this is a faulty hardware.
But that was really nasty one: I disconnected _everything from the button soldered on Adafruit datalogger board, pull-dopwn resistor, pin connection - I only had Vcc on one pin and nothing at all on all other 3 pins - and it still effectively short-cut power when pushed.
I just removed the button and re-soldered it at different location, further away from the very edge - and everything works now. My suggestion - Datalogger PCB micro-cracks, faulty middle-layer, or, it probably might be - some parasitic feedback effect.