From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4709 invoked by alias); 2 Sep 2013 23:40:58 -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 4687 invoked by uid 48); 2 Sep 2013 23:40:58 -0000 From: "sirnewton_01 at yahoo dot ca" To: gdb-prs@sourceware.org Subject: [Bug python/15924] New: Segmentation fault on Windows/Mingw with Go python library Date: Mon, 02 Sep 2013 23:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: 7.6 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sirnewton_01 at yahoo dot ca 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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-q3/txt/msg00309.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=15924 Bug ID: 15924 Summary: Segmentation fault on Windows/Mingw with Go python library Product: gdb Version: 7.6 Status: NEW Severity: normal Priority: P2 Component: python Assignee: unassigned at sourceware dot org Reporter: sirnewton_01 at yahoo dot ca After compiling gdb 7.6.1 on windows 7 32-bit using MingW (gcc 4.7.2) with python support (version 2.7, --with-python). A segmentation fault occurs when trying to use the "info goroutines" command when stopped at a breakpoint. Attaching another gdb to the original reveals the following stack trace that leads up to the segmentation fault: #0 0x0065c9bb in int_vasprintf (result=result@entry=0x2cff174, format=, format@entry=0x6c4fd0 <__PRETTY_FUNCTION__.19007+2255> "Attempt to extract a component of a value that is not a %s.", args=args@entry=0x2cff21c "") at ./vasprintf.c:129 #1 0x0065ca85 in vasprintf (result=result@entry=0x2cff174, format=format@entry=0x6c4fd0 <__PRETTY_FUNCTION__.19007+2255> "Attempt to ex tract a component of a value that is not a %s.", args=args@entry=0x2cff21c "") at ./vasprintf.c:160 #2 0x005c72cb in xstrvprintf ( format=format@entry=0x6c4fd0 <__PRETTY_FUNCTION__.19007+2255> "Attempt to ex tract a component of a value that is not a %s.", ap=ap@entry=0x2cff21c "") at ./common/common-utils.c:130 #3 0x004ef6fc in throw_it (reason=reason@entry=RETURN_ERROR, error=error@entry=GENERIC_ERROR, fmt=fmt@entry=0x6c4fd0 <__PRETTY_FUNCTION__.19007+2255> "Attempt to extract a component of a value that is not a %s.", ap=ap@entry=0x2cff21c "") at exceptions.c:400 #4 0x004efa63 in throw_verror (error=error@entry=GENERIC_ERROR, fmt=fmt@entry=0x6c4fd0 <__PRETTY_FUNCTION__.19007+2255> "Attempt to extract a component of a value that is not a %s.", ap=ap@entry=0x2cff21c "") at exceptions.c:429 #5 0x005a094f in error ( string=0x6c4fd0 <__PRETTY_FUNCTION__.19007+2255> "Attempt to extract a compo nent of a value that is not a %s.") at utils.c:717 #6 0x004b3715 in value_struct_elt (argp=argp@entry=0x2cff278, args=args@entry=0x0, name=name@entry=0x61a9968 "tab", static_memfuncp=static_memfuncp@entry=0x0, err=err@entry=0x0) at valops.c:2361 #7 0x00460bfd in valpy_getitem (self=0x456c440, key=0x45d66e0) at ./python/py-value.c:532 #8 0x1e07c54e in python27!PyObject_GetItem () from C:\Windows\system32\python27.dll #9 0x045d66e0 in ?? () #10 0x00000000 in ?? () The problem is in the value_struct_elt() where it sometimes has an err that is NULL and uses err for a formatted string without checking whether it can be NULL. A simple fix is to guard against the null like this: if (TYPE_CODE (t) != TYPE_CODE_STRUCT && TYPE_CODE (t) != TYPE_CODE_UNION) { if (err != NULL) { error (_("Attempt to extract a component of a value that is not a %s."), err); } else { error (_("Attempt to extract a component of a value that is not a .") ); } This fix appears solve my problem. The Go language runtime support script is successfully loaded. -- You are receiving this mail because: You are on the CC list for the bug.