Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pointer conversion bug of go1.14 #1063

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

yann-sjtu
Copy link
Collaborator

@yann-sjtu yann-sjtu commented Jul 1, 2021

fixed 33cn/plugin#1003

开启race时默认开启checkptr,此时长度为n的[]byte只能转换为长度不超过 n/8的[]uint64,否则runtime检查会报错堆对象越界,导致unsafe强制类型转换失败。该pr用于修复plugin的单元测试报错

参考:
https://golang.org/src/runtime/checkptr.go?s=194:258#L1
etcd-io/bbolt#187
golang/go#34964
https://go-review.googlesource.com/c/net/+/203400/2/ipv4/control_bsd.go

@codecov
Copy link

codecov bot commented Jul 1, 2021

Codecov Report

Merging #1063 (47540ce) into master (4b01e8a) will decrease coverage by 0.05%.
The diff coverage is 95.52%.

❗ Current head 47540ce differs from pull request most recent head 63fedad. Consider uploading reports for the commit 63fedad to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1063      +/-   ##
==========================================
- Coverage   60.18%   60.12%   -0.06%     
==========================================
  Files         157      157              
  Lines       19817    19878      +61     
==========================================
+ Hits        11926    11952      +26     
- Misses       6073     6104      +31     
- Partials     1818     1822       +4     
Impacted Files Coverage Δ
common/crypto/sha3/xor_unaligned.go 73.62% <95.52%> (-13.05%) ⬇️
system/crypto/secp256r1/utils.go 67.24% <0.00%> (-3.45%) ⬇️
blockchain/query_block.go 61.67% <0.00%> (-1.80%) ⬇️
blockchain/process.go 55.28% <0.00%> (-1.52%) ⬇️
blockchain/proc.go 32.22% <0.00%> (-0.89%) ⬇️
common/skiplist/skiplist.go 68.64% <0.00%> (-0.85%) ⬇️
rpc/jrpchandler.go 64.40% <0.00%> (-0.12%) ⬇️
blockchain/push.go 72.67% <0.00%> (ø)
blockchain/blockstore.go 58.73% <0.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b01e8a...63fedad. Read the comment docs.

@33cn 33cn merged commit e36c055 into 33cn:master Jul 1, 2021
@yann-sjtu yann-sjtu deleted the fix_pointer_conversion_bug branch July 2, 2021 06:29
@33cn
Copy link
Owner

33cn commented Oct 15, 2021

🎉 This PR is included in version 1.66.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@33cn 33cn added the released label Oct 15, 2021
@33cn
Copy link
Owner

33cn commented Oct 15, 2021

🎉 This PR is included in version 1.66.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: runtime error: unsafe pointer conversion (Go 1.14)
2 participants