From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 21B943858D39; Mon, 1 May 2023 12:09:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21B943858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682942982; bh=FztYTZpIpp8I8Pl2JnvG+a9/YuOxsClm16rGYXfkOy4=; h=From:To:Subject:Date:From; b=K1PVNrumEdCbUpcNYdvHegO+JdS4sXPwH2oz7bsBdW0iI9H92CTgn28dAUt3zSTu3 xhLo8dXafiMQfr0xZjIef48J1Cub0l3gc2bgUpyszmgdNZ0lquU5tKwA9i1A0+quGT rOMU8M3jMxMpiKebhj51iL4rj9607N+TCpvaLOkA= From: "tianyangyi at hit dot edu.cn" To: gdb-prs@sourceware.org Subject: [Bug rust/30410] New: bug in rust analyzer Date: Mon, 01 May 2023 12:09:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: rust X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tianyangyi at hit dot edu.cn 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 attachments.created 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30410 Bug ID: 30410 Summary: bug in rust analyzer Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: rust Assignee: unassigned at sourceware dot org Reporter: tianyangyi at hit dot edu.cn Target Milestone: --- Created attachment 14858 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D14858&action=3Ded= it a ELF file wrote in rust Analyzing the elf file in attachment, input some invalid operation like "p [$rdi]" will cause a bug. gdb output as the following. $ ./gdb buggy (gdb) p [$rdi] rust-parse.c:1361: internal-error: parse_binop: Assertion `!required' faile= d. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- 0x55788f1ddf80 gdb_internal_backtrace_1 /home/yty/study/binutils-gdb/gdb/bt-utils.c:122 0x55788f1ddf80 _Z22gdb_internal_backtracev /home/yty/study/binutils-gdb/gdb/bt-utils.c:168 0x55788f5f2a74 internal_vproblem /home/yty/study/binutils-gdb/gdb/utils.c:401 0x55788f5f2d30 _Z15internal_verrorPKciS0_P13__va_list_tag /home/yty/study/binutils-gdb/gdb/utils.c:481 0x55788f7479f4 _Z18internal_error_locPKciS0_z /home/yty/study/binutils-gdb/gdbsupport/errors.cc:58 0x55788f4ee489 _ZN11rust_parser11parse_binopEb /home/yty/study/binutils-gdb/gdb/rust-parse.c:1361 0x55788f4ee7a6 _ZN11rust_parser11parse_rangeEv /home/yty/study/binutils-gdb/gdb/rust-parse.c:1483 0x55788f4f02d8 _ZN11rust_parser10parse_exprEv /home/yty/study/binutils-gdb/gdb/rust-parse.c:1509 0x55788f4f02d8 _ZN11rust_parser17parse_entry_pointEv /home/yty/study/binutils-gdb/gdb/rust-parse.c:274 0x55788f4f02d8 _ZNK13rust_language6parserEP12parser_state /home/yty/study/binutils-gdb/gdb/rust-parse.c:2141 0x55788f446ac0 parse_exp_in_context /home/yty/study/binutils-gdb/gdb/parse.c:433 0x55788f446e0a _Z16parse_expressionPKcP23innermost_block_trackerb /home/yty/study/binutils-gdb/gdb/parse.c:469 0x55788f44bd75 process_print_command_args /home/yty/study/binutils-gdb/gdb/printcmd.c:1318 0x55788f44c32f print_command_1 /home/yty/study/binutils-gdb/gdb/printcmd.c:1332 0x55788f2134f4 _Z8cmd_funcP16cmd_list_elementPKci cli/cli-decode.c:2735 0x55788f584871 _Z15execute_commandPKci /home/yty/study/binutils-gdb/gdb/top.c:687 0x55788f306c34 _Z15command_handlerPKc /home/yty/study/binutils-gdb/gdb/event-top.c:619 0x55788f307f53 _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE /home/yty/study/binutils-gdb/gdb/event-top.c:855 0x55788f30769c gdb_rl_callback_handler /home/yty/study/binutils-gdb/gdb/event-top.c:249 0x55788f63ccc7 rl_callback_read_char /home/yty/study/binutils-gdb/readline/readline/callback.c:290 0x55788f3066cd gdb_rl_callback_read_char_wrapper_noexcept /home/yty/study/binutils-gdb/gdb/event-top.c:191 0x55788f307553 gdb_rl_callback_read_char_wrapper /home/yty/study/binutils-gdb/gdb/event-top.c:224 0x55788f305e9f stdin_event_handler /home/yty/study/binutils-gdb/gdb/event-top.c:544 0x55788f748455 gdb_wait_for_event /home/yty/study/binutils-gdb/gdbsupport/event-loop.cc:694 0x55788f748e85 gdb_wait_for_event /home/yty/study/binutils-gdb/gdbsupport/event-loop.cc:593 0x55788f748e85 _Z16gdb_do_one_eventi /home/yty/study/binutils-gdb/gdbsupport/event-loop.cc:264 0x55788f3e71b9 start_event_loop /home/yty/study/binutils-gdb/gdb/main.c:411 0x55788f3e71b9 captured_command_loop /home/yty/study/binutils-gdb/gdb/main.c:475 0x55788f3e8db4 captured_main /home/yty/study/binutils-gdb/gdb/main.c:1318 0x55788f3e8db4 _Z8gdb_mainP18captured_main_args /home/yty/study/binutils-gdb/gdb/main.c:1337 0x55788f12c0bf main /home/yty/study/binutils-gdb/gdb/gdb.c:32 --------------------- rust-parse.c:1361: internal-error: parse_binop: Assertion `!required' faile= d. A problem internal to GDB has been detected, further debugging may prove unreliable. My enviroment is Ubuntu 22.04 LTS. My gdb version is: $ gdb -v GNU gdb (GDB) 14.0.50.20230501-git Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Besides, on release version 12.1, there is also the same bug.Firstly I found the bug on my release version, and test it on the HEAD version, found the s= ame bug. $ gdb -v GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. I don't have the soure code of the attachment. It is wrote in rust. It is a challange named "babyheap" in Aliyun CTF. --=20 You are receiving this mail because: You are on the CC list for the bug.=