From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9404F3857C42; Fri, 14 Aug 2020 06:50:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9404F3857C42 From: "dns.botond at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/26387] New: Assertion `!frame_id_eq (*this_id, outer_frame_id)' failed triggered when backtracing a green thread Date: Fri, 14 Aug 2020 06:50:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dns.botond at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2020 06:50:58 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26387 Bug ID: 26387 Summary: Assertion `!frame_id_eq (*this_id, outer_frame_id)' failed triggered when backtracing a green thread Product: gdb Version: 9.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ Assignee: unassigned at sourceware dot org Reporter: dns.botond at gmail dot com Target Milestone: --- When backtracing inside a seastar::thread, a green thread implementation, g= db fails as below: (gdb) bt #0 thread_bar (hours=3D10) at exp.cpp:6 #1 0x0000000000426ef1 in thread_foo (hours=3D10) at exp.cpp:10 #2 0x0000000000426f0d in thread_main () at exp.cpp:15 #3 0x0000000000426f21 in operator() (__closure=3D0x600000084250) at exp.cp= p:22 #4 0x00000000004287d1 in std::__invoke_impl:: >(std::__invoke_other, struct {...} &&) (__f=3D...) at /usr/include/c++/10/bits/invoke.h:60 #5 0x0000000000428210 in std::__invoke:: >(struct {...} &&) (__fn=3D...) at /usr/include/c++/10/bits/invoke.h:95 #6 0x0000000000427a92 in std::__apply_impl::, std::tuple<> >(struct {...} &&, std::tuple= <> &&, std::index_sequence) (__f=3D..., __t=3D...) at /usr/include/c++/10/tupl= e:1723 #7 0x0000000000427acc in std::apply::, std::tuple<> >(struct {...} &&, std::tuple<> &&) (__f=3D..., __t=3D...) at /usr/include/c++/10/tuple:1734 #8 0x0000000000427b0f in seastar::futurize::apply:: >(struct {...} &&, std::tuple<> &&) (func= =3D..., args=3D...) at /home/bdenes/ScyllaDB/seastar/include/seastar/core/future.hh= :1989 #9 0x000000000042722f in operator() (this=3D0x60000019b3a0) at /home/bdenes/ScyllaDB/seastar/include/seastar/core/thread.hh:259 #10 0x0000000000428db1 in seastar::noncopyable_function::direct_vtable_for::, {}>:: >::call(const seastar::noncopyable_function *) ( ../../gdb/inline-frame.c:159: internal-error: void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion `!frame_id_= eq (*this_id, outer_frame_id)' failed. The stacktrace should have one more frame, seastar::thread::main(), which is the entry point of the green thread, and which is annotated with `asm(".cfi_undefined rip")`, as follows: ```c++ 6 void=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 5 thread_context::main() {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 4 #ifdef __x86_64__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 3 // There is no caller of main() in this context. We need to annotate this frame like this so that=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 2 // unwinders don't try to trace back past this frame.=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 1 // See https://github.com/scylladb/scylla/issues/1909.=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 284 asm(".cfi_undefined rip");=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 1 #elif defined(__PPC__)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 2 asm(".cfi_undefined lr");=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 3 #elif defined(__aarch64__)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 4 asm(".cfi_undefined x30");=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 5 #else=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 6 #warning "Backtracing from seastar threads may be broken"=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 7 #endif=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 8 _context.initial_switch_in_completed();=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 9 if (group() !=3D current_scheduling_group()) {=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 10 yield();=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 11 }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 12 try {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 13 _func();=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 14 _done.set_value();=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 15 } catch (...) {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 16 _done.set_exception(std::current_exception());=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 17 }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 18=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 19 _context.final_switch_out();=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 20 }=20 ``` gdb stacktrace: (gdb) bt #0 0x00007f701b4909e5 in raise () from /lib64/libc.so.6 #1 0x00007f701b479895 in abort () from /lib64/libc.so.6 #2 0x000055730247169d in dump_core() () #3 0x0000557302477365 in internal_vproblem(internal_problem*, char const*, int, char const*, __va_list_tag*) () #4 0x0000557302477581 in internal_verror(char const*, int, char const*, __va_list_tag*) () #5 0x00005573021e91a5 in internal_error(char const*, int, char const*, ...= ) () #6 0x0000557302256ee6 in inline_frame_this_id(frame_info*, void**, frame_i= d*) () #7 0x00005573021cecca in compute_frame_id(frame_info*) () #8 0x00005573021cf308 in get_prev_frame_if_no_cycle(frame_info*) () #9 0x00005573021d1780 in get_prev_frame_always(frame_info*) () #10 0x00005573021d2b4d in get_frame_unwind_stop_reason(frame_info*) () #11 0x0000557302167315 in dwarf2_frame_cfa(frame_info*) () #12 0x000055730216e3ed in dwarf_expr_context::execute_stack_op(unsigned char const*, unsigned char const*) () #13 0x000055730216e9f6 in dwarf_expr_context::execute_stack_op(unsigned char const*, unsigned char const*) () #14 0x000055730216f5a8 in dwarf_expr_context::eval(unsigned char const*, unsigned long) () #15 0x0000557302172598 in dwarf2_evaluate_loc_desc_full(type*, frame_info*, unsigned char const*, unsigned long, dwarf2_per_cu_data*, type*, long) () #16 0x0000557302173175 in locexpr_read_variable(symbol*, frame_info*) () #17 0x00005573023d90d4 in read_frame_arg(frame_print_options const&, symbol= *, frame_info*, frame_arg*, frame_arg*) () #18 0x00005573023d9c35 in print_frame_args(frame_print_options const&, symb= ol*, frame_info*, int, ui_file*) () #19 0x00005573023dd7f9 in print_frame_info(frame_print_options const&, frame_info*, int, print_what, int, int) () #20 0x00005573023de898 in backtrace_command(char const*, int) () #21 0x0000557302101b4a in cmd_func(cmd_list_element*, char const*, int) () #22 0x00005573024352ed in execute_command(char const*, int) () #23 0x00005573021bdf25 in command_handler(char const*) () #24 0x00005573021bf321 in command_line_handler(std::unique_ptr >&&) () #25 0x00005573021be852 in gdb_rl_callback_handler(char*) () #26 0x00007f701c1b90ae in rl_callback_read_char () from /lib64/libreadline.= so.8 #27 0x00005573021bda46 in gdb_rl_callback_read_char_wrapper_noexcept() () #28 0x00005573021be705 in gdb_rl_callback_read_char_wrapper(void*) () #29 0x00005573021bd898 in stdin_event_handler(int, void*) () #30 0x00005573021bc6f6 in gdb_wait_for_event(int) [clone .part.0] () #31 0x00005573021bcad0 in gdb_do_one_event() () #32 0x00005573021bcba5 in start_event_loop() () #33 0x00005573022912cb in captured_command_loop() () #34 0x0000557302293b65 in gdb_main(captured_main_args*) () #35 0x0000557302039550 in main () I attached the gdb coredump, the application (and its source) that reproduc= es the bug. To build the application build seastar, then: $ g++ exp.cpp $(pkg-config --libs --cflags --static /home/bdenes/ScyllaDB/seastar/build/release/seastar.pc) -O0 -g -std=3Dc++20 -Wfatal-errors -o exp $ gdb ./exp (gdb) b exp.cpp:11 (gdb) r (gdb) bt --=20 You are receiving this mail because: You are on the CC list for the bug.=