Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

RPC crashes when short U256 is passed without 0x #978

Closed
tomusdrw opened this issue Apr 20, 2016 · 0 comments
Closed

RPC crashes when short U256 is passed without 0x #978

tomusdrw opened this issue Apr 20, 2016 · 0 comments
Labels
F2-bug 🐞 The client fails to follow expected behavior.

Comments

@tomusdrw
Copy link
Collaborator

tomusdrw commented Apr 20, 2016

Exemplary payload:

{"id": 1000, "method": "eth_submitHashrate", "jsonrpc": "2.0", "params": ["2", "2"]}

Backtrace:

thread 'hyper-server' panicked at 'begin <= end (2 <= 1) when slicing `2`', ../src/libcore/str/mod.rs:1748
stack backtrace:
   1:     0x55b6c10a3a30 - std::sys::backtrace::tracing::imp::write::h714760a4c8c0cdd8
   2:     0x55b6c10a71bb - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hff309ab1d83ffd90
   3:     0x55b6c10a6e43 - std::panicking::default_hook::h08ad3bb09872855b
   4:     0x55b6c10930cf - std::sys_common::unwind::begin_unwind_inner::h406d5f1a330b854b
   5:     0x55b6c1094108 - std::sys_common::unwind::begin_unwind_fmt::h57ea3fbee1a40196
   6:     0x55b6c10a2c81 - rust_begin_unwind
   7:     0x55b6c10dd4bf - core::panicking::panic_fmt::ha6b3c19493c123b3
   8:     0x55b6c10e4a32 - core::str::slice_error_fail::h1687da40a2d30da1
   9:     0x55b6c01fae91 - core::str::traits::_<impl ops..Index<ops..RangeFrom<usize>> for str>::index::h093489da5568322b
                        at ../src/libcore/str/mod.rs:1491
  10:     0x55b6c0203173 - _<<util..U256 as serde..Deserialize>..deserialize..UintVisitor as serde..de..Visitor>::visit_str::h42270fe035eb5b78
                        at util/bigint/src/uint.rs:804
  11:     0x55b6c02030a4 - _<<util..U256 as serde..Deserialize>..deserialize..UintVisitor as serde..de..Visitor>::visit_string::h67682d4c76a9b496
                        at util/bigint/src/uint.rs:808
  12:     0x55b6c0202b0b - _<serde_json..value..Deserializer as serde..Deserializer>::deserialize::h5b14452bd65e191a
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/serde_json-0.7.0/src/value.rs:713
  13:     0x55b6c020285b - _<util..U256 as serde..Deserialize>::deserialize::h01a0a349c02bc814
                        at util/bigint/src/uint.rs:812
  14:     0x55b6c0202539 - _<serde_json..value..SeqDeserializer<'a> as serde..de..SeqVisitor>::visit::h89de19f6980a46a2
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/serde_json-0.7.0/src/value.rs:882
  15:     0x55b6c02aae91 - _<serde..de..impls..TupleVisitor2<T0, T1> as serde..de..Visitor>::visit_seq::hf31b53f922a3cc2d
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/serde-0.7.0/src/de/impls.rs:641
  16:     0x55b6c02aaa33 - _<serde_json..value..Deserializer as serde..Deserializer>::deserialize::h8295fa38513f21a3
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/serde_json-0.7.0/src/value.rs:716
  17:     0x55b6c02aa54b - serde::de::Deserializer::deserialize_seq::h573acc5c49e40f15
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/serde-0.7.0/src/de/mod.rs:335
  18:     0x55b6c02aa51f - serde::de::Deserializer::deserialize_tuple::h8779041ccc9cd3be
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/serde-0.7.0/src/de/mod.rs:432
  19:     0x55b6c02aa4e7 - serde::de::impls::_<impl serde..Deserialize for (T0, T1)>::deserialize::h4d4609812ded8c6a
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/serde-0.7.0/src/de/impls.rs:660
  20:     0x55b6c02aa107 - jsonrpc_core::util::from_params::h9f2bb2bfcb5ea9ff
                        at target/debug/build/jsonrpc-core-dfcbc1bf521cdc7f/out/lib.rs:2066
  21:     0x55b6c02a9a9b - _<rpc..v1..EthClient<C, S, A, M, EM> as rpc..v1..Eth>::submit_hashrate::h07be501e87aa9fb0
                        at rpc/src/v1/impls/eth.rs:469
  22:     0x55b6c02ab7a2 - fn(&rpc..v1..EthClient<ethcore..client..Client, ethsync..EthSync, util..keys..store..AccountService, ethminer..Miner>, jsonrpc_core..params..Params) .> std..result..Result<serde_json..value..Value, jsonrpc_core..error..Error> $u7b$$LT$rpc..v1..EthClient$LT$ethcore..client..Client$C$$u20$ethsync..EthSync$C$$u20$util..keys..store..AccountService$C$$u20$ethminer..Miner$GT$$u20$as$u20$rpc..v1..Eth$GT$..submit_hashrate$u7d$::fn_pointer_shim.23885::h9afeda09d82b2145
  23:     0x55b6c02a99cb - _<jsonrpc_core..io..DelegateMethod<T, F> as jsonrpc_core..commander..MethodCommand>::execute::hac3b1389320b780d
                        at target/debug/build/jsonrpc-core-dfcbc1bf521cdc7f/out/lib.rs:1920
  24:     0x55b6c05fa789 - jsonrpc_core::commander::Commander::execute_method::h07f419a142bfdc9a
                        at target/debug/build/jsonrpc-core-dfcbc1bf521cdc7f/out/lib.rs:1806
  25:     0x55b6c0603699 - jsonrpc_core::request_handler::RequestHandler::handle_method_call::hf0df6c246474f510
                        at target/debug/build/jsonrpc-core-dfcbc1bf521cdc7f/out/lib.rs:1882
  26:     0x55b6c06009a1 - jsonrpc_core::request_handler::RequestHandler::handle_call::hc69de9bc162e5022
                        at target/debug/build/jsonrpc-core-dfcbc1bf521cdc7f/out/lib.rs:1867
  27:     0x55b6c06001c4 - jsonrpc_core::request_handler::RequestHandler::handle_request::h0dba74569f3ab94f
                        at target/debug/build/jsonrpc-core-dfcbc1bf521cdc7f/out/lib.rs:1852
  28:     0x55b6c06422fd - jsonrpc_core::io::IoHandler::handle_request::h25aadc3725db632c
                        at target/debug/build/jsonrpc-core-dfcbc1bf521cdc7f/out/lib.rs:2021
  29:     0x55b6c04b2494 - _<ServerHandler as hyper..server..Handler<hyper..net..HttpStream>>::on_request_readable::h68e0512aad36e905
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/git/checkouts/jsonrpc-http-server-91fdd01fe01abea1/master/src/lib.rs:119
  30:     0x55b6c03ae6a7 - _<router..Router<A> as hyper..server..Handler<hyper..net..HttpStream>>::on_request_readable::he1e1dd3784cb6fc2
                        at webapp/src/router/mod.rs:76
  31:     0x55b6c03ae663 - _<hyper..server..message..Message<H, T> as hyper..http..conn..MessageHandler<T>>::on_decode::hde466ddde4b8d3e5
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/git/checkouts/hyper-8b41ea591f214abb/mio/src/server/message.rs:38
  32:     0x55b6c0390f64 - _<hyper..http..conn..Conn<T, H>>::read::h59de7d2e31a8d0b0
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/git/checkouts/hyper-8b41ea591f214abb/mio/src/http/conn.rs:242
  33:     0x55b6c03917bf - _<hyper..http..conn..Conn<T, H>>::read::h59de7d2e31a8d0b0
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/git/checkouts/hyper-8b41ea591f214abb/mio/src/http/conn.rs:262
  34:     0x55b6c038f586 - _<hyper..http..conn..Conn<T, H>>::read::h59de7d2e31a8d0b0
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/git/checkouts/hyper-8b41ea591f214abb/mio/src/http/conn.rs:147
  35:     0x55b6c038e077 - _<hyper..http..conn..Conn<T, H>>::on_readable::h78ac00446cd6af95
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/git/checkouts/hyper-8b41ea591f214abb/mio/src/http/conn.rs:495
  36:     0x55b6c038968d - _<hyper..http..conn..Conn<T, H>>::ready::he91c3ac8ce587903
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/git/checkouts/hyper-8b41ea591f214abb/mio/src/http/conn.rs:423
  37:     0x55b6c03882dd - _<hyper..server..ServerFsm<A, F, H> as rotor..machine..Machine>::ready::h0f519cdeab9df794
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/git/checkouts/hyper-8b41ea591f214abb/mio/src/server/mod.rs:140
  38:     0x55b6c03840ea - _<rotor..handler..Handler<M> as mio..handler..Handler>::ready::_$u7b$$u7b$closure$u7d$$u7d$::h04541ae7c4228a9a
  39:     0x55b6c03820a9 - rotor::handler::machine_loop::_$u7b$$u7b$closure$u7d$$u7d$::h7046bef0b007baf8
  40:     0x55b6c0381486 - _<slab..Slab<T, I>>::replace_with::hb5bc43b8d5b7a324
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/slab-0.1.3/src/lib.rs:186
  41:     0x55b6c0380d08 - rotor::handler::machine_loop::hd327339c6ff8f07e
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/rotor-0.6.3/src/handler.rs:102
  42:     0x55b6c0380c07 - _<rotor..handler..Handler<M> as mio..handler..Handler>::ready::hdf68b1c6f071824a
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/rotor-0.6.3/src/handler.rs:183
  43:     0x55b6c0380bb7 - _<mio..event_loop..EventLoop<H>>::io_event::he730cad8ec1fb715
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/mio-0.5.0/src/event_loop.rs:343
  44:     0x55b6c0380acd - _<mio..event_loop..EventLoop<H>>::io_process::ha7f8177850d08b05
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/mio-0.5.0/src/event_loop.rs:335
  45:     0x55b6c037fbf5 - _<mio..event_loop..EventLoop<H>>::run_once::hdb10055f67b910eb
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/mio-0.5.0/src/event_loop.rs:298
  46:     0x55b6c037f44c - _<mio..event_loop..EventLoop<H>>::run::h4c014ccbd9d01111
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/mio-0.5.0/src/event_loop.rs:247
  47:     0x55b6c037f367 - _<rotor..creator..LoopInstance<M>>::run::hac4c4609f4f8fc8d
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/rotor-0.6.3/src/creator.rs:126
  48:     0x55b6c037f286 - _<rotor..creator..LoopCreator<M>>::run::h49d638f93007918a
                        at /home/tomusdrw/.multirust/toolchains/nightly/cargo/registry/src/jackfan.us.kg-88ac128001ac3a9a/rotor-0.6.3/src/creator.rs:111
  49:     0x55b6c03674e6 - _<hyper..Server<hyper..net..HttpListener>>::handle::_$u7b$$u7b$closure$u7d$$u7d$::hef03ec53a2bf5d33
  50:     0x55b6c0366c7d - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hcf2c74704f7ed2d5
  51:     0x55b6c0366bc2 - std::sys_common::unwind::try::try_fn::h808084caa3d5afda
                        at ../src/libstd/sys/common/unwind/mod.rs:127
  52:     0x55b6c10a2c0b - __rust_try
  53:     0x55b6c10a2b9d - std::sys_common::unwind::inner_try::h4e97625a08807651
  54:     0x55b6c0366b0a - std::sys_common::unwind::try::h6ff680a651dcc048
                        at ../src/libstd/sys/common/unwind/mod.rs:123
  55:     0x55b6c03668f6 - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::h678ff762d39de452
  56:     0x55b6c03677f1 - _<F as std..boxed..FnBox<A>>::call_box::h0d2d413cfbbf9f4a
                        at ../src/liballoc/boxed.rs:541
  57:     0x55b6c10a5934 - std::sys::thread::Thread::new::thread_start::h74af400293164137
  58:     0x7f6e22910181 - start_thread
  59:     0x7f6e23e7347c - __clone
  60:                0x0 - <unknown>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F2-bug 🐞 The client fails to follow expected behavior.
Projects
None yet
Development

No branches or pull requests

1 participant