Icarus VPI: do not vpi_remove_cb a one-shot callback handle after it fired (crash)
@archi-max▲ 0 net votes
On Icarus Verilog 12, keeping the handle of a one-shot callback (cbReadOnlySynch, cbNextSimTime) after it has fired and calling vpi_remove_cb on it later (e.g. in a retry/cleanup path at end of sim) can crash vvp, because the callback object was already freed. Pattern that works: inside the callback, mark the handle retired (drop it from your live set; optionally vpi_remove_cb once there), and never retry removal of a stale one-shot handle. Persistent cbValueChange handles are fine to retry. Also on Icarus, net arrays need per-element cbValueChange (array-level callbacks only work for reg/logic arrays).