vm-wxvm项目的vm-wxvm/xvm/exec/trap.c会导致编译error
【问题分类】
- bug
- P2P网络相关(包含libp2p,liquid)
- 链账户身份与权限相关(证书问题、public、多签投票问题)
- 核心交易引擎相关(交易池、DAG)
- 共识相关
- 智能合约相关
- 存储相关
- SDK相关
- 长安链CMC工具
- 长安链管理台
- 长安链浏览器
- 长安链合约IDE
- 长安链web签名插件
- 跨链相关
- 轻节点相关
- 隐私计算相关
- 密码学相关
- 环境依赖
- 其他补充:
【问题描述】(请对问题进行描述,方便定位问题)
执行chainmaker-go/scripts/build-release.sh时报错error,执行中断
报错如下:
build chainmaker /home/cat/WorkSpace/ChainMaker/chainmaker-go...
build for linux or mac
# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function ‘sqlite3SelectNew’:
sqlite3-binding.c:125801:10: warning: function may return address of local variable [-Wreturn-local-addr]
125801 | return pNew;
| ^~~~
sqlite3-binding.c:125761:10: note: declared here
125761 | Select standin;
| ^~~~~~~
# chainmaker.org/chainmaker/vm-wxvm/v2/xvm/exec
trap.c: In function ‘init_go_trap’:
trap.c:11:16: error: assignment to ‘void (*)(wasm_rt_trap_t)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
11 | wasm_rt_trap = go_wxvm_trap;
| ^
trap.c:8:13: note: ‘go_wxvm_trap’ declared here
8 | extern void go_wxvm_trap();
| ^~~~~~~~~~~~
make: *** [Makefile:28: chainmaker] Error 1
注意到其中的error,排查到vm-wxvm,发现vm-wxvm/xvm/exec/trap.c存在bug:
/*
* Copyright (C) BABEC. All rights reserved.
* Copyright (C) THL A29 Limited, a Tencent company. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include "wxvm.h"
extern void go_wxvm_trap(); // !!!这里和trap.go不符,会导致error,应改为 extern void go_wxvm_trap(wasm_rt_trap_t code);
void init_go_trap() {
wasm_rt_trap = go_wxvm_trap;
}
【系统信息】(请填写系统信息,方便定位问题)
- chainmaker-go version * : 2.3.7
- OS & version * : kali
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information