public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "sirnewton_01 at yahoo dot ca" <sourceware-bugzilla@sourceware.org>
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	[thread overview]
Message-ID: <bug-15924-4717@http.sourceware.org/bugzilla/> (raw)

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=<optimized out>,
    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
<NULL>.")
       );
    }

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.


             reply	other threads:[~2013-09-02 23:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02 23:40 sirnewton_01 at yahoo dot ca [this message]
2014-02-13 20:44 ` [Bug python/15924] " dje at google dot com
2022-12-01 21:50 ` tromey at sourceware dot org
2022-12-01 21:54 ` tromey at sourceware dot org
2022-12-06 15:18 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-15924-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).