this triggers stack corruption in measure()