From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28286 invoked by alias); 15 Oct 2010 22:37:05 -0000 Received: (qmail 28212 invoked by uid 22791); 15 Oct 2010 22:37:04 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Oct 2010 22:36:58 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9FMardU028262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Oct 2010 18:36:53 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9FMarCh028101; Fri, 15 Oct 2010 18:36:53 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o9FMaqv7030081; Fri, 15 Oct 2010 18:36:52 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 3073AC883D5; Fri, 15 Oct 2010 16:36:51 -0600 (MDT) From: Tom Tromey To: asmwarrior Cc: gdb@sourceware.org, pmuldoon@redhat.com, andre.poenitz@nokia.com Subject: Re: gdb with python support still get crash on showing uninitialized local variables References: <4CB66700.3000907@gmail.com> Date: Fri, 15 Oct 2010 22:37:00 -0000 In-Reply-To: <4CB66700.3000907@gmail.com> (asmwarrior@gmail.com's message of "Thu, 14 Oct 2010 10:12:16 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00062.txt.bz2 >>>>> ">" == Asm gmail writes: >> Hi, I still get gdb crashed when showing local variables. >> stdStr = Traceback (most recent call last): >> File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 549, in >> to_string >> return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) >> OverflowError: long int too large to convert to int Interesting. Maybe a bug in valpy_lazy_string. Could you file this as a bug report? >> m = std::map with 2009251885 elementsTraceback (most recent call last): >> File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 353, in next >> n = self.rbiter.next() >> File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 297, in next >> if node.dereference()['_M_right']: >> RuntimeError: Attempt to dereference a generic pointer. I am going to guess g++ bug here, but I don't know for sure. ISTR an open bug where sometimes g++ erroneously emits "void *". >> stdStrRef = >> s = std::stack wrapping: std::deque with -521291805 elements = {> reading variable s (Cannot access memory at address 0x80)> I am working on a fix for this. Currently all gdb exceptions are convert to a Python RuntimeError. But, I think we should differentiate a little more. In particular, I think a gdb MEMORY_ERROR should be a separate class, and should be handled specially by the pretty-printing code (basically by omitting the stack trace). I think this, along with the default settings for limiting array and string print sizes, should solve most cases of "corrupt data makes gdb barf all over". >> 3. gdb bugzilla >> http://sourceware.org/bugzilla/show_bug.cgi?id=11407 I think this bug was specifically about errors causing the backtrace to stop too early. Please file bug reports when you run across oddities like these. Although it sometimes takes a while, we do try to address them all. Tom