Imagemagick under Ubuntu 14.04 error example:
convert -rotate 270 003632r270.jpg junk.jpg
*** stack smashing detected ***: convert terminated

The file used can be found is 003632r270.jpg, but same thing happens with any file in here.

The bug can also be triggered by compare:

$ compare -fuzz 25% 174210.jpg 182452.jpg junk.jpg
*** stack smashing detected ***: compare terminated
Aborted

Sample files here: 174210.jpg, 182452.jpg.