In addition to limiting fiber leading up to the race, I heard that avoiding caffeine or acidic coffee in particular for some people works as does avoiding spicy food na fatty foods. Bland food is prefered (like rice cakes) and staying hydrated. And the problem is more prevalent among those newer to running.