From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25587 invoked by alias); 30 Jul 2014 08:38:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 25562 invoked by uid 89); 30 Jul 2014 08:38:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: na01-bn1-obe.outbound.protection.outlook.com Received: from mail-bn1blp0181.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (207.46.163.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 30 Jul 2014 08:38:00 +0000 Received: from BLUPR03MB136.namprd03.prod.outlook.com (10.255.212.27) by BLUPR03MB135.namprd03.prod.outlook.com (10.255.212.21) with Microsoft SMTP Server (TLS) id 15.0.995.14; Wed, 30 Jul 2014 08:37:55 +0000 Received: from BLUPR03MB136.namprd03.prod.outlook.com ([169.254.1.168]) by BLUPR03MB136.namprd03.prod.outlook.com ([169.254.1.168]) with mapi id 15.00.0995.014; Wed, 30 Jul 2014 08:37:55 +0000 From: Adrian Sendroiu To: Pedro Alves , "gdb-patches@sourceware.org" , "tromey@redhat.com" Subject: RE: [PATCH v2 2/2] mi-out: Implement mi redirection using a stack. Date: Wed, 30 Jul 2014 08:38:00 -0000 Message-ID: References: <87ha26liw6.fsf@fleche.redhat.com> <1406288037-11470-1-git-send-email-adrian.sendroiu@freescale.com> <53D7B5BE.6020702@redhat.com> In-Reply-To: <53D7B5BE.6020702@redhat.com> x-microsoft-antispam: BCL:0;PCL:0;RULEID: x-forefront-prvs: 0288CD37D9 x-forefront-antispam-report: SFV:NSPM;SFS:(6009001)(189002)(199002)(164054003)(13464003)(377454003)(51704005)(105586002)(21056001)(101416001)(4396001)(95666004)(81342001)(92566001)(77982001)(83072002)(85306003)(31966008)(106116001)(81542001)(2201001)(99396002)(85852003)(74316001)(99286002)(107046002)(106356001)(2656002)(76576001)(107886001)(79102001)(77096002)(54356999)(74662001)(50986999)(74502001)(86362001)(20776003)(66066001)(33646002)(87936001)(76482001)(85806002)(19580405001)(64706001)(19580395003)(83322001)(76176999)(46102001)(80022001)(108616002)(24736002);DIR:OUT;SFP:;SCL:1;SRVR:BLUPR03MB135;H:BLUPR03MB136.namprd03.prod.outlook.com;FPR:;MLV:sfv;PTR:InfoNoRecords;MX:1;LANG:en; Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-SW-Source: 2014-07/txt/msg00779.txt.bz2 > -----Original Message----- > From: Pedro Alves [mailto:palves@redhat.com] > Sent: Tuesday, July 29, 2014 5:55 PM > To: Sendroiu Adrian-B46904; gdb-patches@sourceware.org; > tromey@redhat.com > Subject: Re: [PATCH v2 2/2] mi-out: Implement mi redirection using a > stack. >=20 > I'm guessing we can trigger this by using "save breakpoints" while > logging is enabled, like gdb.base/ui-redirect.exp ? > I think it'd be very good if a test to the testsuite was added. > Sounds like gdb.mi/mi-logging.exp would be a good place? >=20 > -- > Thanks, > Pedro Alves This won't trigger the bug, because the logging code doesn't call ui_out_re= direct if the interpreter is MI. The way I caught it was through some pytho= n script that executes commands and catches their output into a string. For= example, if you have=20 gdb.execute("break main", False, True) The call sequence will be something like: execute_command_to_string ui_out_redirect execute_command ... mi_breakpoint_created ui_out_redirect Then, after executing this, the mi_uiout->data->buffer will incorrectly poi= nt to a freed ui_file structure, and any subsequent command will overwrite = the pointers inside this ui_file with random data, causing a crash. Do you have any suggestions on how to make a test case from this scenario? Adrian