From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60098 invoked by alias); 3 Nov 2015 17:31:03 -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 60084 invoked by uid 89); 3 Nov 2015 17:31:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp11.uk.ibm.com Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 03 Nov 2015 17:31:01 +0000 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Nov 2015 17:30:58 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 Nov 2015 17:30:56 -0000 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: uweigand@de.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id D1C331B0805F for ; Tue, 3 Nov 2015 17:31:09 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tA3HUu4g9240926 for ; Tue, 3 Nov 2015 17:30:56 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tA3HUtit031212 for ; Tue, 3 Nov 2015 10:30:55 -0700 Received: from oc7340732750.ibm.com (dyn-9-152-213-152.boeblingen.de.ibm.com [9.152.213.152]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tA3HUtjK031208; Tue, 3 Nov 2015 10:30:55 -0700 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id 424DAF82F; Tue, 3 Nov 2015 18:30:55 +0100 (CET) Subject: Re: [PATCH] gdb/record-full: Use xmalloc instead of alloca for large buffers. To: koriakin@0x04.net (=?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?=) Date: Tue, 03 Nov 2015 17:31:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, koriakin@0x04.net (=?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?=) In-Reply-To: <1446489704-3173-1-git-send-email-koriakin@0x04.net> from "=?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?=" at Nov 02, 2015 07:41:44 PM MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-Id: <20151103173055.424DAF82F@oc7340732750.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15110317-0041-0000-0000-00000668B3F8 X-SW-Source: 2015-11/txt/msg00121.txt.bz2 Marcin KoÅcielnicki wrote: > On the newly added s390 target, it's possible for a single instruction > to write practically unbounded amount of memory (eg. MVCLE). This caused > a stack overflow when alloca was used. > > gdb/ChangeLog: > > * record-full.c (record_full_exec_insn): Use xmalloc for large buffers. I think this may leak memory if some code between the xmalloc and the xfree throws a GDB exception. Usually, this is protected against by calling the xfree via the make_cleanup mechanism ... Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com