From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 182bc829 for ; Sun, 15 Dec 2019 21:10:31 +0000 (UTC) Received: (qmail 15142 invoked by alias); 15 Dec 2019 19:07:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45038 Received: (qmail 23536 invoked by uid 1010); 15 Dec 2019 19:07:18 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-8.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25663. spamassassin: 3.4.2. Clear:RC:0(80.0.253.72):SA:0(-2.0/5.0):. Processed in 0.705236 secs); 15 Dec 2019 19:07:18 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _smtprelay.virginmedia.com designates 80.0.253.72 as permitted sender) X-Originating-IP: [86.16.88.158] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=Te64SyYh c=1 sm=1 tr=0 a=MiHCjVqLJ44lE3bxSlffFQ==:117 a=MiHCjVqLJ44lE3bxSlffFQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=Mrz3sjv-sVQA:10 a=OjjEX8gdAjT8oK-XCkAA:9 a=QEXdDO2ut3YA:10 Message-ID: <5768d5ca6d1e70c3b7c58b87ca99410f6306a584.camel@ntlworld.com> Subject: Re: =?ISO-8859-1?Q?TR=A0=3A?= =?ISO-8859-1?Q?_Re=A0=3A?= [BUG] Crash due to malloc call in signal handler From: Peter Stephenson To: zsh-workers@zsh.org Date: Sun, 15 Dec 2019 19:06:43 +0000 In-Reply-To: References: <569822988.994307929.1576256973462.JavaMail.root@zimbra62-e11.priv.proxad.net> <1576258224.5214.31.camel@samsung.com> <5bd41b45eaf3d745547d1091f4fe22645fd2e8e5.camel@ntlworld.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfBQMR4XcHUCPELy1Paj6eEqIeRVdVyTrdN3jIdPcOR6uX+kPsfgHwK+KT9mJr98ojAiWnW9zZu9e6x3R7SHuaFcIOTtnX8EfauXnYOEZaUd7JX7uY8y9 otX2TdTuCCoYV2NficTpwSW+OVhUVf9ru/8Db5XK3LEVQt7xYR006XdK On Sat, 2019-12-14 at 12:32 +0000, Peter Stephenson wrote: > On Fri, 2019-12-13 at 21:08 +0000, Peter Stephenson wrote: > > On Fri, 2019-12-13 at 17:30 +0000, Peter Stephenson wrote: > > > I think the intention here is to make sure we're not blocking for a long > > > time in this function, but if fgetc() is doing memory allocation we're > > > going to have to put that in the signal blocking. However, if the input > > > itself blocks in fgetc() that's going to be a problem. The fix might be > > > not to fdopen() the input file, but just read into a buffer with > > > read(). > > > > This would look like the following, which is passing tests... > > Slight update to close the file descriptor and to document the arguments > of the function. I've committed this --- and as it's potentially serious we should let it get a bit of testing and then get it into the release --- but as I've still had no comments further examination is still welcome. pws