From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74241 invoked by alias); 7 Aug 2017 21:34:35 -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 74216 invoked by uid 89); 7 Aug 2017 21:34:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:4278 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Aug 2017 21:34:28 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v77LYMa9029933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 7 Aug 2017 17:34:26 -0400 Received: by simark.ca (Postfix, from userid 112) id F27051EA1C; Mon, 7 Aug 2017 17:34:21 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id DF50E1E043; Mon, 7 Aug 2017 17:34:00 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 07 Aug 2017 21:34:00 -0000 From: Simon Marchi To: Alex Lindsay Cc: Philippe Waroquiers , Yao Qi , gdb@sourceware.org Subject: Re: Large memory usage by gdb In-Reply-To: <6b67f471-90f4-7b37-c9f6-18dfd8e5cdfd@gmail.com> References: <420b109c-1610-d687-ae9a-b172542fafca@gmail.com> <6f204cea-21bf-3f70-aa61-df02aeba8a24@gmail.com> <86mv7b20z2.fsf@gmail.com> <1502135603.1467.33.camel@skynet.be> <6b67f471-90f4-7b37-c9f6-18dfd8e5cdfd@gmail.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 7 Aug 2017 21:34:22 +0000 X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00017.txt.bz2 On 2017-08-07 23:04, Alex Lindsay wrote: > Yes, I've also seen all those errors. I wrote them off to errors in > the python library but maybe I should have looked more closely > > On 08/07/2017 02:53 PM, Philippe Waroquiers wrote: >> On Mon, 2017-08-07 at 10:14 +0100, Yao Qi wrote: >> >>> leaks are bugs, and we should fix them. I can find these leaks in >>> valgrind too, >> When running valgrind + gdb on a small program, I also get >> many errors like the below (GDB 8.0, Debian 8). >> >> Do you also see that ? >> >> >> Philippe >> >> ==9360== Invalid read of size 4 >> ==9360== at 0x58AD9F3: PyObject_Free (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x4C5E7F: gdb_Py_DECREF (python-internal.h:194) >> ==9360== by 0x4C5E7F: decref (py-ref.h:36) >> ==9360== by 0x4C5E7F: ~ref_ptr (gdb_ref_ptr.h:91) >> ==9360== by 0x4C5E7F: unicode_to_encoded_string(_object*, char >> const*) (py-utils.c:74) >> ==9360== by 0x4C5F9C: python_string_to_host_string(_object*) >> (py-utils.c:158) >> ==9360== by 0x4BBDDD: get_doc_string(_object*, _object*) >> (py-param.c:314) >> ==9360== by 0x4BC11D: parmpy_init(_object*, _object*, _object*) >> (py-param.c:707) >> ==9360== by 0x580AD5B: ??? (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x5899BE2: PyObject_Call (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x58CD441: PyEval_EvalFrameEx (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x594218F: PyEval_EvalCodeEx (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x589132B: ??? (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x5899BE2: PyObject_Call (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x58DC0E4: ??? (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== Address 0x6f0c020 is 1,280 bytes inside a block of size >> 3,133 free'd >> ==9360== at 0x4C29B8A: realloc (vg_replace_malloc.c:785) >> ==9360== by 0x5862625: _PyString_Resize (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x57E40AC: PyUnicodeUCS4_EncodeUTF8 (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x5848A98: ??? (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x5899BE2: PyObject_Call (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x59416E6: PyEval_CallObjectWithKeywords (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x5906C4D: PyCodec_Encode (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x57E4AB4: PyUnicodeUCS4_AsEncodedString (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x4C5E44: unicode_to_encoded_string(_object*, char >> const*) (py-utils.c:74) >> ==9360== by 0x4C5F9C: python_string_to_host_string(_object*) >> (py-utils.c:158) >> ==9360== by 0x4BBDDD: get_doc_string(_object*, _object*) >> (py-param.c:314) >> ==9360== by 0x4BC11D: parmpy_init(_object*, _object*, _object*) >> (py-param.c:707) >> ==9360== Block was alloc'd at >> ==9360== at 0x4C27BF5: malloc (vg_replace_malloc.c:299) >> ==9360== by 0x5864249: PyString_FromStringAndSize (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x57E41C6: PyUnicodeUCS4_EncodeUTF8 (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x5848A98: ??? (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x5899BE2: PyObject_Call (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x59416E6: PyEval_CallObjectWithKeywords (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x5906C4D: PyCodec_Encode (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x57E4AB4: PyUnicodeUCS4_AsEncodedString (in >> /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0) >> ==9360== by 0x4C5E44: unicode_to_encoded_string(_object*, char >> const*) (py-utils.c:74) >> ==9360== by 0x4C5F9C: python_string_to_host_string(_object*) >> (py-utils.c:158) >> ==9360== by 0x4BBDDD: get_doc_string(_object*, _object*) >> (py-param.c:314) >> ==9360== by 0x4BC11D: parmpy_init(_object*, _object*, _object*) >> (py-param.c:707) >> >> This is expected with Python: https://svn.python.org/projects/python/trunk/Misc/README.valgrind Simon