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=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,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 28fae0f6 for ; Fri, 13 Dec 2019 10:20:28 +0000 (UTC) Received: (qmail 14299 invoked by alias); 13 Dec 2019 10:20:24 -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: 45015 Received: (qmail 10927 invoked by uid 1010); 13 Dec 2019 10:20:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-il1-f196.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25656. spamassassin: 3.4.2. Clear:RC:0(209.85.166.196):SA:0(-2.0/5.0):. Processed in 3.050852 secs); 13 Dec 2019 10:20:24 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.196 as permitted sender) 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=j8P0mkxnbdQOqTkSGTsGc5ULe5CuTes57wL2KJTZMPk=; b=gsBMqF7DS72FbuvOkqnLRn4axzfVvdHYhzXSXxf0fkTUcxgJp+i8rYrpaZ0hjOoL5Q Tzc/UxW9867JomnsSF5ky2YRgvM+p6c2X2DzULrug4wej9aYjtB2D8umK050Xxkg8RxR CL8InSZi59BJ1YP29kcCbE5Gy/COb5jiG9udrsHpLukEYFcuOvRrapbU0FaIEomLjUu8 20kmQ+Qc07WD4oA24RiTu4Kv8def0YLXDTivjqIPgjzhG9UbV95t20yTGo3uYoceHjXC ltgTMGThxvEeojn/U1v/RcBmQGQ6FiIogXCvMthfXHwZB5BHFS3Won2o9anuOrY6nmV1 U6Vg== X-Gm-Message-State: APjAAAVIsd42T5nKE0w5HNAvOwD4sjzXAwd6zxIyTpDYY6B+3LoqNpk5 V6m0u5OQWHBDlGObG+E48BMChO7m379AORsHpjA= X-Google-Smtp-Source: APXvYqzLAPhJTH18wGOCp94xCS2fN1n9fOTByVNW5xsFdTs9smIo3jiBh0pkr67uKMgr70MntyD4XOqOt0Vg4mTrHi0= X-Received: by 2002:a92:6603:: with SMTP id a3mr1219139ilc.168.1576232388330; Fri, 13 Dec 2019 02:19:48 -0800 (PST) MIME-Version: 1.0 References: <2022943386.989309814.1576175339554.JavaMail.root@zimbra62-e11.priv.proxad.net> <1576230001.5214.1.camel@samsung.com> <1576232178.5214.2.camel@samsung.com> In-Reply-To: <1576232178.5214.2.camel@samsung.com> From: Roman Perepelitsa Date: Fri, 13 Dec 2019 11:19:37 +0100 Message-ID: Subject: Re: [BUG] Crash due to malloc call in signal handler To: Peter Stephenson Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Fri, Dec 13, 2019 at 11:17 AM Peter Stephenson wrote: > > On Fri, 2019-12-13 at 10:45 +0100, Roman Perepelitsa wrote: > > On Fri, Dec 13, 2019 at 10:40 AM Peter Stephenson > > wrote: > > > > > > The main shell is suspended, waiting for a child to finish, so the fact > > > it's in the signal handler isn't saying anything. > > > > > > From the look of it, some memory corruption must already have occurred > > > at this point to get the malloc to fail. > > malloc is not async signal safe. It's illegal to call it from a signal > > handler. I'm not saying this is what's causing a crash. > > In zsh, this is handled by queuing interrupts and only allowing them to > run in a few places in the code. Obviously, waiting for a child to > exit is one of those places. The stack trace shows malloc being called zhandler. zhandler is a signal handler. What am I missing? Roman.