Repository: rusoto/rusoto (language: rust)

Issue:
Rusoto hangs in RequestDispatcher::default()
I attempted to execute the S3 integration tests against Ceph and Minio when I notice that they hang. I tracked the issue down to `RequestDispatcher::default()` and I was able to create a short sample program that still shows the symptoms, see below.

Tried compilers:

* stable (1.24.1)
* beta (1.25.0-beta.9)
* nightly (2018-03-06)

OS:

```
user@dev:~/src/sample$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.4 (stretch)
Release:	9.4
Codename:	stretch
```

`Cargo.toml`:

```toml
[package]
name = "sample"
version = "0.1.0"

[dependencies]
rusoto_core = "0.32"
```

`src/main.rs`:

```rust
extern crate rusoto_core;

use rusoto_core::reactor::RequestDispatcher;

fn main() {
    RequestDispatcher::default();
}
```

Backtrace during hang:

```
user@dev:~/src/sample$ gdb target/debug/sample 
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/debug/sample...done.
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /home/user/src/sample/target/debug/sample.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) r
Starting program: /home/user/src/sample/target/debug/sample 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff65ff700 (LWP 9137)]
[New Thread 0x7ffff5fff700 (LWP 9138)]
^C
Thread 1 "sample" received signal SIGINT, Interrupt.
pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
185	../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: No such file or directory.
(gdb) i threads 
  Id   Target Id         Frame 
* 1    Thread 0x7ffff7fdc900 (LWP 9133) "sample" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  2    Thread 0x7ffff65ff700 (LWP 9137) "sample" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  3    Thread 0x7ffff5fff700 (LWP 9138) "sample" 0x00007ffff6be40c3 in epoll_wait ()
    at ../sysdeps/unix/syscall-template.S:84
(gdb) t 1
[Switching to thread 1 (Thread 0x7ffff7fdc900 (LWP 9133))]
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
185	in ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
(gdb) bt
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00005555557b18ea in std::sys::unix::condvar::Condvar::wait::h258f4673404f3baa (self=0x7ffff6621120, 
    mutex=0x7ffff66210f0) at /checkout/src/libstd/sys/unix/condvar.rs:78
#2  0x00005555557b17e2 in std::sys_common::condvar::Condvar::wait::hecd779dfde5720be (self=0x7ffff6621120, 
    mutex=0x7ffff66210f0) at /checkout/src/libstd/sys_common/condvar.rs:51
#3  0x00005555557b4e4e in std::sync::condvar::Condvar::wait::h6a3f6ae16df748a7 (self=0x7ffff6638028, guard=...)
    at /checkout/src/libstd/sync/condvar.rs:214
#4  0x00005555557aaf03 in futures::task_impl::std::ThreadNotify::park::hfa7a3b322be8a839 (self=0x7ffff6638010)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/std/mod.rs:536
#5  0x00005555555bda36 in futures::task_impl::std::_$LT$impl$u20$futures..task_impl..Spawn$LT$F$GT$$GT$::wait_future::_$u7b$$u7b$closure$u7d$$u7d$::h32e6180e1c2db1ed (notify=0x7ffff7fdc7f0)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/std/mod.rs:244
#6  0x00005555555bd3c7 in futures::task_impl::std::ThreadNotify::with_current::_$u7b$$u7b$closure$u7d$$u7d$::hfcda57e7c41f0b62 (notify=0x7ffff7fdc7f0)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/std/mod.rs:506
#7  0x00005555556090dd in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::try_with::he9ffd83855c003bd (self=0x555555b1b2f8, 
    f=...) at /checkout/src/libstd/thread/local.rs:290
#8  0x0000555555608abf in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::haef09526bcb0e1be (self=0x555555b1b2f8, 
    f=...) at /checkout/src/libstd/thread/local.rs:244
#9  0x00005555555bd37b in futures::task_impl::std::ThreadNotify::with_current::h48f8a741e729cd9f (f=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/std/mod.rs:506
#10 0x0000555555607724 in futures::task_impl::std::_$LT$impl$u20$futures..task_impl..Spawn$LT$F$GT$$GT$::wait_future::hc4b8b225c1932cf1 (self=0x7fffffffdd10)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/task_impl/std/mod.rs:240
#11 0x00005555555faec1 in futures::future::Future::wait::h588ace02bb73946f (self=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.18/src/future/mod.rs:299
#12 0x000055555558dbbc in rusoto_core::reactor::Reactor::new_responder::h252ff5ddc65100c0 (self=0x7ffff6621150, 
    make_responder=...) at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/rusoto_core-0.32.0/src/reactor.rs:233
#13 0x000055555558d847 in rusoto_core::reactor::Reactor::new_request_dispatcher::hd4870794766f71f9 (self=0x7ffff6621150, 
    make_dispatcher=...) at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/rusoto_core-0.32.0/src/reactor.rs:170
#14 0x000055555558d7bc in rusoto_core::reactor::Reactor::default_request_dispatcher::hd8de82ad4e6bc75f (self=0x7ffff6621150)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/rusoto_core-0.32.0/src/reactor.rs:162
#15 0x000055555558d773 in _$LT$rusoto_core..reactor..RequestDispatcher$u20$as$u20$core..default..Default$GT$::default::h18192a350fc08f96 () at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/rusoto_core-0.32.0/src/reactor.rs:81
#16 0x0000555555574b21 in sample::main::h5de16d0f9357e394 () at src/main.rs:6
#17 0x0000555555574912 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h0d08e73dc12c09da ()
    at /checkout/src/libstd/rt.rs:74
#18 0x00005555557c4c98 in std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h9b1ae3950cbcf231 ()
    at libstd/rt.rs:59
#19 std::panicking::try::do_call::h5b204018483b5fb4 () at libstd/panicking.rs:306
#20 0x00005555557cf86f in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:102
#21 0x00005555557c54a4 in std::panicking::try::h23f7820cac7f1dc5 () at libstd/panicking.rs:285
#22 std::panic::catch_unwind::he871242b8418bd5e () at libstd/panic.rs:361
#23 std::rt::lang_start_internal::haeef3e91efcb5dd3 () at libstd/rt.rs:58
#24 0x00005555555748f2 in std::rt::lang_start::h5aae39e283bc82ef (main=0x555555574b10 <sample::main::h5de16d0f9357e394>, 
    argc=1, argv=0x7fffffffe218) at /checkout/src/libstd/rt.rs:74
#25 0x0000555555574b5e in main ()
(gdb) t 2
[Switching to thread 2 (Thread 0x7ffff65ff700 (LWP 9137))]
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
185	in ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
(gdb) bt
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x000055555575e77a in std::sys::unix::condvar::Condvar::wait::h87332dd98c574e2c (self=0x7ffff600e030, 
    mutex=0x7ffff600e000) at /checkout/src/libstd/sys/unix/condvar.rs:78
#2  0x000055555575e732 in std::sys_common::condvar::Condvar::wait::h015d80a9f2e94576 (self=0x7ffff600e030, 
    mutex=0x7ffff600e000) at /checkout/src/libstd/sys_common/condvar.rs:51
#3  0x000055555576431e in std::sync::condvar::Condvar::wait::hecdf4745afbc0af0 (self=0x7ffff6011028, guard=...)
    at /checkout/src/libstd/sync/condvar.rs:214
#4  0x000055555575f095 in tokio_executor::park::Inner::park::h5e10787d2a21a0a7 (self=0x7ffff6011010, timeout=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.0/src/park.rs:258
#5  0x000055555575ed8e in _$LT$tokio_executor..park..ParkThread$u20$as$u20$tokio_executor..park..Park$GT$::park::_$u7b$$u7b$closure$u7d$$u7d$::hf4b77cd16bf3970a (inner=0x7ffff65ff5c0)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.0/src/park.rs:211
#6  0x000055555575ec78 in tokio_executor::park::ParkThread::with_current::_$u7b$$u7b$closure$u7d$$u7d$::h8e1ade16cd4caedb (
    inner=0x7ffff65ff5c0) at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.0/src/park.rs:197
#7  0x0000555555762cdb in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::try_with::hc52fc263a3e99d9d (self=0x555555b24ad8, 
    f=...) at /checkout/src/libstd/thread/local.rs:290
#8  0x00005555557624c5 in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::h368ee5350048382b (self=0x555555b24ad8, 
    f=...) at /checkout/src/libstd/thread/local.rs:244
#9  0x000055555575eb78 in tokio_executor::park::ParkThread::with_current::h19c37be87b8ea475 (self=0x7ffff65fe658, f=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.0/src/park.rs:197
#10 0x000055555575ed45 in _$LT$tokio_executor..park..ParkThread$u20$as$u20$tokio_executor..park..Park$GT$::park::hf9b80aa254ee3ef8 (self=0x7ffff65fe658)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.0/src/park.rs:211
#11 0x00005555556d22e8 in _$LT$tokio..executor..current_thread..Entered$LT$$u27$a$C$$u20$P$GT$$GT$::turn::h65bcd10e7caf4179
    (self=0x7ffff65fd540, duration=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.3/src/executor/current_thread/mod.rs:476
#12 0x00005555556df1e6 in tokio_core::reactor::Core::poll::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h59dad36b9bee1c66 ()
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.14/src/reactor/mod.rs:305
#13 0x00005555556cfa00 in _$LT$scoped_tls..ScopedKey$LT$T$GT$$GT$::set::he219ba953614bdca (
    self=0x555555b20588 <tokio_core::reactor::CURRENT_LOOP::ha0d6e06f1d24dfab>, t=0x7ffff65fe628, f=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.1/src/lib.rs:155
#14 0x00005555556df880 in tokio_core::reactor::Core::poll::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h51e7cc93e0ff9eba (enter=0x7ffff65fe4a8)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.14/src/reactor/mod.rs:304
#15 0x00005555556e3625 in tokio_executor::global::with_default::_$u7b$$u7b$closure$u7d$$u7d$::h92388d81fa76c1ed (
    cell=0x7ffff65ff5a8)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.0/src/global.rs:147
#16 0x00005555556f86ba in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::try_with::h4ed00582616029e1 (self=0x555555b20590, 
    f=...) at /checkout/src/libstd/thread/local.rs:290
#17 0x00005555556f7c1b in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::h8cc395e7990cea7d (self=0x555555b20590, 
    f=...) at /checkout/src/libstd/thread/local.rs:244
#18 0x00005555556e351b in tokio_executor::global::with_default::h2987b3079c7b15c5 (executor=0x7ffff65fe570, 
    enter=0x7ffff65fe4a8, f=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.0/src/global.rs:121
#19 0x00005555556e01dd in tokio_core::reactor::Core::poll::_$u7b$$u7b$closure$u7d$$u7d$::h0cae0d03276cdde2 (
    enter=0x7ffff65fe4a8)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.14/src/reactor/mod.rs:273
#20 0x00005555556e5c7d in tokio_reactor::with_default::_$u7b$$u7b$closure$u7d$$u7d$::h1b95b88a45af6cb4 (
    current=0x7ffff65ff588) at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.0/src/lib.rs:193
#21 0x00005555556f88c1 in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::try_with::h68a96a3528c86720 (self=0x555555b20638, 
    f=...) at /checkout/src/libstd/thread/local.rs:290
#22 0x00005555556f7c7b in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::h8f96c850705336d4 (self=0x555555b20638, 
    f=...) at /checkout/src/libstd/thread/local.rs:244
#23 0x00005555556e5b0f in tokio_reactor::with_default::hd2eb39107afaa1c9 (handle=0x7ffff65fe568, enter=0x7ffff65fe4a8, 
    f=...) at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.0/src/lib.rs:185
#24 0x00005555556deff4 in tokio_core::reactor::Core::poll::he99d5699eac7d5a2 (self=0x7ffff65fe628, max_wait=..., 
    handle=0x7ffff65fe568, sender=0x7ffff65fe570)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.14/src/reactor/mod.rs:272
#25 0x00005555556def04 in tokio_core::reactor::Core::turn::hccf6b8ef971056f9 (self=0x7ffff65fe628, max_wait=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.14/src/reactor/mod.rs:263
#26 0x000055555558d607 in rusoto_core::reactor::Reactor::spawn::_$u7b$$u7b$closure$u7d$$u7d$::he1918fc546697ad5 ()
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/rusoto_core-0.32.0/src/reactor.rs:64
#27 0x000055555557eaa5 in std::sys_common::backtrace::__rust_begin_short_backtrace::hbc2b8a71d0c66501 (f=...)
    at /checkout/src/libstd/sys_common/backtrace.rs:136
#28 0x0000555555604d1d in std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h25816ccd6---Type <return> to continue, or q <return> to quit---
8e09473 () at /checkout/src/libstd/thread/mod.rs:406
#29 0x00005555555b7145 in _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::hae81a46fe9b684be (self=..., _args=()) at /checkout/src/libstd/panic.rs:296
#30 0x00005555555ad622 in std::panicking::try::do_call::h1110238f24691376 (data=0x7ffff65feb90 "")
    at /checkout/src/libstd/panicking.rs:306
#31 0x00005555557cf86f in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:102
#32 0x00005555555ad210 in std::panicking::try::h3ddda5eeaf90c13e (f=...) at /checkout/src/libstd/panicking.rs:285
#33 0x00005555555b830c in std::panic::catch_unwind::hd762f13138eec8ad (f=...) at /checkout/src/libstd/panic.rs:361
#34 0x0000555555604b9d in std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::hfc53f1498c1cfe67 ()
    at /checkout/src/libstd/thread/mod.rs:405
#35 0x0000555555605258 in _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hd8e841e35ed43948 (
    self=0x7ffff661f020, args=()) at /checkout/src/liballoc/boxed.rs:783
#36 0x00005555557c77bc in _$LT$alloc..boxed..Box$LT$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hcd0ea510185709fe () at /checkout/src/liballoc/boxed.rs:793
#37 std::sys_common::thread::start_thread::hfba35d2ad0d49d2a () at libstd/sys_common/thread.rs:24
#38 std::sys::unix::thread::Thread::new::thread_start::h8e74ba576ba4f1cf () at libstd/sys/unix/thread.rs:90
#39 0x00007ffff70b8494 in start_thread (arg=0x7ffff65ff700) at pthread_create.c:333
#40 0x00007ffff6be3acf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
(gdb) t 3
[Switching to thread 3 (Thread 0x7ffff5fff700 (LWP 9138))]
#0  0x00007ffff6be40c3 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
84	../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) bt
#0  0x00007ffff6be40c3 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1  0x000055555576ff6b in mio::sys::unix::epoll::Selector::select::ha03406e8c3251c91 (self=0x7ffff6038010, 
    evts=0x7ffff5ffe7a8, awakener=..., timeout=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.14/src/sys/unix/epoll.rs:72
#2  0x00005555557667f4 in mio::poll::Poll::poll2::h88839299cc086c6b (self=0x7ffff6038010, events=0x7ffff5ffe7a8, 
    timeout=..., interruptible=false)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.14/src/poll.rs:1173
#3  0x000055555576655a in mio::poll::Poll::poll1::hf354ae56f058569d (self=0x7ffff6038010, events=0x7ffff5ffe7a8, 
    timeout=..., interruptible=false)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.14/src/poll.rs:1137
#4  0x0000555555765e88 in mio::poll::Poll::poll::hfc8454774a0bd615 (self=0x7ffff6038010, events=0x7ffff5ffe7a8, timeout=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.14/src/poll.rs:1008
#5  0x00005555557447fb in tokio_reactor::Reactor::poll::h087370a4113ee26a (self=0x7ffff5ffe7a8, max_wait=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.0/src/lib.rs:313
#6  0x0000555555744547 in tokio_reactor::Reactor::turn::h61b7fc218cdd7550 (self=0x7ffff5ffe7a8, max_wait=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.0/src/lib.rs:286
#7  0x000055555575536a in tokio_reactor::background::run::hcb1ae8bbb32e9c1b (reactor=..., shared=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.0/src/background.rs:204
#8  0x0000555555754a2e in tokio_reactor::background::Background::new::_$u7b$$u7b$closure$u7d$$u7d$::hcb97962473d1ce0e ()
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.0/src/background.rs:77
#9  0x0000555555753983 in std::sys_common::backtrace::__rust_begin_short_backtrace::ha7e654bedd123384 (f=...)
    at /checkout/src/libstd/sys_common/backtrace.rs:136
#10 0x0000555555748f87 in std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h9944981ea5831b11 () at /checkout/src/libstd/thread/mod.rs:406
#11 0x00005555557573d3 in _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::hb24ef993ba6b60b1 (self=..., _args=()) at /checkout/src/libstd/panic.rs:296
#12 0x0000555555756cb4 in std::panicking::try::do_call::h476d4d38a0258cc6 (data=0x7ffff5ffea38 "")
    at /checkout/src/libstd/panicking.rs:306
#13 0x00005555557cf86f in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:102
#14 0x0000555555756baa in std::panicking::try::hc9c44d7514ac61ae (f=...) at /checkout/src/libstd/panicking.rs:285
#15 0x00005555557578a8 in std::panic::catch_unwind::h4fd4b063b8ffa108 (f=...) at /checkout/src/libstd/panic.rs:361
#16 0x0000555555748dec in std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::he010334099f7d6a1 ()
    at /checkout/src/libstd/thread/mod.rs:405
#17 0x000055555574b668 in _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::ha565dcbee0945fd7 (
    self=0x7ffff6011180, args=()) at /checkout/src/liballoc/boxed.rs:783
#18 0x00005555557c77bc in _$LT$alloc..boxed..Box$LT$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hcd0ea510185709fe () at /checkout/src/liballoc/boxed.rs:793
#19 std::sys_common::thread::start_thread::hfba35d2ad0d49d2a () at libstd/sys_common/thread.rs:24
#20 std::sys::unix::thread::Thread::new::thread_start::h8e74ba576ba4f1cf () at libstd/sys/unix/thread.rs:90
#21 0x00007ffff70b8494 in start_thread (arg=0x7ffff5fff700) at pthread_create.c:333
#22 0x00007ffff6be3acf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
(gdb) 
```


Discussion / hints:
Great job reducing to the minimal example! 👍I can reproduce on OS X as well.

This seems to be a problem with `tokio-core` >= 0.1.13 (since it's based on the new `tokio` crate). `tokio-core` 0.1.12 works fine for me.

I'll dig a big further and might escalate to the tokio team if I can't find a fault on the rusoto side.
Appears to be a bug in tokio, I opened https://github.com/tokio-rs/tokio-core/issues/311 to track this on the tokio side.

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f5eaa73943..e4cc1cdb4e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
 (Please put an entry here in each PR)
 
 - More efficiently and correctly remove scheme from `Region::Custom` endpoints
+- Prevent reactor from hanging indefinitely when using the new tokio release
 
 ## [0.32.0] - 2018-03-03
 
diff --git a/rusoto/core/src/reactor.rs b/rusoto/core/src/reactor.rs
index 13b539cc216..52fec14fcba 100644
--- a/rusoto/core/src/reactor.rs
+++ b/rusoto/core/src/reactor.rs
@@ -20,7 +20,7 @@ use std::time::Duration;
 use std::thread;
 
 use futures::{Async, Future, Poll, Stream};
-use futures::future::{Either, ok};
+use futures::future::{Either, empty, ok};
 use futures::sync::{mpsc, oneshot};
 use tokio_core::reactor::{Core, Handle, Remote};
 
@@ -60,9 +60,7 @@ impl Reactor {
                 }
             };
 
-            loop {
-                core.turn(None);
-            }
+            core.run(empty::<(), ()>()).unwrap();
         });
 
         let remote = init_rx.wait()


Test patch: