Unable to upload a particular sketch to arduino mega 2560

I seem to have developed a problem in my sketch which causes it to fail to upload to an arduino mega.

It seems to start uploading but then hangs - I never get the "done" message.

And from then on the arduino mega com port seems to be locked if I start another instant of arduino ide.

However the sketch successfully uploads to an arduino uno.

I can however successfully load the blink example on to the mega in question.

Has anyone encountered this sort of problem before that might be able to point me in the right direction?

Does the sketch have the string "!!!" anywhere in it?

There's an old version of the bootloader with a bug that causes 3 consecutive exclaimation points to put the bootloader into a different mode, breaking the current upload. I think the current version of the IDE has a fixed bootloader, so connecting an ISP programmer and reburning bootloader should fix it.

Thanks DrAZZY - that was it exactly.

Looks like I need to update the boot loader of my megas.