From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OOvnFyIGqGA7BQAAWB0awg (envelope-from ) for ; Fri, 21 May 2021 15:12:34 -0400 Received: by simark.ca (Postfix, from userid 112) id 5F9191F11C; Fri, 21 May 2021 15:12:34 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 60DE41E813 for ; Fri, 21 May 2021 15:12:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C3F1B384640D; Fri, 21 May 2021 19:12:32 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id ABBCA3857C56 for ; Fri, 21 May 2021 19:12:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABBCA3857C56 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1621624349; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wTBOnSqo4cW9TcLJHYWwcZPgvkbgk05iXJuBwm0+rnU=; b=JhGlLTGyeiVkXyzqfOejbzglGXMSL6dIWHcfq0HIpqNq1qh8Rr9QwMkMsEfpYjaRHv+9GL d8W1L+HzmxjtF9ACZs0VJwbl6vfKz5OGDKd8tL8qL2MB71TToP8dD9MYMSdoXOTi0ID6j3 yToyF/g1ZJW7QFE0wCPDVr0TyfoAM+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1621624349; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wTBOnSqo4cW9TcLJHYWwcZPgvkbgk05iXJuBwm0+rnU=; b=rgjIkc5Jq+oJkxH5LtGn9lJSb+lyue2MVQWqAOadqlaiPto/qbijCnmgfgwj66coRoW684 FKePTtgwrQcCqgBQ== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id CC974AAFD; Fri, 21 May 2021 19:12:29 +0000 (UTC) Subject: Re: [PATCH][gdb/breakpoint] Fix assert in jit_event_handler From: Tom de Vries To: Simon Marchi , gdb-patches@sourceware.org References: <20210520152938.GA31635@delia> <4c38f520-bc5d-f2d0-fa90-d60a2f2dd6a3@suse.de> Message-ID: <701d0072-b246-b5f2-3625-ddaf6de77aab@suse.de> Date: Fri, 21 May 2021 21:12:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <4c38f520-bc5d-f2d0-fa90-d60a2f2dd6a3@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Tromey Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 5/21/21 12:04 AM, Tom de Vries wrote: > On 5/20/21 6:22 PM, Simon Marchi wrote: >> On 2021-05-20 11:29 a.m., Tom de Vries wrote: >>> Hi, >>> >>> Consider a minimal test-case test.c: >>> ... >>> int main (void) { return 0; } >>> ... >>> which we can compile into llvm byte code using clang: >>> ... >>> $ clang -g -S -emit-llvm --target=x86_64-unknown-unknown-elf test.c >>> ... >>> and then run using lli, which uses the llvm jit: >>> ... >>> $ lli test.ll >>> ... >>> >>> If we run this under gdb, we run into an assert: >>> ... >>> $ gdb -q -batch -ex run --args /usr/bin/lli test.ll >>> Dwarf Error: Cannot not find DIE at 0x18a936e7 \ >>> [from module libLLVM.so.10-10.0.1-lp152.30.4.x86_64.debug] >> >> I guess that's unrelated, but do you know if that error is a sign of >> something wrong in GDB? >> > > I assumed not (the last binary I checked where that message occurred was > a case of invalid dwarf) but ... > > I did a readelf -wi and after 11G I did this grep: > ... > $ grep 18a936e7 READELF > <3><18a936e7>: Abbrev Number: 175 (DW_TAG_subprogram) > <18aa358f> DW_AT_specification: <0x18a936e7> > $ > ... > > So this looks like a GDB problem. > > I also did: > ... > $ gdb -q -readnow > /usr/lib/debug/usr/lib64/libLLVM.so.10-10.0.1-lp152.30.4.x86_64.debug > Reading symbols from > /usr/lib/debug/usr/lib64/libLLVM.so.10-10.0.1-lp152.30.4.x86_64.debug... > Expanding full symbols from > /usr/lib/debug/usr/lib64/libLLVM.so.10-10.0.1-lp152.30.4.x86_64.debug... > (gdb) > ... > so this could be something partial symbols related. > > A bit more info: > ... > Compilation Unit @ offset 0x18a23e52: > ... > <0><18a23e5d>: Abbrev Number: 1 (DW_TAG_compile_unit) > <18a23e5e> DW_AT_producer : clang version 10.0.1 > /home/abuild/rpmbuild/BUILD/llvm-10.0.1.src/stage1/bin/clang-10 > --driver-mode=g++ -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D > __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I lib/ExecutionEngine/Orc > -I ../lib/ExecutionEngine/Orc -I /usr/include/libxml2 -I include -I > ../include -fmessage-length=0 -grecord-command-line -O2 -Wall -D > _FORTIFY_SOURCE=0 -fstack-protector-strong -funwind-tables > -fasynchronous-unwind-tables -fstack-clash-protection -D NDEBUG -fPIC > -fvisibility-inlines-hidden -Wall -Wextra -Wno-unused-parameter > -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic > -Wno-long-long -Wimplicit-fallthrough -Wno-noexcept-type > -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion > -fdiagnostics-color -ffunction-sections -fdata-sections -flto=thin -O2 > -g -D NDEBUG -fno-exceptions -std=c++14 -MD -MT > lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/LLJIT.cpp.o -MF > lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/LLJIT.cpp.o.d -o > lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/LLJIT.cpp.o -c > ../lib/ExecutionEngine/Orc/LLJIT.cpp > <18a23e62> DW_AT_language : 33 (C++14) > <18a23e64> DW_AT_name : ../lib/ExecutionEngine/Orc/LLJIT.cpp > ... > <1><18a936d4>: Abbrev Number: 71 (DW_TAG_subprogram) > <2><18a936d5>: Abbrev Number: 174 (DW_TAG_class_type) > <18a936d7> DW_AT_calling_convention: 5 (pass by value) > <18a936d8> DW_AT_byte_size : 8 > <18a936d9> DW_AT_decl_file : 185 > <18a936da> DW_AT_decl_line : 78 > <3><18a936db>: Abbrev Number: 9 (DW_TAG_member) > <18a936dc> DW_AT_name : this > <18a936e0> DW_AT_type : <0x18a8bb20> > <18a936e4> DW_AT_decl_file : 185 > <18a936e5> DW_AT_decl_line : 78 > <18a936e6> DW_AT_data_member_location: 0 > <3><18a936e7>: Abbrev Number: 175 (DW_TAG_subprogram) > <18a936e9> DW_AT_name : operator() > <18a936ed> DW_AT_decl_file : 185 > <18a936ee> DW_AT_decl_line : 78 > <18a936ef> DW_AT_type : <0x18a557ad> > <18a936f3> DW_AT_declaration : 1 > <18a936f3> DW_AT_external : 1 > <18a936f3> DW_AT_accessibility: 1 (public) > > ... > > <1><18aa3589>: Abbrev Number: 251 (DW_TAG_subprogram) > <18aa358b> DW_AT_linkage_name: _ZZN4llvm10ThreadPool4waitEvENK3$_1clEv > <18aa358f> DW_AT_specification: <0x18a936e7> > <18aa3593> DW_AT_inline : 1 (inlined) > <18aa3594> DW_AT_object_pointer: <0x18aa3598> > ... > Compilation Unit @ offset 0x18aa33d6: > ... Filed here ( https://sourceware.org/bugzilla/show_bug.cgi?id=27898 ). Thanks, - Tom