There is no such thing as a shortage in a market economy; it's an oxymoron. (There may occasionally be short-term demand / supply imbalances but the market quickly finds a clearing price.)
Famines are almost universally caused by political failures rather than by actual food shortages. For example we have seen wars where the combatants routinely confiscated food from civilians and prevented delivery of relief supplies. Or misguided governments have imposed price controls which acted as a disincentive to increase production. If you don't have a free market then obviously shortages can persist a long time.