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

Retrieving image from /api/content/<hash> results in a panic #2541

Closed
jacogr opened this issue Oct 9, 2016 · 0 comments
Closed

Retrieving image from /api/content/<hash> results in a panic #2541

jacogr opened this issue Oct 9, 2016 · 0 comments
Labels
F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust.

Comments

@jacogr
Copy link
Contributor

jacogr commented Oct 9, 2016

The following contenthash is problematic.

Hash: 0xd40679a3a234d8421c678d64f4df3308859e8ad07ac95ce4a228aceb96955287
Mapped: https://cdn.rawgit.com/ethcore/parity/2a074cb31210a283ca4b69ef289aae50ce9825a9/js/src/images/contracts/gavcoin-64x64.png

The above was registered with hintURL on the GitHubHint contract, the hash value was created via the ethcore_hashContent call

Running with -ldapps=trace and accessing http://localhost:8080/api/content/d40679a3a234d8421c678d64f4df3308859e8ad07ac95ce4a228aceb96955287 the following happens -

2016-10-09 10:14:45  IO Worker #1 INFO import      0/ 3/25 peers     37 MiB db  253 KiB chain    2 KiB queue   25 KiB sync
2016-10-09 10:15:06   TRACE dapps  Output: "0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063cf90d3f0410092fc0fca41846f596223979195000000000000000000000000000000000000000000000000000000000000007868747470733a2f2f63646e2e7261776769742e636f6d2f657468636f72652f7061726974792f326130373463623331323130613238336361346236396566323839616165353063653938323561392f6a732f7372632f696d616765732f636f6e7472616374732f676176636f696e2d36347836342e706e670000000000000000"
2016-10-09 10:15:06   TRACE dapps  Content unavailable. Fetching...
thread '<unnamed>' panicked at 'to_handler is called only when `contains` returns true.: Invalid character 'p' at position 1', ../src/libcore/result.rs:783
stack backtrace:
   1:        0x100daedca - std::sys::backtrace::tracing::imp::write::h46f28e67d38b4637
   2:        0x100db551f - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
   3:        0x100db44b5 - std::panicking::default_hook::h96c288d728df3ebf
   4:        0x100db4ac6 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   5:        0x100db4964 - std::panicking::begin_panic::hfbeda5aad583dc32
   6:        0x100db4882 - std::panicking::begin_panic_fmt::h4fe9fb9d5109c4bf
   7:        0x100db47e7 - rust_begin_unwind
   8:        0x100de2520 - core::panicking::panic_fmt::h4395919ece15c671
   9:        0x1004aa455 - core::result::unwrap_failed::h7cbd0e3f02e37a72
  10:        0x1004d907a - <ethcore_dapps::apps::fetcher::ContentFetcher<R>>::to_async_handler::hf37e50ec2078b7d7
  11:        0x1004fcaee - <ethcore_dapps::api::api::RestApiRouter as hyper::server::Handler<hyper::net::HttpStream>>::on_request::h38a9d42e219ae057
  12:        0x10048c3d6 - <hyper::server::message::Message<H, T> as hyper::http::conn::MessageHandler<T>>::on_incoming::ha78b62b412a218fa
  13:        0x1004c6f93 - <hyper::http::conn::ConnInner<K, T, H>>::read::hed9d1d4de46ed4e5
  14:        0x1004c203c - <hyper::http::conn::ConnInner<K, T, H>>::on_readable::h4575cac215c38c4a
  15:        0x1004bb915 - <hyper::http::conn::Conn<K, T, H>>::ready::hb9ca0ce507db2ad5
  16:        0x1004a1bd1 - <mio::event_loop::EventLoop<H>>::run_once::hfafd7a5986ac8296
  17:        0x1004adf6f - drop::h3921ca7d6e4738f3
  18:        0x100495acd - std::panicking::try::do_call::hf6ec48f92391feb7
  19:        0x100db5ada - __rust_maybe_catch_panic
  20:        0x1004b4436 - <F as alloc::boxed::FnBox<A>>::call_box::h9702439b75db2b85
  21:        0x100db3b64 - std::sys::thread::Thread::new::thread_start::h5b631f48cd23f128
  22:     0x7fff9523099c - _pthread_body
  23:     0x7fff95230919 - _pthread_start
2016-10-09 10:15:16  IO Worker #0 INFO import      0/ 3/25 peers     37 MiB db  253 KiB chain    2 KiB queue   25 KiB sync
^C2016-10-09 10:15:20  main INFO parity::run  Finishing work, please wait...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Closed', ../src/libcore/result.rs:783
stack backtrace:
   1:        0x100daedca - std::sys::backtrace::tracing::imp::write::h46f28e67d38b4637
   2:        0x100db551f - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
   3:        0x100db44b5 - std::panicking::default_hook::h96c288d728df3ebf
   4:        0x100db4ac6 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   5:        0x100db4964 - std::panicking::begin_panic::hfbeda5aad583dc32
   6:        0x100db4882 - std::panicking::begin_panic_fmt::h4fe9fb9d5109c4bf
   7:        0x100db47e7 - rust_begin_unwind
   8:        0x100de2520 - core::panicking::panic_fmt::h4395919ece15c671
   9:        0x1009da33a - core::result::unwrap_failed::hedf404a1e83ff1a1
  10:        0x1009f0520 - hyper::server::Listening::close::h8fbe7b7e6975cca5
  11:        0x100506fe4 - <ethcore_dapps::Server as core::ops::Drop>::drop::h47ebf42da7450a9b
  12:        0x100282672 - drop::h2fc9c645374b8f04
  13:        0x1003be1e2 - parity::run::execute::hf0bf4c81acdd02d0
  14:        0x1003d0e55 - parity::execute::h826e353d6b929bca
  15:        0x1003dd289 - parity::main::h1cb0abae157587a9
  16:        0x100db5ada - __rust_maybe_catch_panic
  17:        0x100db3ff6 - std::rt::lang_start::haaae1186de9de8cb

(Adding a leading 0x gives 404, so hash accesses without the hex indicator)

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. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

No branches or pull requests

1 participant