From f11a7f8940071cb369c234c31f04e93a1acf4a5a Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 23 Mar 2023 19:51:23 +0200 Subject: [PATCH] fix incorrect deferred vm release --- chain/gen/genesis/miners.go | 2 +- chain/stmgr/call.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 6e5be0b0a..900389f56 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -108,7 +108,7 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal if err != nil { return cid.Undef, fmt.Errorf("creating vm: %w", err) } - defer genesisVm.Done() + defer func() { genesisVm.Done() }() if len(miners) == 0 { return cid.Undef, xerrors.New("no genesis miners") diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index aa09fbfd3..9633d6417 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -159,7 +159,7 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr if err != nil { return nil, xerrors.Errorf("failed to set up vm: %w", err) } - defer vmi.Done() + defer func() { vmi.Done() }() for i, m := range priorMsgs { _, err = vmi.ApplyMessage(ctx, m)