Summary: | lldb crashes with asio acceptor::accept | ||
---|---|---|---|
Product: | Base System | Reporter: | ota |
Component: | bin | Assignee: | freebsd-toolchain (Nobody) <toolchain> |
Status: | Closed DUPLICATE | ||
Severity: | Affects Only Me | CC: | dim, emaste |
Priority: | --- | ||
Version: | 13.0-RELEASE | ||
Hardware: | i386 | ||
OS: | Any |
Description
ota
2021-08-14 05:06:29 UTC
Similar to in bug 253881, somehow this works perfectly fine for me: (lldb) target create "./a.out" Current executable set to '/share/dim/src/llvm/bugs/bug257829/a.out' (x86_64). (lldb) r Process 1220 launched: '/share/dim/src/llvm/bugs/bug257829/a.out' (x86_64) This version of LLDB has no plugin for the mipsassem language. Inspection of frame variables will be limited. Process 1220 stopped * thread #1, name = 'a.out', stop reason = signal SIGABRT frame #0: 0x0000000800519eea libc.so.7`__sys_thr_kill at thr_kill.S:4 (lldb) bt * thread #1, name = 'a.out', stop reason = signal SIGABRT * frame #0: 0x0000000800519eea libc.so.7`__sys_thr_kill at thr_kill.S:4 frame #1: 0x000000080048efc4 libc.so.7`__raise(s=6) at raise.c:52:10 frame #2: 0x00000008005438e9 libc.so.7`abort at abort.c:67:8 frame #3: 0x0000000800380ae9 libcxxrt.so.1`report_failure(err=<unavailable>, thrown_exception=0x0000000800a2d008) at exception.cc:719:5 frame #4: 0x000000000020ea74 a.out`void boost::throw_exception<boost::system::system_error>(e=0x00007fffffffe268) at throw_exception.hpp:70:5 frame #5: 0x000000000020e960 a.out`boost::asio::detail::do_throw_error(err=0x00007fffffffe3d8, location="bind") at throw_error.ipp:38:3 frame #6: 0x000000000020e8e0 a.out`boost::asio::detail::throw_error(err=0x00007fffffffe3d8, location="bind") at throw_error.hpp:42:5 frame #7: 0x000000000020d07d a.out`boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::executor>::basic_socket_acceptor<boost::asio::io_context>(this=0x00007fffffffe4a0, context=0x00007fffffffe4d0, endpoint=0x00007fffffffe480, reuse_addr=true, (null)=0x0000000000000000) at basic_socket_acceptor.hpp:285:5 frame #8: 0x000000000020c5e1 a.out`main at asio_accept.cpp:10:19 frame #9: 0x000000000020c310 a.out`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:73:7 (lldb) f 7 frame #7: 0x000000000020d07d a.out`boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::executor>::basic_socket_acceptor<boost::asio::io_context>(this=0x00007fffffffe4a0, context=0x00007fffffffe4d0, endpoint=0x00007fffffffe480, reuse_addr=true, (null)=0x0000000000000000) at basic_socket_acceptor.hpp:285:5 282 boost::asio::detail::throw_error(ec, "set_option"); 283 } 284 impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); -> 285 boost::asio::detail::throw_error(ec, "bind"); 286 impl_.get_service().listen(impl_.get_implementation(), 287 socket_base::max_listen_connections, ec); 288 boost::asio::detail::throw_error(ec, "listen"); I think there must be something different in our environment(s) that causes the error for you, and not me. *** This bug has been marked as a duplicate of bug 253881 *** A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c1a540709a83f810aa47380b946552ab20020374 commit c1a540709a83f810aa47380b946552ab20020374 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-08-16 16:56:41 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-08-16 16:57:24 +0000 Apply upstream lldb fix for unhandled Error causing abort Merge commit 5033f0793fe6 from llvm git (by Dimitry Andric): [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage When assertions are turned off, the `llvm::Error` value created at the start of this function is overwritten using the move-assignment operator, but the success value is never checked. Whenever a TypeSystem cannot be found or created, this can lead to lldb core dumping with: Program aborted due to an unhandled Error: Error value was Success. (Note: Success values must still be checked prior to being destroyed). Fix this by not creating a `llvm::Error` value in advance, and directly returning the result of `llvm::make_error` instead, whenever an error is encountered. See also: <https://bugs.freebsd.org/253881> and <https://bugs.freebsd.org/257829>. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D108088 Reported by: dmgk, ota@j.email.ne.jp PR: 253881, 257829 MFC after: 3 days .../llvm-project/lldb/source/Symbol/TypeSystem.cpp | 90 +++++++++------------- 1 file changed, 38 insertions(+), 52 deletions(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a949c6a0d6c83994471e33c8ea60f1509e691f6c commit a949c6a0d6c83994471e33c8ea60f1509e691f6c Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-08-16 16:56:41 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-08-20 16:21:46 +0000 Apply upstream lldb fix for unhandled Error causing abort Merge commit 5033f0793fe6 from llvm git (by Dimitry Andric): [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage When assertions are turned off, the `llvm::Error` value created at the start of this function is overwritten using the move-assignment operator, but the success value is never checked. Whenever a TypeSystem cannot be found or created, this can lead to lldb core dumping with: Program aborted due to an unhandled Error: Error value was Success. (Note: Success values must still be checked prior to being destroyed). Fix this by not creating a `llvm::Error` value in advance, and directly returning the result of `llvm::make_error` instead, whenever an error is encountered. See also: <https://bugs.freebsd.org/253881> and <https://bugs.freebsd.org/257829>. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D108088 Reported by: dmgk, ota@j.email.ne.jp PR: 253881, 257829 (cherry picked from commit c1a540709a83f810aa47380b946552ab20020374) .../llvm-project/lldb/source/Symbol/TypeSystem.cpp | 90 +++++++++------------- 1 file changed, 38 insertions(+), 52 deletions(-) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=456e2b149ecb1ea5f9e81b9b0733c7ec9526b8c2 commit 456e2b149ecb1ea5f9e81b9b0733c7ec9526b8c2 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-08-16 16:56:41 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-12-25 11:51:16 +0000 Apply upstream lldb fix for unhandled Error causing abort Merge commit 5033f0793fe6 from llvm git (by Dimitry Andric): [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage When assertions are turned off, the `llvm::Error` value created at the start of this function is overwritten using the move-assignment operator, but the success value is never checked. Whenever a TypeSystem cannot be found or created, this can lead to lldb core dumping with: Program aborted due to an unhandled Error: Error value was Success. (Note: Success values must still be checked prior to being destroyed). Fix this by not creating a `llvm::Error` value in advance, and directly returning the result of `llvm::make_error` instead, whenever an error is encountered. See also: <https://bugs.freebsd.org/253881> and <https://bugs.freebsd.org/257829>. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D108088 Reported by: dmgk, ota@j.email.ne.jp PR: 253881, 257829 MFC after: 3 days (cherry picked from commit c1a540709a83f810aa47380b946552ab20020374) .../llvm-project/lldb/source/Symbol/TypeSystem.cpp | 90 +++++++++------------- 1 file changed, 38 insertions(+), 52 deletions(-) |