X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 75BE7DC5D95 for ; Tue, 23 Feb 2016 15:50:37 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 08203DC2BCC for ; Tue, 23 Feb 2016 15:50:36 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id x1so103209213lbj.3 for ; Tue, 23 Feb 2016 07:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=EOSyhlPDdn6pTUYqrnPXALPkzIMj8xuy2LOHDV4kOgE=; b=q0iRI/IKVUhWjw/8T6ZXqlKdlmcqxn9/6SnmVsz+XyUcMQz678lHM2X/1LaMiCqWDm m0OB8pXk1mUl9KOhTcacqXguX4PYT7sf/0KpjZm0HVlz3+exnSkXdFz98O0klY2stk0I KX9uP5L218Zj+TLAvbU0P8vhPGEM8fdERi/Dd8oOoM9AoHe2BpWFlVUmf04K97NwcmWk InYRRd6uuVoX3GGdAtTFAxePgIjD7Q5UhsC7+MxrFqsqq6XRw0jHcA/RrIKsz0+SawTx D9QQxJBYaDhLrhTm1NiUJxK3OyMRTgTxrTv3KSbIwuoTlGnRz28e8Md8fDJOSoSk9w7j DCPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=EOSyhlPDdn6pTUYqrnPXALPkzIMj8xuy2LOHDV4kOgE=; b=ZWwu42neN2yAUHyYogBq9FM4h8aQ4m7LQyS0+dfsQ3yACMdRIwwnpDsmTYh7N8HipU gOE8BFeP0fwOmm0krsZDF/1C/H6fnbFQ5ii3y9un/cR5L+EwbTbm/7UeULmsMKkJ9ele ZdIOld67UEFXrO6f6jFZBlatqH8tEOc+AXWdkx083GXJ1Th94IrpcZwmwoGoUW4ryXzG xPxrGBh8oxiySUlJkx0i8hsnSK92og7dhg5NrqjtRjWNGWAafjhAjP3XQqweFAGHVr+d 6FcwilKWud/zkW5oqWUF4pKQIReY6iyorO46bNDYPQ6uzfaaKVpZd/0jEdtl6bRt2GQS 6N+Q== X-Gm-Message-State: AG10YORvUXTjMGREwXLWb9jRuYl9HN+5MvPGYM7Nj2y0ZL0BmRbkWB9gaCJNEZOPyy3ewA== X-Received: by 10.112.157.161 with SMTP id wn1mr12425819lbb.54.1456242634852; Tue, 23 Feb 2016 07:50:34 -0800 (PST) Received: from vostro ([83.145.235.201]) by smtp.gmail.com with ESMTPSA id zk9sm4173832lbb.3.2016.02.23.07.50.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 07:50:34 -0800 (PST) Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= Date: Tue, 23 Feb 2016 17:50:28 +0200 From: Timo Teras To: Marc Vertes Cc: alpine-aports@lists.alpinelinux.org Subject: Re: [alpine-aports] [PATCH] testing/mongodb: fix bug #5117 where mongo fails at start Message-ID: <20160223175029.23bcadb2@vostro> In-Reply-To: References: <1456083383-9196-1-git-send-email-marc.vertes@ugrid.net> <20160223150743.33e55efa@vostro.util.wtbts.net> <9D775D86-8A4D-49ED-8512-EBD572ECF6D6@ugrid.net> <20160223170446.483be803@vostro.util.wtbts.net> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.28; x86_64-alpine-linux-musl) X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 23 Feb 2016 16:35:58 +0100 Marc Vertes wrote: > No success. I think that the base address returned by > pthread_attr_getstack(&attr, &base, &size) is the problem. Increasing > the size (like with getrlimit) doesn't change the test in > StackLocator.available() which triggers abort: it checks the > available space against this base address (&localaddr - base > quota). > > Changing size does nothing. > > I also noticed that pthread_getattr_np and pthread_attr_getstack > where not performed from the main thread (gettid != getpid) Right. ulimit should be used only for main thread. Not the created threads with libc allocated stack. That needs a fix. pthread_attr_getstack should return the lowest addressable byte of the stack. So indeed, if we change the size, we need to adjust base accordingly on system with downward growing stack. Something like: --- mongodb-src-r3.2.1.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp +++ mongodb-src-r3.2.1/src/mongo/platform/stack_locator_pthread_getattr_np.cpp @@ -31,6 +31,7 @@ #include "mongo/platform/stack_locator.h" #include +#include #include "mongo/util/assert_util.h" #include "mongo/util/scopeguard.h" @@ -52,6 +53,13 @@ invariant(result == 0); invariant(base != nullptr); invariant(size != 0); + + struct rlimit rl; + + base += size; + invariant(getrlimit(RLIMIT_STACK, &rl) == 0); + size = rl.rlim_cur ? : 2 * 1024 * 1024; + base -= size; // TODO: Assumes a downward growing stack. Note here that // getstack returns the stack *base*, being the bottom of the --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---