From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id CC7013888826 for ; Wed, 7 Jul 2021 21:13:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC7013888826 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 167LDlJi005273 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Jul 2021 17:13:52 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 167LDlJi005273 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E48FB1E939; Wed, 7 Jul 2021 17:13:46 -0400 (EDT) Subject: Re: assertion error in pretty printing To: Jonah Graham , GDB Development References: From: Simon Marchi Message-ID: Date: Wed, 7 Jul 2021 17:13:46 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 7 Jul 2021 21:13:47 +0000 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2021 21:13:58 -0000 On 2021-07-07 2:34 p.m., Jonah Graham wrote: > Hi folks. > > I have an internal error in GDB that AFAICT is down to the python pretty > printers. This is being hit by CDT (reported in > https://bugs.eclipse.org/bugs/show_bug.cgi?id=574645) > > Doing a -var-update I get this internal error: > > ~"/scratch/gdb/binutils-gdb/gdb/c-varobj.c:516: internal-error: std::string > c_value_of_variable(const varobj*, varobj_display_formats): Assertion > `!value_lazy (var->value.get ())' failed.\nA problem internal to GDB has > been detected,\nfurther debugging may prove unreliable.\nQuit this > debugging session? (y or n) " > > Steps to reproduce: > > Get source from > https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=286726 > curl > https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=286726 >> bug574645.cpp > g++ -std=c++2a -O0 -g3 bug574645.cpp -o bug574645 > gdb --interpreter=mi2 > > then use these commands: > 6-enable-pretty-printing > 8-gdb-set print object on > 19-file-exec-and-symbols --thread-group i1 bug574645 > 26-break-insert -f bug574645.cpp:31 > 27-break-insert -t -f main > 29-exec-run --thread-group i1 > 41-var-create --thread 1 --frame 0 - * data2 > 44-var-list-children var1 0 1 > 48-exec-continue --thread 1 > 51-var-update 1 var1 > > If running with a locally built GDB the python pretty printers need to be > pointed at (e.g. add --data-directory=/usr/share/gdb to gdb command line) > > Where do I start debugging this? I have reproduced with latest HEAD of > gdb + the data directory on my Ubuntu 20.04 machine. Hi Jonah, First, maybe file a bug with that information. Then, I'm not sure what to say. You need to understand why this assert is there, why it is failing in this case, what lead up to this. Classic debugging / investigative work. I can't provide you with pointers in the code without looking at the problem myself (which I don't really have time to do), other than "check the backtrace at the point of the crash". Do you need guidance / tips on how to debug GDB with GDB? Thanks, Simon