NXP-12134 avoid StackOverflow in trace mode