http://linuxmafia.com/faq/Essays/marriage.html discusses some of the genetic anomalies that are possible and coincidentally how they've been handled by the IOC.

Interesting piece! I was first exposed to how complicated the biology of sex is when I listened to Radiolab's series on the subject:

https://radiolab.org/series/radiolab-presents-gonads/