From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28021 invoked by alias); 24 Nov 2013 07:31:41 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 27995 invoked by uid 48); 24 Nov 2013 07:31:40 -0000 From: "asmwarrior at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug python/12127] gdb with python support still get crash on showing uninitialized local variables Date: Sun, 24 Nov 2013 07:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: 7.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: asmwarrior at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-q4/txt/msg00385.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=12127 --- Comment #6 from asmwarrior --- OK, I think the pushed fix in Bug #16196 (https://sourceware.org/bugzilla/show_bug.cgi?id=16196#c2) should also fix this bug. Look at the crash report in comment 2, I have such backtrace: #0 malloc_failure (size=2009291924) at ../../gdb/gdb/utils.c:1049 #1 0x00634f3a in xmalloc (size=2009291924) at ../../gdb/gdb/common/common-utils.c:53 #2 0x004e4bc7 in read_string (addr=2293384, len=2009291924, width=1, fetchlimit=200, byte_order=BFD_ENDIAN_LITTLE, buffer=0x298f584, bytes_read=0x298f588) at ../../gdb/gdb/valprint.c:1804 #3 0x004e66f8 in val_print_string (elttype=0x4bad438, encoding=0x0, addr=2293384, len=2009291924, stream=0x2ec2f68, options=0x298f5e4) at ../../gdb/gdb/valprint.c:2475 #4 0x0046ecfe in print_string_repr (printer=0x31075f8, hint=0x58a91e8 "string", stream=0x2ec2f68, recurse=1, options=0x298f9d4, language=0x7ee360 , gdbarch=0x2ebd520) at ../../gdb/gdb/python/py-prettyprint.c:336 The final reason is that xmalloc(size=2009291924) get a two large and random size value. My fix in comment 5 try to limit the size in function print_string_repr(), which is located as 4th frame in the backtrace above. The fix in Bug #16196 did a better job, because it limit the size in read_string() function, which is second frame in the backtrace, so it fixed in a lower level. Many other cases which call read_string() is fixed now. I just build the current gdb git HEAD, and did some test again, GDB.exe did not crash on showing un-initialized variables. So, I personally think this bug is fixed now, what do you guys think? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.