After upgrading to geth 1.4.4 I am no longer able to from to reference the compiler from geth.
The solc compiler is installed in /usr/local/bin but this is what I get when I check for available compilers:
> eth.getCompilers();
I0520 10:22:45.501340 common/compiler/solidity.go:114] solc, the solidity compiler commandline interface
Version: 0.3.2-7a51852a/Release-Darwin/appleclang/JIT
path: /usr/local/bin/solc
[]
Then I try to set the compiler path again:
> admin.setSolc("/usr/local/bin/solc")
I0520 10:25:49.234999 common/compiler/solidity.go:114] solc, the solidity compiler commandline interface
Version: 0.3.2-7a51852a/Release-Darwin/appleclang/JIT
path: /usr/local/bin/solc
"solc, the solidity compiler commandline interface\nVersion: 0.3.2-7a51852a/Release-Darwin/appleclang/JIT\n\npath: /usr/local/bin/solc"
When I check the compilers again I still get:
> eth.getCompilers();
[]
I get the same using:
> web3.eth.getCompilers();
[]
I have reinstalled go-ethereum, npm.
Can anybody give me a hint of what to do or where to look to look.
I had no problems before upgrading to geth 1.4.4
Thanks in advance
Best Answer
Summary
Segmentation fault with solc version 0.3.2-7a51852a/Release-Darwin/appleclang/JIT
, fixed with later updated version.UPDATE 26/06/2016
This is a bug in the Solidity compiler.
Here is a quick test:
See
eth.compile.solidity
fails with solc version 0.3.5 #2703, which links to Exception on compilation from stdin #651.And the issue Fix crash for input from stdin. #652 has been fixed, but will take an unknown (hopefully short) amount of time to make it into the repository packages.
This is the code change for the fix - Fix crash for input from stdin. #652 - Files changed.
You can try installing the previous version of
solc
.Or one workaround offered in the first link above:
Details
Check Solidity Compiler Within
geth
I just checked by installation (Linux) and the output that you are getting is consistent with the output I get, but the compiler works correctly.
Run the test below to check if your compiler is configured correctly.
I'm using the following code:
I've flattened the code above to:
I've tried compiling the code using the following statement:
And checked the results of the compilation:
And if you want to check if the code runs correctly:
Check Solidity Compiler
If you are still encountering problems, let's try compiling the source code outside
geth
.Save the following code into Test.sol:
From your terminal, you should be able to run the following commands if your solidity compiler is working correctly:
If the commands above do not produce similar output, there is something not quite right with your
solc
binary.Check
web3.js
You have an error message that includes the text
web3.js
. The problem could be with this module. I'll update when I've researched it a bit more.