From patchwork Mon Nov 5 13:08:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 993058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-96956-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="yW2iFIg4"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pY0D46Yrz9s5c for ; Tue, 6 Nov 2018 00:08:44 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=G/j/vdpnfP6ya1LYSgFNwqnWfU+/s ZhQhizwo1y7YqLcLokmIC5zd9RRh3vszPvCBHONteeAqyX3HOcufaXISDlTuo9/9 zc93burwvRfZWkvH0XpEFbt8/x7dE4pHYrNzgGT4zFTyEuBx9WsdvKW6D30BqFBO YUaj6EH1ftlC00= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=Tkq5eK3hAxjvCWrnKQzQpM2vsYQ=; b=yW2 iFIg4n8DDeBOzIq0ysHjHHvy6XpZCh1IZmGCz34jen/1uwqlrvXybu0YyULoYhiW Zc/dhzpivpTIyXlPQd0Jdz1AZJY2Nqr+lgOEh2Y1/hTqJy+IB1Dav+Peti2WYgxG ADv4RtOnsFFXobKzZlz2zLZ8QnZ0nTNXmG5jAbv0= Received: (qmail 26182 invoked by alias); 5 Nov 2018 13:08:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 26163 invoked by uid 89); 5 Nov 2018 13:08:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=creation, gpg X-HELO: mx1.suse.de From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] libanl: properly cleanup if first helper thread creation failed (bug 22927) X-Yow: It's the RINSE CYCLE!! They've ALL IGNORED the RINSE CYCLE!! Date: Mon, 05 Nov 2018 14:08:34 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 [BZ #22927] * resolv/gai_misc.c (__gai_enqueue_request): Don't crash if creating the first helper thread failed. --- resolv/gai_misc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resolv/gai_misc.c b/resolv/gai_misc.c index e7c3b63cc5..80a2cff835 100644 --- a/resolv/gai_misc.c +++ b/resolv/gai_misc.c @@ -261,8 +261,11 @@ __gai_enqueue_request (struct gaicb *gaicbp) /* We cannot create a thread in the moment and there is also no thread running. This is a problem. `errno' is set to EAGAIN if this is only a temporary problem. */ - assert (lastp->next == newp); - lastp->next = NULL; + assert (requests == newp || lastp->next == newp); + if (lastp != NULL) + lastp->next = NULL; + else + requests = NULL; requests_tail = lastp; newp->next = freelist;