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

Latest aleth fails with Solidity tests #3825

Closed
axic opened this issue Apr 5, 2018 · 25 comments
Closed

Latest aleth fails with Solidity tests #3825

axic opened this issue Apr 5, 2018 · 25 comments

Comments

@axic
Copy link
Member

axic commented Apr 5, 2018

$ test/soltest --show-progress -t SolidityEndToEndTest -- --testpath ../test --ipcpath /tmp/testeth/geth.ipc 
Running 463 test cases...

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***********************/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/array_copy_storage_abi": * Line 1, Column 37
  Syntax error: value, object or array expected.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/array_copy_storage_abi_signed": * Line 1, Column 615
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/array_push": * Line 1, Column 39
  Extra non-whitespace after JSON value.

*/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/byte_array_push": * Line 1, Column 359
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/external_array_args": * Line 1, Column 39
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/bytes_index_access": * Line 2, Column 1
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:276: fatal error: in "SolidityEndToEndTest/bytes_delete_element": critical check rpcCall("test_rewindToBlock", { to_string(_blockNr) }) == true has failed
/Users/alex/Projects/solidity/test/RPCSession.cpp:282: fatal error: in "SolidityEndToEndTest/array_copy_calldata_storage": critical check rpcCall("test_mineBlocks", { to_string(_number) }, true) == true has failed
/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/array_copy_nested_array": * Line 2, Column 1
  Extra non-whitespace after JSON value.

**********/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/short_strings": * Line 1, Column 38
  Syntax error: value, object or array expected.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/calldata_offset": * Line 1, Column 11
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/contract_binary_dependencies": * Line 2, Column 1
  Extra non-whitespace after JSON value.

******/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/index_access_with_type_conversion": * Line 1, Column 38
  Syntax error: value, object or array expected.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/delete_on_array_of_structs": * Line 1, Column 1
  A valid JSON document must be either an array or an object value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/internal_library_function": * Line 1, Column 41
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/internal_library_function_calling_private": * Line 2, Column 1
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:282: fatal error: in "SolidityEndToEndTest/internal_library_function_bound": critical check rpcCall("test_mineBlocks", { to_string(_number) }, true) == true has failed
/Users/alex/Projects/solidity/test/RPCSession.cpp:282: fatal error: in "SolidityEndToEndTest/internal_library_function_return_var_size": critical check rpcCall("test_mineBlocks", { to_string(_number) }, true) == true has failed
/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/iszero_bnot_correct": * Line 2, Column 1
  Extra non-whitespace after JSON value.

**********/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/snark": * Line 1, Column 38
  Syntax error: value, object or array expected.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/staticcall_for_view_and_pure": * Line 1, Column 16
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:344: fatal error: in "SolidityEndToEndTest/swap_peephole_optimisation": * Line 1, Column 9
  Extra non-whitespace after JSON value.

*

*** 22 failures are detected in the test module "SolidityTests"
@axic axic added the bug 🐛 label Apr 5, 2018
@axic
Copy link
Member Author

axic commented Apr 5, 2018

For issue array_copy_storage_abi above:

Request: {"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x8f0d282d","from":"0x3955c3ea620fe967c4f3d404bff52bcb77c85c8e","gas":"0x0000000000000000000000000000000000000000000000000000000005f5e100","gasprice":"0x00000000000000000000000000000000000000000000000000005af3107a4000","to":"70c8ecaa9feb7f9733f69cc5bcd9581d39e4672c","value":"0x0000000000000000000000000000000000000000000000000000000000000000"}, "latest"],"id":33}
Reply: {"id":33,"jsonrpc":"2.0","result":"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000d600000000000000000000000000000000000000000000000000000000000001a2000000000000000000000000000000000000000000000000000000000000026e000000000000000000000000000000000000000000000000000000000000033a000000000000000000000000000000000000000000000000000000000000000650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000013000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000150000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001700000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001d000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000001f0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000023000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000250000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002700000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000029000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002b000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002d000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000002f0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003100000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000000000003400000000000000000000000000000000000000000000000000000000000000350000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000003700000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000039000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000000000000000000000000000000003b000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000003d000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000003f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004100000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000043000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000450000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000004700000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000049000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004b000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000004d000000000000000000000000000000000000000000000000000000000000004e000000000000000000000000000000000000000000000000000000000000004f0000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005100000000000000000000000000000000000000000000000000000000000000520000000000000000000000000000000000000000000000000000000000000053000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000550000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000005700000000000000000000000000000000000000000000000000000000000000580000000000000000000000000000000000000000000000000000000000000059000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000005d000000000000000000000000000000000000000000000000000000000000005e000000000000000000000000000000000000000000000000000000000000005f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006100000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000063000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000
/Users/alex/Projects/solidity/test/RPCSession.cpp:347: fatal error: in "SolidityEndToEndTest/array_copy_storage_abi": * Line 1, Column 35
  Syntax error: value, object or array expected.

Running it twice stops cpp-ethereum.

cc @chfast @winsvega @gumb0

@winsvega
Copy link
Contributor

winsvega commented Apr 5, 2018

this are 3 PRs that changed the client recently
https://github.com/ethereum/cpp-ethereum/pull/4895/files (set default askGas to 0)
https://github.com/ethereum/cpp-ethereum/pull/4922/files (set author from chain params and call complete sync when test_setChainParams)
https://github.com/ethereum/cpp-ethereum/pull/4923/files (accept "to" field as empty string)

@axic
Copy link
Member Author

axic commented Apr 11, 2018

This seems to be specific to macOS and is probably related to timing of unix sockets.

@chriseth
Copy link
Contributor

@axic is this fixed?

@axic
Copy link
Member Author

axic commented May 17, 2018

No, still happens.

@axic
Copy link
Member Author

axic commented Oct 15, 2018

Run this again with the official aleth 1.4.0 build and it is still happening.

$ test/soltest -- --ipcpath /tmp/testeth/geth.ipc
Running 2621 test cases...
/Users/alex/Projects/solidity/test/RPCSession.cpp:360: fatal error: in "SolidityAuctionRegistrar/creation": * Line 1, Column 35
  Syntax error: value, object or array expected.

/Users/alex/Projects/solidity/test/RPCSession.cpp:360: fatal error: in "SolidityAuctionRegistrar/reserve": * Line 1, Column 1
  Syntax error: value, object or array expected.
* Line 1, Column 2
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:360: fatal error: in "SolidityAuctionRegistrar/double_reserve_long": * Line 1, Column 55
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:360: fatal error: in "SolidityAuctionRegistrar/properties": * Line 2, Column 1
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:292: fatal error: in "SolidityAuctionRegistrar/transfer": critical check rpcCall("test_rewindToBlock", { to_string(_blockNr) }) == true has failed
/Users/alex/Projects/solidity/test/RPCSession.cpp:367: fatal error: in "SolidityAuctionRegistrar/disown": Error on JSON-RPC call: Invalid transaction nonce.
/Users/alex/Projects/solidity/test/RPCSession.cpp:292: fatal error: in "SolidityAuctionRegistrar/auction_simple": critical check rpcCall("test_rewindToBlock", { to_string(_blockNr) }) == true has failed
....

@axic
Copy link
Member Author

axic commented Oct 15, 2018

This is on mac 10.11.6, will need to check on a newer system.

@winsvega
Copy link
Contributor

could you print the actuall RPC response?
could be related:
https://github.com/ethereum/aleth/pull/5111/files

@gumb0
Copy link
Member

gumb0 commented Oct 16, 2018

could you print the actuall RPC response?
could be related:
ethereum/aleth/pull/5111/files

This issue is older.

@chriseth
Copy link
Contributor

Should be fixed now.

@axic axic reopened this Jan 29, 2019
@axic
Copy link
Member Author

axic commented Jan 29, 2019

Running aleth 1.5.2 and it still happens:

$ bin/aleth --db memorydb --test -d aleth-test
aleth, a C++ Ethereum client
INFO  01-29 20:23:00      net    Id: ##0dc9654b…
aleth 1.5.2
$ test/soltest -- --ipcpath aleth-test/geth.ipc 
Running 2946 test cases...
/Users/alex/Projects/solidity/test/RPCSession.cpp:327: fatal error: in "SolidityAuctionRegistrar/creation": * Line 1, Column 35
  Syntax error: value, object or array expected.

/Users/alex/Projects/solidity/test/RPCSession.cpp:327: fatal error: in "SolidityAuctionRegistrar/reserve": * Line 1, Column 33
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:327: fatal error: in "SolidityAuctionRegistrar/double_reserve_long": * Line 1, Column 3
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:327: fatal error: in "SolidityAuctionRegistrar/properties": * Line 2, Column 1
  Extra non-whitespace after JSON value.

/Users/alex/Projects/solidity/test/RPCSession.cpp:292: fatal error: in "SolidityAuctionRegistrar/transfer": critical check rpcCall("test_rewindToBlock", { to_string(_blockNr) }) == true has failed
...

@axic
Copy link
Member Author

axic commented Jan 29, 2019

Running it twice stops cpp-ethereum.

Now after 4-6 connections attempts aleth just quits.

This leads me to believe it closes because the unix socket has shut down abruptly:

Process 24974 launched: '/Users/alex/Projects-Changes-ny/solidity/build2/bin/aleth' (x86_64)
aleth, a C++ Ethereum client
INFO  01-29 20:32:19      net    Id: ##7ad90101…
aleth 1.5.2
Mining Beneficiary: 00000000-0000-0000-0000-000000000000 - 031159df845ade415202e6da299223cb640b9db0
Networking disabled. To start, use netstart or pass --bootstrap or a remote host.
INFO  01-29 20:32:21      rpc    JSON-RPC socket path: aleth-test/geth.ipc
JSONRPC Admin Session Key: 5h6XlYJv5nM=
INFO  01-29 20:32:27      client Mining Beneficiary: @00000000…
INFO  01-29 20:32:27 eth  client Block sealed #1
INFO  01-29 20:32:27 eth  client 1 blocks imported in 1 ms (965.251 blocks/s) in #1
Process 24974 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGPIPE
    frame #0: 0x00007fff67f0cd82 libsystem_kernel.dylib`__semwait_signal + 10
libsystem_kernel.dylib`__semwait_signal:
->  0x7fff67f0cd82 <+10>: jae    0x7fff67f0cd8c            ; <+20>
    0x7fff67f0cd84 <+12>: movq   %rax, %rdi
    0x7fff67f0cd87 <+15>: jmp    0x7fff67f03b0e            ; cerror
    0x7fff67f0cd8c <+20>: retq   
Target 0: (aleth) stopped.

@axic
Copy link
Member Author

axic commented Feb 6, 2019

The actual underlying problem is that soltest has a very simple dumb implementation of JSON-RPC. It doesn't use a streaming JSON decoder nor tries to read up until JSON is parsed. It just reads one into a large enough (512K) buffer.

The problem is that for some reason on mac UNIX socket transmission is buffered, seemingly with 8K. This means we stop reading the response after 8K, which results in a short input in some test cases (especially where contract bytecode is returned).

@Marenz
Copy link
Contributor

Marenz commented Mar 25, 2019

It doesn't use a streaming JSON decoder nor tries to read up until JSON is parsed.

Could this also be the cause why our CI sometimes randomly fails in the RPCSession file?

@axic
Copy link
Member Author

axic commented Mar 25, 2019

It could be.

@Marenz Marenz changed the title Latest cpp-ethereum fails with Solidity tests Latest aleth fails with Solidity tests Mar 25, 2019
@leonardoalt
Copy link
Member

Is this still valid?

@ekpyron
Copy link
Member

ekpyron commented Jun 7, 2019

I haven't had any problems recently with aleth 1.6.0 and I'm not aware of anybody else having problems - should we close this?

@ekpyron
Copy link
Member

ekpyron commented Jun 7, 2019

I think this is fixed and obsolete and I'm closing it. Please re-open, if there's still any issues.

@ekpyron ekpyron closed this as completed Jun 7, 2019
@axic
Copy link
Member Author

axic commented Jun 7, 2019

Unless the RPC handling has been changed to properly handle different unix socket buffer sizes, than this problem persists.

@ekpyron
Copy link
Member

ekpyron commented Jun 7, 2019

Ok, I'm reopening until we have confirmation that it's fixed.

@ekpyron ekpyron reopened this Jun 7, 2019
@dantedallag
Copy link

I am new to contributing here and seem to be facing this same issue. I am running Mac 10.14.5. Has anyone else had any recent issues with this?

@chriseth
Copy link
Contributor

The tests are known to have issues on MacOS. The hope is that aleth won't be necessary at all in a few days. This will remove the need for aleth: #7010

Still, that PR has not yet been tested on MacOS...

@bshastry
Copy link
Contributor

Can this issue be closed once #7124 is merged?

@chriseth
Copy link
Contributor

It is not relevant anymore.

@axic
Copy link
Member Author

axic commented Nov 18, 2019

Was fixed by #7010.

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

No branches or pull requests

9 participants