If we boil an egg which already has a crack on its shell before boiling, it will break and spread into the water. In many cases if we put an egg into hot water it will crack also. So, is there any safe method to boil an egg like that, or should it be fried or cooked in another way? 
I use Egglettes™ to boil my eggs. You simply crack the egg/s into a silicone cup and place it/them into boiling water. Without wishing to seem like a crappy infomercial (see below), I find it a heck of a lot easier to crack an egg into a cup than I find it to peel eggshells off of a soft-boiled egg.  Obviously it makes no difference if the egg has already sustained a recent crack (from being dropped onto the surface, for example) since you're removing the shell prior to cooking.    https://www.youtube.com/watch?v=WxVT2Q6Vt_c  For the avoidance of doubt, I am in no way affiliated to Egglettes other than being a customer 