This is floating-point underflow and it's not really avoidable--as you suspect, it comes from calculating p-values that are too small for the computer to represent. So on the plus side, you have some very significant ratios!
When I'm calculating -log p-values I usually will replace -log(zero) with -log(smallest non-zero p-value) + 1 or something like that. That is, you want to signal that the p-value is lower than the lowest non-zero value you see, but also allow it to be visible and not shockingly far from the rest of your data. As long as you document this, it's a totally reasonable thing to do.