Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
issue
issue
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

  • chainmaker
  • issueissue
  • Issues
  • #1280

Closed
Open
Opened Dec 17, 2024 by zhen yan@sdjasj1 of 19 tasks completed1/19 tasks

panic: runtime error: slice bounds out of range [:49157] with capacity 512

【问题分类】

  • bug
  • P2P网络相关(包含libp2p,liquid)
  • 链账户身份与权限相关(证书问题、public、多签投票问题)
  • 核心交易引擎相关(交易池、DAG)
  • 共识相关
  • 智能合约相关
  • 存储相关
  • SDK相关
  • 长安链CMC工具
  • 长安链管理台
  • 长安链浏览器
  • 长安链合约IDE
  • 长安链web签名插件
  • 跨链相关
  • 轻节点相关
  • 隐私计算相关
  • 密码学相关
  • 环境依赖
  • 其他补充:

【问题描述】(请对问题进行描述,方便定位问题)

在测试的过程中发现新的panic日志,表现形式为panic: runtime error: slice bounds out of range [:49157] with capacity 512

image

采用相同配置进行复现时发现,对节点进行一次重启会出现下面的panic日志,但如果使用相同错误配置进行多次重启后,panic日志会转变为panic: runtime error: slice bounds out of range [:49157] with capacity 512

image

查看/root/go/pkg/mod/chainmaker.org/chainmaker/store/v2@v2.3.6/blockdb/blockfiledb/blockfile.go:763位置的代码,在这里,l.lastSegment.ebuf[startOffset:endOffset] 试图获取 ebuf 的某一部分,但 endOffset 超出了 ebuf 的容量(capacity),导致切片操作失败

image

可以在copy操作之前,添加一个边界检查,确保 startOffset 和 endOffset 在合法范围内

【相关日志文件】(如果有报错日志请贴图,或者上传附件)

chainmaker-go 的 log/system.log & bin/panic.log file *

SDK 的 sdk.log file

【系统信息】(请填写系统信息,方便定位问题)

  • chainmaker-go version * : [v2.3.4]
  • OS & version * : ubuntu-22.04.3-live-server-amd64, Linux version 5.15.0-119-generic
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: chainmaker/issue#1280

Copyright © 2021 ChainMaker Org. All Rights Reserved. 长安链 版权所有。