[Bug 257829] lldb crashes with asio acceptor::accept

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 14 Aug 2021 05:06:29 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257829

            Bug ID: 257829
           Summary: lldb crashes with asio acceptor::accept
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: i386
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs_at_FreeBSD.org
          Reporter: ota_at_j.email.ne.jp

lldb crashes with the following program.
I have FreeBSD 13.0-RELEASE on i386 so far.
I also included gdb101's output for a comparison.

Please note that I run the program 2 times and lldb crashes with 2nd time when
the port# is already taken by the 1st run.

% cat asio_accept.cpp 
// c++ -g -std=c++03 -I/usr/local/include asio_accept.cpp -L/usr/local/lib
-lboost_system -lpthread

#include <boost/asio.hpp>

int main()
{
    using boost::asio::ip::tcp;

    boost::asio::io_service io_service;
    tcp::acceptor acceptor( io_service, tcp::endpoint( tcp::v4(), 1111 ) );
    tcp::socket socket( io_service );

    acceptor.accept( socket );
}

% c++ -g -std=c++03 -I/usr/local/include asio_accept.cpp -L/usr/local/lib
-lboost_system -lpthread
% ./a.out &
% lldb ./a.out
(lldb) target create "./a.out"
Current executable set to '/export/home/hiro/a.out' (i386).
(lldb) run
Process 84554 launching
Process 84554 launched: '/export/home/hiro/a.out' (i386)
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to
being destroyed).
PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the
crash backtrace.
#0 0x03874b54 PrintStackTrace
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:13
#1 0x03874f5e
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:624:3
#2 0x03872e6e RunSignalHandlers
/usr/src/contrib/llvm-project/llvm/lib/Support/Signals.cpp:67:5
#3 0x0387508c SignalHandler
/usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
#4 0x24a46319 handle_signal /usr/src/lib/libthr/thread/thr_sig.c:303:3
Abort


% gdb101 ./a.out 
GNU gdb (GDB) 10.1 [GDB v10.1 for FreeBSD]
Copyright (C) 2020 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 "i386-portbld-freebsd13.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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 ./a.out...
(gdb) run
Starting program: /export/home/hiro/a.out

Program received signal SIGABRT, Aborted.
thr_kill () at thr_kill.S:4
4       thr_kill.S: No such file or directory.
(gdb) bt
#0  thr_kill () at thr_kill.S:4
#1  0x20646e1b in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x206f233b in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x2055ddc6 in std::terminate ()
    at /usr/src/contrib/libcxxrt/exception.cc:1495
#4  0x2055e7ce in report_failure (err=<optimized out>,
    thrown_exception=thrown_exception_at_entry=0x207bd000)
    at /usr/src/contrib/libcxxrt/exception.cc:719
#5  0x2055e324 in throw_exception (ex=0x207bd000)
    at /usr/src/contrib/libcxxrt/exception.cc:778
#6  __cxa_throw (thrown_exception=0x207bd044,
    tinfo=0x402034 <typeinfo for
boost::wrapexcept<boost::system::system_error>>,
    dest=0x40e240
<boost::wrapexcept<boost::system::system_error>::~wrapexcept()>)
    at /usr/src/contrib/libcxxrt/exception.cc:801
#7  0x0040e0c1 in boost::throw_exception<boost::system::system_error> (e=...)
    at /usr/local/include/boost/throw_exception.hpp:70
#8  0x0040df9c in boost::asio::detail::do_throw_error (err=...,
    location=0x401ada "bind")
    at /usr/local/include/boost/asio/detail/impl/throw_error.ipp:38
#9  0x0040df08 in boost::asio::detail::throw_error (err=...,
    location=0x401ada "bind")
    at /usr/local/include/boost/asio/detail/throw_error.hpp:42
--Type <RET> for more, q to quit, c to continue without paging--
#10 0x0040c59a in boost::asio::basic_socket_acceptor<boost::asio::ip::tcp,
boost::asio::executor>::basic_socket_acceptor<boost::asio::io_context> (
    this=0xffbfe768, context=..., endpoint=..., reuse_addr=true)
    at /usr/local/include/boost/asio/basic_socket_acceptor.hpp:285
#11 0x0040baac in main () at asio_accept.cpp:10

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Sat Aug 14 2021 - 05:06:29 UTC

Original text of this message