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

sdk开启Ssl,程序终止 #285

Open
ctbsea opened this issue Sep 14, 2024 · 2 comments
Open

sdk开启Ssl,程序终止 #285

ctbsea opened this issue Sep 14, 2024 · 2 comments

Comments

@ctbsea
Copy link

ctbsea commented Sep 14, 2024

使用的是example/ hello_word案例
fisco-bcos 版本3.6.0 ,sdk使用的3.0.2 , bcos-c-sdk 使用的是3.6.0,windows开发环境

  1. sdk 连接配置config.ini中的rpc.disable_ssl设置为true, client连接DisableSsl= true, 此时go run ,能正常部署合约以及set get
  2. config.ini.disable_ssl=false, DisableSsl=false的时候,使用了正确的sdk证书配置,go run 直接提示 exit status 0xc0000374,无其他输出
    但是使用调试工具进行调试,却可以正常部署合约以及set get
@ctbsea
Copy link
Author

ctbsea commented Sep 14, 2024

目前判断问题出现在

func NewSDK(groupID string, host string, port int, isSmSsl bool, privateKey []byte, disableSsl bool, tlsCaPath, tlsKeyPath, tlsCertPath, tlsSmEnKey, tlsSEnCert string) (*CSDK, error) {
        ...................
	config := C.bcos_sdk_create_config(cIsSmSsl, cHost, cPort)
        // bcos_sdk_c_config_destroy 导致的exit
	defer C.bcos_sdk_c_config_destroy(unsafe.Pointer(config))
        ............
}

我尝试注释掉 defer C.bcos_sdk_c_config_destroy(unsafe.Pointer(config)) , 程序是可以正常运行

gdb调试结果

Thread 1 hit Breakpoint 1, 0x00007ffd6516aade in bcos_sdk_c_config_destroy () from C:\WINDOWS\SYSTEM32\bcos-c-sdk.dll
(gdb) step
Single stepping until exit from function bcos_sdk_c_config_destroy,
which has no line number information.
warning: HEAP[main.exe]:
warning: Invalid address specified to RtlFreeHeap( 000001FEC8B70000, 000001FEC8E446F0 )

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffe0d2e59ff in ntdll!RtlValidateHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll

@bxq2011hust
Copy link
Member

你使用sdk的方式是进程生命周期就一个client对象吗?

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

No branches or pull requests

2 participants