The paper deals with the computer modeling of internal mechanochemical corrosion of a long pipe line section under the internal and external corrosion pressure. The outer boundary of the pipe cross-section is circular, while the inner surface is elliptical. The author studied the task in a two-dimensional installation. Many decisions related to the irregular mechanochemical wear are based on the hypothesis suppositions about the retention of a definite shape of a corroding product. However, mentioned analytical solution gives a significantly overestimated lifetime if the pipe has the initial deviation in the wall thickness even within the permissible tolerance. In this way, computer modeling is a good approach to solve such problems of defective pipes. Using the finite elements technique (FET) in MATLAB environment, the author carried out the numerical experiment for a certain example for studying the influence of pipe thickness deviation on its service life. The study showed that even a slight thickness deviation of a pipe wall causes the stress concentration and the existence of the mechanochemical corrosion causes larger variation in thickness. Moreover, both thinning and thickening of the pipe wall lead to a reduction in its durability. In this way, the more the internal and external pressure difference, the stronger the mechanochemical effect and the shorter the service life of a pipe. The greatest increase in the absolute values of stresses is observed at the vertices of the inner elliptical boundary of a pipe where its thickness has minimum values.