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

python-sdk 跑demo_get.py报错 #177

Closed
capyun opened this issue Sep 29, 2022 · 9 comments
Closed

python-sdk 跑demo_get.py报错 #177

capyun opened this issue Sep 29, 2022 · 9 comments

Comments

@capyun
Copy link

capyun commented Sep 29, 2022

但是跑console2.py没有问题。
感觉是solc的问题。
以下是报错信息。

python3 demo_get.py
INFO >> compile with solc compiler : ./bin/solc/v0.4.25/solc --bin --abi contracts/HelloWorld.sol -o contracts --overwrite
Traceback (most recent call last):
File "/opt/fl-bc/pysdk/client/common/compiler.py", line 99, in compile_file
Compiler.compile_with_solc(sol_file, contract_name, output_path)
File "/opt/fl-bc/pysdk/client/common/compiler.py", line 79, in compile_with_solc
common.execute_cmd(command)
File "/opt/fl-bc/pysdk/client/common/common.py", line 113, in execute_cmd
data = subprocess.check_output(cmd.split(), shell=False, universal_newlines=True)
File "/opt/anaconda3/envs/flbc_3.7.3/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/opt/anaconda3/envs/flbc_3.7.3/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['./bin/solc/v0.4.25/solc', '--bin', '--abi', 'contracts/HelloWorld.sol', '-o', 'contracts', '--overwrite']' died with <Signals.SIGSEGV: 11>.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "demo_get.py", line 27, in
Compiler.compile_file("contracts/HelloWorld.sol")
File "/opt/fl-bc/pysdk/client/common/compiler.py", line 112, in compile_file
raise CompileError("compile error for compile failed, error information: {}".format(e))
client.bcoserror.CompileError: compile error for compile failed, error information: Command '['./bin/solc/v0.4.25/solc', '--bin', '--abi', 'contracts/HelloWorld.sol', '-o', 'contracts', '--overwrite']' died with <Signals.SIGSEGV: 11>.

@coderkentzhang
Copy link
Contributor

看提示是solc出错了。检查下solc是否可以独立运行,重新下载solc看能否解决问题。

@capyun
Copy link
Author

capyun commented Oct 6, 2022

image

看提示是solc出错了。检查下solc是否可以独立运行,重新下载solc看能否解决问题。

image
重新下载还是不行,换别的版本也不行。

@capyun
Copy link
Author

capyun commented Oct 6, 2022

看提示是solc出错了。检查下solc是否可以独立运行,重新下载solc看能否解决问题。

image
我只使用0.4.25 solc命令,发现它本身就不能用,但是换别的版本可以出来命令提示。然后我重新下载0.4.25,出现这个错误。

@coderkentzhang
Copy link
Contributor

coderkentzhang commented Oct 8, 2022

目测solc本身在你的系统上跑不起来,请查证和反馈操作系统版本。
目前供下载的linux平台的solc在centos、ubuntu的主流版本上均可运行

@capyun
Copy link
Author

capyun commented Oct 11, 2022

~ uname -a 1 х base Py root@iZ2ze5zw0dskxi095fok0aZ
Linux iZ2ze5zw0dskxi095fok0aZ 4.15.0-173-generic #182-Ubuntu SMP Fri Mar 18 15:53:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
~ cat /proc/version ✔ base Py root@iZ2ze5zw0dskxi095fok0aZ
Linux version 4.15.0-173-generic (buildd@lcy02-amd64-094) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #182-Ubuntu SMP Fri Mar 18 15:53:46 UTC 2022
~ cat /etc/issue ✔ base Py root@iZ2ze5zw0dskxi095fok0aZ
Ubuntu 18.04.6 LTS \n \l

@capyun
Copy link
Author

capyun commented Oct 11, 2022

image

@ywy2090
Copy link

ywy2090 commented Oct 13, 2022

image

这个看上去像是指令集的问题,提供的solc程序在你的机器上面无法执行

你执行下这个命令
ulimit -c unlimited

然后再执行solc
image

在当前目录下会有个core.xxx的文件

然后用gdb命令:

gdb solc路径 core.xxx

进入gdb之后 执行 bt

看下错误的内容

@capyun
Copy link
Author

capyun commented Oct 13, 2022

我这边执行ulimit和solc之后,没有core.xxx文件。。。

@coderkentzhang
Copy link
Contributor

预计是兼容性问题。没有更多信息可跟进。先close,如继续有问题,可在社区群里提出或提issue

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

3 participants