From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14751 invoked by alias); 16 Oct 2014 15:04:07 -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 14738 invoked by uid 89); 16 Oct 2014 15:04:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,MIME_BASE64_BLANKS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: ausxippc101.us.dell.com Received: from ausxippc101.us.dell.com (HELO ausxippc101.us.dell.com) (143.166.85.207) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 16 Oct 2014 15:04:05 +0000 X-LoopCount0: from 10.175.216.249 From: To: CC: , Subject: Re: recursion limit exceeded in Python API, but there's only one function in traceback Date: Thu, 16 Oct 2014 15:04:00 -0000 Message-ID: <7BB30632-15BE-4EF8-B84F-D35A27772F18@dell.com> References: <543FBDFF.3050709@redhat.com> <104DEFBD-D686-4290-8E3C-725A51C165E6@dell.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-ID: <3C854D0D8F8C0E41971FB2F30F67C62B@dell.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00044.txt.bz2 SXMgdGhhdCB0aGUgaGFuZGxlciBmb3IgYSBicmVha3BvaW50PyAgRG9lcyB0 aGUgY29tcGxldGlvbiBvZiB0aGUg4oCcc2nigJ0gY29tbWFuZCBpbnZva2Ug dGhlIGJyZWFrcG9pbnQgaGFuZGxlcj8gIElmIHllcywgdGhhdOKAmXMgeW91 ciBhbnN3ZXIuDQoNCglwYXVsDQoNCk9uIE9jdCAxNiwgMjAxNCwgYXQgMTA6 NTUgQU0sIMOWbWVyIFNpbmFuIEHEn2FjYW4gPG9tZXJhZ2FjYW5AZ21haWwu Y29tPiB3cm90ZToNCg0KPiBUaGFua3MgZm9yIHRpcHMuIEkgbWFuYWdlZCB0 byBibG93IHRoZSBzdGFjayB1c2luZyBhIG1pbmltYWwgc2NyaXB0Lg0KPiBI ZXJlJ3MgdGhlIGNvZGU6DQo+IA0KPiAgaW1wb3J0IGdkYg0KPiAgaW1wb3J0 IHRyYWNlYmFjaw0KPiANCj4gIGRlZiBoYW5kbGVyKGV2KToNCj4gICAgICB0 cnk6DQo+ICAgICAgICAgIHByaW50ICJoYW5kbGluZyBhIHN0b3AiDQo+ICAg ICAgICAgIGdkYi5leGVjdXRlKCJzaSIpDQo+ICAgICAgICAgIGdkYi5leGVj dXRlKCJjIikNCj4gICAgICBleGNlcHQ6DQo+ICAgICAgICAgIHRyYWNlYmFj ay5wcmludF9zdGFjaygpDQo+IA0KPiAgZ2RiLmV2ZW50cy5zdG9wLmNvbm5l Y3QoaGFuZGxlcikNCj4gDQo+IE91dHB1dDoNCj4gDQo+ICBbLi4uc25pcC4u Ll0= >From gdb-return-43790-listarch-gdb=sources.redhat.com@sourceware.org Thu Oct 16 15:13:19 2014 Return-Path: Delivered-To: listarch-gdb@sources.redhat.com Received: (qmail 23638 invoked by alias); 16 Oct 2014 15:13:18 -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 Delivered-To: mailing list gdb@sourceware.org Received: (qmail 23628 invoked by uid 89); 16 Oct 2014 15:13:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 16 Oct 2014 15:13:17 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9GFCq0p005963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 Oct 2014 11:12:52 -0400 Received: from localhost.localdomain (ovpn-112-31.ams2.redhat.com [10.36.112.31]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9GFCosg013200; Thu, 16 Oct 2014 11:12:51 -0400 Message-ID: <543FE072.6040507@redhat.com> Date: Thu, 16 Oct 2014 15:13:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Paul_Koning@dell.com CC: omeragacan@gmail.com, gdb@sourceware.org Subject: Re: recursion limit exceeded in Python API, but there's only one function in traceback References: <543FBDFF.3050709@redhat.com> <104DEFBD-D686-4290-8E3C-725A51C165E6@dell.com> In-Reply-To: <104DEFBD-D686-4290-8E3C-725A51C165E6@dell.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00045.txt.bz2 Content-length: 1447 On 16/10/14 15:28, Paul_Koning@dell.com wrote: > On Oct 16, 2014, at 8:45 AM, Phil Muldoon wrote: > >> On 16/10/14 11:45, Ömer Sinan Ağacan wrote: >>> Hi all, >>> >>> I'm putting some breakpoints and then running some actions when >>> program reaches that points, using Python API. >>> >>> After a few breaks, GDB is starting to print these lines: >>> >>> Traceback (most recent call last): >>> File "/home/omer/gdb_script/script.py", line 71, in handle_breakpoint >>> self.breakpoint_jump_addrs[bp.location].add(addr) >>> RuntimeError: maximum recursion depth exceeded >> That's an error from Python. It tells me something in script.py is >> not quite right. Impossible to tell without seeing script.py in >> general. You can increase the recursion depth by doing something like >> >> import sys >> sys.setrecursionlimit(9000) >> >> Where '9000' is a limit you can set and vary. However, this might >> indeed be papering over the cracks, and not fixing the fault. > I would expect that you could wrap the script in a try/except block, to catch the stack overflow and print a Python stack trace when that happens. > > Should GDB print a Python backtrace when the Python script fails, just as executing a Python script standalone would do? It prints an abbreviated backtrace by default. "set python print-stack full" will enable the full backtrace (we had a request to do this for pretty printers). Cheers Phil