chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.85k stars 1.2k forks source link

Segmentation fault when using get_associated_executor on 1.81(regression from 1.80) #1246

Closed Snarpix closed 1 year ago

Snarpix commented 1 year ago

When I run following code compiled with -O1 or higher I'm getting a SEGV Issue appears in boost 1.81, no problem in 1.80 according to godbolt.

#include <boost/asio.hpp>

using namespace boost::asio;

int main() {
    io_service io;
    auto ex = get_associated_executor([]{}, io);
    auto guard = make_work_guard(ex);
}

Godbolt

Either I'm using get_associated_executor incorrectly, or this is a bug.

Snarpix commented 1 year ago

Looks like it was fixed in https://github.com/chriskohlhoff/asio/commit/c6e548d74ca6bdd8514c832f94fedf6972230784