From owner-freebsd-hackers@freebsd.org Thu Sep 15 04:06:26 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B2FBD9677 for ; Thu, 15 Sep 2016 04:06:26 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-vk0-x22f.google.com (mail-vk0-x22f.google.com [IPv6:2607:f8b0:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A184B194C; Thu, 15 Sep 2016 04:06:26 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-vk0-x22f.google.com with SMTP id b133so9059557vka.1; Wed, 14 Sep 2016 21:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Wo6/bCXJwKxQg+ptcgfrokyZ0BxNY+BHqCTlXk5kC9o=; b=ZVb6D+KISpgbZejfmMOcJkkAWIpPYnLbAwOcyh6hMaXo1qU2fgK9OyPyWXLYYO51kc p9tC0C0OU2an5fyDreqsHx4qnVsU35r8HDxa18hHIMSQRfrCW1j96FuYAwEusvgd8h2I b96kxeCRcF39E2XUQwnnbf1wfCt5rmaCRCtr01jy6PxTedEqeqCXYc9IUqgjqdkJjEi8 NJOFx24wXpiLzrFjOnFPOMEmPiaYcrRrs33J9WzPZC1wG5HG0/t/2AtD4U06/cye/OaV 7zr+WxlUcup1+xdN3BBDIj5XIWXSvgDmsPLLXG3TdsiReel4/optDrewrX3UZoNokafT BIoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Wo6/bCXJwKxQg+ptcgfrokyZ0BxNY+BHqCTlXk5kC9o=; b=QNZ0y8hDDrfVU9qxMxQ9SUFmcO91ecQEhZHAoM1fKhjPeNOnAlutr5rtVT5yH5ClFO 1smi3cF5b3azQXCdnEjKydYfH5Z4nROTqPW5Jwk90sMOlVZ1oN0j7H//H/Ml01rET8T0 /VPkQJlAfE8wwsioYxr+cEFmaZGsWH5PCu0YXJ7WENV/ZCA/aREl8yHsbo4xtNKUyPE2 5dsJ8+izRoaBVUUYYywE9WzfGrLPswC8MiBVxcDqqFi7I92OqCRjM2GMjn4O/8uaDpP3 u/5t1ZwbzPLM78BSLVoi6rsXuuwvOs6FuIl7Qw/6Qn5rdkftmPomh2si2EJu7hl5TFiL qdfQ== X-Gm-Message-State: AE9vXwO84y6SWZaY8Ye+uv7VJm1VNBEGKG9DTewksfH/5lpEZWCm7Dog8ZjRemycAv8MiaM2d7gy4M2jmI30ew== X-Received: by 10.31.58.130 with SMTP id h124mr1338146vka.141.1473912385663; Wed, 14 Sep 2016 21:06:25 -0700 (PDT) MIME-Version: 1.0 Sender: kmacybsd@gmail.com Received: by 10.159.33.36 with HTTP; Wed, 14 Sep 2016 21:06:25 -0700 (PDT) In-Reply-To: <5cb743dd-60fd-8018-eaf7-fe10b8db211c@FreeBSD.org> References: <90f37d14-a187-06b2-6187-7a9c1890a73f@FreeBSD.org> <5cb743dd-60fd-8018-eaf7-fe10b8db211c@FreeBSD.org> From: "K. Macy" Date: Wed, 14 Sep 2016 21:06:25 -0700 X-Google-Sender-Auth: d4U-mAqA9gjwR-IdwMMlzdcjRYI Message-ID: Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: Pedro Giffuni Cc: Cedric Blancher , FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 04:06:26 -0000 On Wed, Sep 14, 2016 at 12:44 PM, Pedro Giffuni wrote: > Hello; > > > On 14/09/2016 14:14, Cedric Blancher wrote: >> >> dtrace can do VLA >> >> Are there other arguments? > > > It was a while ago and I don't remember other than the fact that alloca() > exists on all platforms and just works fine so why bother. What problem are we trying to solve? Is there any indication in practice of stack overruns or are we talking about fixing something that isn't broken? -M > > This was only a discussion in the context of printf(1) and as I wrote we > parted different ways there. If there are other notable cases then please > upstream those changes first. > > Pedro. > >> Ced >> >> On 14 September 2016 at 21:11, Pedro Giffuni wrote: >>> >>> >>> On 14/09/2016 13:54, Cedric Blancher wrote: >>>> >>>> Who was the "principal Illumos developer"? I remember some heated >>>> discussions, mostly rooted in 'we stick with ANSI C' and because the >>>> CTF/dwarf tools in Illumos were unable to handle VLA and no one was >>>> interested in fixing the BUGS in their toolchain, so the cheapest >>>> solution was done: VLA was declared persona non grata. Saves company >>>> money. >>> >>> >>> Yes, the non-accessibility of VLAs for Dtrace was the main argument. This >>> was a private conversation with Garrett D'Amore who did some nice >>> enhancements to our printf(1). >>> >>>> Typical Sun policy which was one of the reasons which sealed the >>>> downfall of Sun Microsystems. >>>> >>>> But this is NO ARGUMENT for FreeBSD... >>> >>> >>> Our printf(1) implementation has all their enhancements but uses a VLA >>> instead of alloca. >>> >>> This said, whatever illumos wants to keep in their code is relevant as we >>> want to make it easy to merge ZFS and Dtrace changes back and forth. >>> >>> Pedro. >> >> >> > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"