Carbon monoxide formation in broken boilers
The combustion of hydrocarbons works as follows:

$\ce{hydrocarbon + O2-&gt; CO + H2O}$

The reaction can then continue to the complete combustion:

$\ce{CO + 1/2 O2-&gt; CO2}$

An example of balanced equation is the combustion of methane:


$\ce{CH4 +  3/2O2 -&gt; CO + 2H2O}$
$\ce{CO +  1/2O2 -&gt; CO2}$


So, carbon monoxide is a product of the incomplete combustion of a hydrocarbon.

It is produced when there is too much fuel (eg: methane), but not enough oxidant (eg: oxygen from air).

I guess that a boiler which cannot mix properly air and fuel produces carbon monoxide.