Arduino Serial print changes behavior of program undesireably
Does your code initialise the serial port?
Eg.

void setup()
{
    Serial.begin(9600);
}


Failing to do this could result in a crash on first use of the serial.