Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Stahl <mstahl@redhat.com>
To: gdb@gnu.org
Subject: gdb 8.0 "lazy_string" exception "Length is larger than array size"
Date: Mon, 25 Sep 2017 19:55:00 -0000	[thread overview]
Message-ID: <oqbdtj$nvc$1@blaine.gmane.org> (raw)


hi,

for the following string type:

  /** The implementation of a Unicode string.
  */
  typedef struct SAL_DLLPUBLIC_RTTI _rtl_uString
  {
      oslInterlockedCount refCount; /* opaque */
      sal_Int32           length;
      sal_Unicode         buffer[1];
  } rtl_uString;

the gdb python pretty-printer calls:

	return data.lazy_string(encoding, length)

full python pretty-printer module:

https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob;f=solenv/gdb/libreoffice/util/string.py;h=32583718f83b2ad5707f75dd6327d9aa62764439;hb=5f210715fe090b4db4c80dcdee5f77dc404cf85c#l56

now this results in this exception:

  Traceback (most recent call last):
    File "/work/lo/master/solenv/gdb/libreoffice/util/string.py", line
29, in to_string
      return self.make_string(data, self.encoding, len)
    File "/work/lo/master/solenv/gdb/libreoffice/util/string.py", line
66, in make_string
      return data.lazy_string(encoding, length)
  gdb.error: Length is larger than array size.

this is with Fedora 26 "GNU gdb (GDB) Fedora 8.0.1-26.fc26" - in Fedora
25 this did not throw an exception.

apparently the problem is that the array is statically declared as
"buffer[1]", however its actual dynamic size is the same as "length".

is this a bug in gdb or is lazy_string not intended to support this
scenario?

regards,
 michael


             reply	other threads:[~2017-09-25 19:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25 19:55 Michael Stahl [this message]
2017-09-26  7:56 ` Phil Muldoon
2017-09-26  8:06   ` Fwd: " Phil Muldoon
2017-09-26 10:30   ` Pedro Alves
2017-09-29 15:06     ` Michael Stahl

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='oqbdtj$nvc$1@blaine.gmane.org' \
    --to=mstahl@redhat.com \
    --cc=gdb@gnu.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