From 9d4f94fa45f5077d0b0a7df75e6b239db40c3047 Mon Sep 17 00:00:00 2001 From: Larry <92799281+brilliant-lx@users.noreply.github.com> Date: Sun, 16 Apr 2023 15:36:52 +0800 Subject: [PATCH 1/2] fix: panic on using WaitGroup after it is freed (#1464) --- core/blockchain.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index b7838a7719..2e67c2f3c1 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1546,18 +1546,20 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types. } } // Garbage collect anything below our required write retention + wg2 := sync.WaitGroup{} for !bc.triegc.Empty() { root, number := bc.triegc.Pop() if uint64(-number) > chosen { bc.triegc.Push(root, number) break } - wg.Add(1) + wg2.Add(1) go func() { triedb.Dereference(root.(common.Hash)) - wg.Done() + wg2.Done() }() } + wg2.Wait() } } return nil From dbe1f20bad650670085c999891e31a4deb7898ee Mon Sep 17 00:00:00 2001 From: "larry.lx" Date: Sun, 16 Apr 2023 18:52:17 +0800 Subject: [PATCH 2/2] release: prepare for release v1.1.23 --- CHANGELOG.md | 4 ++++ params/version.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b1661320..c6bfda8005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## v1.1.23 +BUGFIX +* [\#1464](https://github.com/bnb-chain/bsc/pull/1464) fix: panic on using WaitGroup after it is freed + ## v1.1.22 FEATURE * [\#1361](https://github.com/bnb-chain/bsc/pull/1361) cmd/faucet: merge ipfaucet2 branch to develop diff --git a/params/version.go b/params/version.go index 4561af6570..47311fa398 100644 --- a/params/version.go +++ b/params/version.go @@ -23,7 +23,7 @@ import ( const ( VersionMajor = 1 // Major version component of the current release VersionMinor = 1 // Minor version component of the current release - VersionPatch = 22 // Patch version component of the current release + VersionPatch = 23 // Patch version component of the current release VersionMeta = "" // Version metadata to append to the version string )