For those who are interested, the problem arises when we add a callback to the C interface of PRIMA. See