Skip to content

Segmentation fault on macOS #1534

Closed
Closed
@logaritmisk

Description

@logaritmisk

Hi and thanks for an awesome crate!

With the latest version of hyper (0.12.0) I get a strange crash with this simple example code.

extern crate futures;
extern crate hyper;

use futures::Future;
use hyper::service::service_fn;
use hyper::{Client, Server};

fn main() {
    let addr = ([0, 0, 0, 0], 3000).into();

    let client = Client::new();

    let new_svc = move || {
        let client = client.clone();

        service_fn(move |_| client.get("http://www.w6rz.net/newmobcal1920.ts".parse().unwrap()))
    };

    let server = Server::bind(&addr)
        .serve(new_svc)
        .map_err(|e| eprintln!("server error: {}", e));

    hyper::rt::run(server);
}

Everything compiles, but when I try to call the server with:

$ curl -v 'localhost:3000' > /dev/null

It crashes.

This is the details I get: https://gist.github.com/logaritmisk/22d5202559e1d1c52e4f69d6ce4e4262

Strange thing is that it works when I don't compile with the release profile or if I use the current nightly.

I think this is the commit that "broke" my example.

It works on:

  • stable - debug
  • beta - debug
  • nightly - release

Versions of rustc:

  • rustc 1.26.1 (827013a31 2018-05-25)
  • rustc 1.27.0-beta.8 (fe75e4464 2018-05-26)
  • rustc 1.28.0-nightly (4ecf12bf0 2018-06-02)

Let me know if you want more information of if there is something I should test :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-upstreamBlocked: needs a change in a dependency or the compiler.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions