From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20535 invoked by alias); 25 Sep 2017 19:55:33 -0000 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 Received: (qmail 20264 invoked by uid 89); 25 Sep 2017 19:55:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*r:sk:gnu-gdb, Hx-languages-length:1332, H*r:gdb@gnu.org X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Sep 2017 19:55:31 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwZTV-0002el-5z for gdb@sourceware.org; Mon, 25 Sep 2017 15:55:30 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwZTV-0002eh-2g for gdb@sourceware.org; Mon, 25 Sep 2017 15:55:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44253) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dwZTU-00057G-Sf for gdb@gnu.org; Mon, 25 Sep 2017 15:55:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwZTR-0002dl-Mq for gdb@gnu.org; Mon, 25 Sep 2017 15:55:28 -0400 Received: from [195.159.176.226] (port=51952 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwZTR-0002cx-F8 for gdb@gnu.org; Mon, 25 Sep 2017 15:55:25 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dwZT6-0006s3-R8 for gdb@gnu.org; Mon, 25 Sep 2017 21:55:04 +0200 To: gdb@gnu.org From: Michael Stahl Subject: gdb 8.0 "lazy_string" exception "Length is larger than array size" Date: Mon, 25 Sep 2017 19:55:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 X-Mozilla-News-Host: news://news.gmane.org:119 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-SW-Source: 2017-09/txt/msg00116.txt.bz2 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