From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17942 invoked from network); 31 Jul 2021 01:33:43 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Jul 2021 01:33:43 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1627695223; b=yL7P2F75XCOzUSPHtp+SWERmFzmoHmrnBYYkYkdOe3YYMZliDlGOHNmnXOJELMRU7SaQY6J7KR krH3VA2rwa09XenrlYf/vH+E0Z89A/XPZZV/GbWm3Eei+AzpM8tgk5MWKl4jC3tacFpg/iJblq r+914FfRFnx+IDJhWDztn9pv9fyo2DhcN5pEw3XEhzrS1RuX76sAuR7x04Y1wfMwi9YGn/14QS bT8+Viiz0jEXcfXYIdm1O818kqtNxruSwrHhn5qO7aLilprJw+MtQV67S07aU1O2SWzYy+U5Lu 0hU+PHbkJv7DkNZ7MGGD++PAF7fk8lwYVKzLPFtOXNrqfg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f170.google.com) smtp.remote-ip=209.85.219.170; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1627695223; bh=XQqqQH0SmvCKnfJVXokvr0cy3DgdkN92jJzyxvh2MtQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=jblQuO3rbM4XSKTWBY+6NFyvNPqbGOjBhzRD3ZiySUudLGDm8cIl/12nfmz4S2+MRv0xrbSZ/a No0Ed8tMtXs88ZLb33ASLKrBNAfbMPRRJJ+jQv9t3I89gXreYoZwfxSQv/W5VtrXURUnmLie/0 vpqcxet3HFw/2OGkgx0ql1Pw5GQMe4ShM+ZFOUE3Tjg68TE0ck77s+HLF7s/MMiwLFELW9lKVN zfNXkntp2Nx7tk9bVqRIQh50cQXOFNrCyMIIuPZtTUbtU3WQuMsxPzXPar4O7wOv9gXDBQSvYp ZePO8eVN3bDD+HJvOPqyujmiPKBqfW6ZnugKaxXvLICjUw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=j6jz9rom+0SDfMq39HD6ID8N6ZhTu+mdV2TKnhjXGpI=; b=djCy0yNyxN8wIjGgi3D+7q/BqN FRuD/D2Ohf0S2r8XC9ktIGpQhuEhL9WgEydNmplNRccVftZrjM+YdrDou0j1TRjD/Taf3MOLl2UUh gfYibroWvw+lDZzllb5slVUXt1OTjb6PXiWA2Hq0M/j3heW2u88kMlDOyWZ9NN2QT5NHHo7q++lQh IdexeNtpBXUuHDaIFlJzc+w5j1a7NLjbSjGafK8yk0wydAVjTf7hwgAH+tSGLKPEYgpzi+cdi2UWF DxKvsVipvao3VGL21GyUn7xv0IbIAnXLkdW10JCHAn5FboEubQfPN2/roZqJaJxRMOR8XE1XSdcv6 47PjMQfw==; Received: from authenticated user by zero.zsh.org with local id 1m9dsj-000JhL-Jc; Sat, 31 Jul 2021 01:33:41 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f170.google.com) smtp.remote-ip=209.85.219.170; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f170.google.com ([209.85.219.170]:45878) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1m9dsP-000JOo-4S; Sat, 31 Jul 2021 01:33:22 +0000 Received: by mail-yb1-f170.google.com with SMTP id a201so2460753ybg.12 for ; Fri, 30 Jul 2021 18:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j6jz9rom+0SDfMq39HD6ID8N6ZhTu+mdV2TKnhjXGpI=; b=A0dXA/sXII04AmTMnl0Bi0beChjRUaEUfRI6Pe10q//mXtdd5wfqNba7f6YZj8Tmha SkeoG808M/6kj4CMtPjvF3MExmaicLx9ThsEJZOmZFoT69YbwHTy7RNW2ewmZj2uh445 GahgI6Punfai44Td1BCLiddkOrnmUMyI0te/JV0n4InBIBhqLwvosubhOZS7CRRf4sRD TcRIAy9VNszasjVO/wh62xnvFuqGev7909/MbN1+7GRZr8li6LVBBMkzaHYj9AmanydA W8ZeeBKHSpmb+u1e9g0ZjSqzk8jwsX1g9fh8j8ll/rTpYwXpD3Ch0rPtHKDE5E+eCp1l D+cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j6jz9rom+0SDfMq39HD6ID8N6ZhTu+mdV2TKnhjXGpI=; b=YfUGzQ+fUgZNOszY7d1NjkxX2Co/Hw6OMNVqHsSoKfMOOjj/poI3XSGgUaiiHvhzIY yuxZrusm3/1UzqWleHFHfBuFhFTLn7NTLcnhAWgtcLTc0CPGJHXJ1L7Ub4S+c87TiMGE A1XOl67gWtg3EVZFvOSi4DnH9eesxekpXG98BswnI+8CB+RSgFQWHI/+pSE2w7c7+Jxg A0ZFkQDBvhHd4S54sATonYEM+2Q6V++JbRJZZNs0IGbxQy/n8AV8F2D2XD1BN9KMbULF g8kkNcrKfnpKvwccnA+5ebeJAqxewiYTTM4BtmRxhomRWb1NhLh/ka8xn1YX8HdjZxUa fuZQ== X-Gm-Message-State: AOAM5319EoW5G+HNrwy0iCcl8NEGOKHh6maBEnA55YYm8YURQ+tbbeyF abkipOio9dXu5yvflMqYzhocH8uFvPFGCfD1FccASTUmtiE= X-Google-Smtp-Source: ABdhPJxRPh8vWa/CLodxNF46USjGKyuF9ycAJ/Ldos9EEbE82SdGWXyjlQWWN3bd83h69P30DbZHSYI1CvKtmShkLcg= X-Received: by 2002:a25:73d1:: with SMTP id o200mr6825958ybc.297.1627695199490; Fri, 30 Jul 2021 18:33:19 -0700 (PDT) MIME-Version: 1.0 References: <20210724225048.ly7qpdvi55j3h5mi@localhost> In-Reply-To: <20210724225048.ly7qpdvi55j3h5mi@localhost> From: Bart Schaefer Date: Fri, 30 Jul 2021 18:33:08 -0700 Message-ID: Subject: Re: [BUG] malloc inside signal handler To: zsugabubus Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 49223 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Sat, Jul 24, 2021 at 3:52 PM zsugabubus wrote: > > It seems that setiparam("LINES"/"COLUMNS") inside adjustwinsize() wants > allocate some memory for environment variables. This statement is true, but has been true for decades; we go to some lengths to make sure that signal handlers are not invoked during other operations that perform malloc, so that there is no re-entry issue if the signal handler needs to perform allocation. It's not possible to run shell-code-based signal handlers without any means of dynamic memory management. Under what circumstances are you generating this error?