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 4079 invoked from network); 17 Aug 2021 04:20:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Aug 2021 04:20:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1629174049; b=IdbQaCknP4hj3BCMNosmwGTczRUoe5+fj046NHkdH95DTef5Q2cnaQGM5IGjL80rqVAg1snsAH z/MUFtMFCca5o2tBA96e4KmE25f9F6SAqFoyic4cNpK3lKdRlISNRpNKAZcA2VTvjtsl0pDibX vEkGhbK0GeWiJZXsMUgFe/6OvlDTCxrBoRlCDh46n364siNMPt4QXfPCTxE4UM8sUx5glBbKmK 8qDzzxLL7wq/8EiWhqmx2S6mD93LlB1QJhPRxPrUg/TUY0V5rYtVdzudCUeUo6nVO2gO3OnbXz v5bAZHotr8bZUN+4yS5lQXvp9EfMdfLFBF5bTcteBLXMtQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f177.google.com) smtp.remote-ip=209.85.219.177; 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-20210803; t=1629174049; bh=NTgC1mTl9aeiJHflhW98gmKUi0pFaOiwUhjpvoOMnQA=; 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=P46GMLkT17UFf1Kpm4U0M7SjZWI7mucmCeBvxXzCoTTSVKg7lLSSX6bEatfr52CDXA+NsbxjZL p0WQD6nWUV4+Y70WesdzxAot++XSNZVyWUcFPla03sQnTXieH1igFSMF9eQ06DRwADORKPOLi3 3a5OhzxEYVfOQ6DRByROTB5TCnnJjPqeatFsi0SM6OU4k6FvRwjzi3AaWE7Z79pXqNn6hham5N O3qtYralet77U8NoyvDX9A3ptaL+/yQlQjejlHGsKeMmJpBpM4BgHgmTQOyVq4uHY6Q44E5GHG Kx2OaENdllOPKTrEbwVU94EOvZnL2uRll3fMG0Jsmqj7ag==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; 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=BMMpT8vjOBV1vHGy//E5aolW8rOoi31vy6dHKupoOMA=; b=UEZ8kaN4jubGJezFLQqGtextep lqZRdifOr+HmR+usFPczOZ0tW40jY54Qsbn20eu/Ms8F41676yFcWsmfLU2XxhXESoCPx8Y3S9ybP 8Z7WtxZAm/RdbmgtHkecYOqRJ+KeQsnW72rJBWek0DJJ9Cb/2QyiJmaXr1tAHUjctjPmp9AovTatC fzzUm4Ve+/IxKYVCaF7jB2tbrTj2IPmeNdjmV0mcpz+cNlRT1XQBPkVFw1qgHmctyj5EhwpANeOAR TYHZQEfRfwrlUUJdxwGp6/mxGByfqMbpHmyWpuTjttElG6k4O2TMeH8M/ZCXVhUe7TmhAYqBmsmaa 0MAUg0Kg==; Received: from authenticated user by zero.zsh.org with local id 1mFqam-00067Q-7B; Tue, 17 Aug 2021 04:20:48 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f177.google.com) smtp.remote-ip=209.85.219.177; 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-f177.google.com ([209.85.219.177]:34673) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mFqaV-0005qN-MK; Tue, 17 Aug 2021 04:20:32 +0000 Received: by mail-yb1-f177.google.com with SMTP id a93so37131632ybi.1 for ; Mon, 16 Aug 2021 21:20:31 -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=BMMpT8vjOBV1vHGy//E5aolW8rOoi31vy6dHKupoOMA=; b=q6R+RTArSb8AiPHWLSNG65w+z7dQSHVsnSZI7FqFCHIcBJ9CzXCd2UWkn/n2itOt6e 7V7iSIaeIauyPkwFCSIE3c6DNAPVo+40kB6BFtcr+jnTuSBP6jhbHi/SQhedRATYJeiu miEU+tnGT308Pb4l4BSXj5wQZsD/+xomfCSTAzBMzOzLe+nm7EzbRU+rNHpwkLCCQRRC nEEhRBGsAv6Kgp5hj0rLbnaUFCf98cjydYy6KP7F4R+UyDbWBjInKjQmbbNRnWcXwuEN g4slqjJ0LyCPMi9EZJxUIVxatAQMqi31wrA0AgWeKJJIMdyLZL6GHEy0oIvm0aPsd/vo DQ4A== 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=BMMpT8vjOBV1vHGy//E5aolW8rOoi31vy6dHKupoOMA=; b=b5YNGV/ifshCrjD1dYRZSfIUH/j/WIGAJQs+FdmMN4p0bDhOUwn0BP+avBu1kH4oyh omk1bQbIz5wh7inxyzbh2o06+0FZkpQvuLM/U5UMDvMf/9Jad72R4yhv3WHsk2tqn1s0 JTbcDUqxnmpmSdh7G56iw9auhQM3JSKviOwURpgLnSX1umoeXj3dDGG6majMpZq1aFUM BSyckR6GtJ5VyparxoS9BFckfZl9hTVQhB0eypuIb9rYSHbYYtviQ7LFwYN1Gv92Rj7b cmgq7Lef8baB+2uXxNgSQphOTHWW4hg45zdhs08H0yYq9hVcPHKRg5s8x8KsArJub7vd r2JQ== X-Gm-Message-State: AOAM533V9Bj8DWRZAe5+5sIpUymcNdZSTqcgsLCCLhq3HF1tk1j+hXqn QZXBouKuAV8Sp55JRLQQbPPkrtPHNtF5Mzc7TXL1Dx1a3+Y= X-Google-Smtp-Source: ABdhPJw3brlToBNim4yXhejU+lD4rtng5Czsr4DHqDYH9Bb7OyRfg9BwdJehfcuAhe3zz7XfouB+0Td+hrWzzbtUVTA= X-Received: by 2002:a25:31c5:: with SMTP id x188mr1983870ybx.291.1629174030181; Mon, 16 Aug 2021 21:20:30 -0700 (PDT) MIME-Version: 1.0 References: <20210724225048.ly7qpdvi55j3h5mi@localhost> <20210731202547.yxzvwevxvy22ywm3@localhost> In-Reply-To: <20210731202547.yxzvwevxvy22ywm3@localhost> From: Bart Schaefer Date: Mon, 16 Aug 2021 21:20:19 -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: 49286 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: I just found this in my spam folder. On Sat, Jul 31, 2021 at 1:25 PM zsugabubus wrote: > > shingetline() calls winch_unblock() and dont_queue_signals() so fgetc() > can be interrupted at any time. Hm. I'm not sure what we can do about this, except to stop using stdio, because we have to be able to react to window size changes while blocked waiting for input (that would be the most common time for a window to be resized). Maybe there's something sneaky we can do with read_poll() so that we don't call fgetc() until it's guaranteed to return something, and then we could hold signals again around the actual fgetc() call. Or maybe shingetline() doesn't actually need to call winch_unblock() when loop(0,...) is called and isatty(bshin) is false ... which means passing the value of toplevel down from loop(). But that probably just fixes adjustwinsize() and leaves other signal handlers unprotected.