add NaN trap to linux version