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 B830BDC83DB for ; Tue, 23 Feb 2016 17:16:18 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id B8081DC718F for ; Tue, 23 Feb 2016 17:16:17 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id x1so104751941lbj.3 for ; Tue, 23 Feb 2016 09:16:17 -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=1hve+4JdbFYQoYYU+zB6r0Zio0UQ77IgBHCVaK5zoho=; b=AwG3DfKfsncekcPsq7UGylvzcJRYsxmAhDF+1yd92u2kz68y4CWLNSlvk89t9KUzCU ybfagNirb/eHy/xF+uPjS7x6pABfyj4SmRLaYefwpBNkupjAna1eUtsSnCJCZRN/9t7Q bGVndokcot2+MCPqk9GHbLcHS6c82hBd8Kgs+oyiFSHpvxag/Zq87dEn6WGoGCm/9XhT mVRsvYVCGRYdGIZPLfprLjnO09kygHMGMbzxzoxlXr7fboJvmc3oVcE6u9IMB5VEcZpP DP2et4soYrkJQ4sV7y51XCBulg7pEsPBmvtalbuzEMWybKTpLk7YzEqzk7aEh7cSWZeR Qx1Q== 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=1hve+4JdbFYQoYYU+zB6r0Zio0UQ77IgBHCVaK5zoho=; b=H+1uKFnWuqcAMM2a/Ds/aO9ikI9GMCwno/CEAAG9A18ows1RjkjtPizD47su3hZlPG O4kRiTTh4cRor8+UYU5pfkXm9E2eneY6cov6kiY91Gsp2SSsc/+Nm2fvkrim0odxHobk ralKgkxMahKLEscdwGfFHUxIxZFTDdKWkdkn2TGBYlI6f3K7QbzoTNEJ7UvvZhxZt88m JaVW4jL71Jss4sxr0z/zBGywA4PE7l4W3FJIwoddTsg12tY8vMBatU7WuikYhQH8MV2b aPfZMY58jzXZyPANaEZh4IUSTpxIblFEIf4NRWfMS+6sE2fvHgkKTqx1Si2REu66a5sC WETQ== X-Gm-Message-State: AG10YOSSpI0br5hjmWNwF/r4jEOnKM05nmFsi6HLe3vQRZrUYiWwzD2knDOuIaVsw5QnRQ== X-Received: by 10.112.159.10 with SMTP id wy10mr12710603lbb.114.1456247775960; Tue, 23 Feb 2016 09:16:15 -0800 (PST) Received: from vostro ([83.145.235.201]) by smtp.gmail.com with ESMTPSA id g74sm4302812lfi.1.2016.02.23.09.16.15 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 09:16:15 -0800 (PST) Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= Date: Tue, 23 Feb 2016 19:16:12 +0200 From: Timo Teras To: Marc Vertes Cc: alpine-aports@lists.alpinelinux.org Subject: Re: [alpine-aports] [PATCH] testing/mongodb: fix for #5117 Message-ID: <20160223191612.6f25f25b@vostro> In-Reply-To: <1456247469-958-1-git-send-email-marc.vertes@ugrid.net> References: <1456247469-958-1-git-send-email-marc.vertes@ugrid.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 17:11:09 +0000 Marc Vertes wrote: > 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" > +--- a/src/mongo/platform/stack_locator_pthread_getattr_np.cpp > ++++ b/src/mongo/platform/stack_locator_pthread_getattr_np.cpp > +@@ -32,6 +32,12 @@ > > #include > -+#include > > ++#if defined(__linux__) && !defined(__GLIBC__) /* Assume Musl libc */ > ++#include > ++#include > ++#include > ++#endif > ++ > #include "mongo/util/assert_util.h" > #include "mongo/util/scopeguard.h" > -@@ -52,6 +53,11 @@ > - invariant(result == 0); > - invariant(base != nullptr); > - invariant(size != 0); > -+ > -+ struct rlimit rl; > + > +@@ -48,6 +54,16 @@ > + size_t size = 0; > + > + auto result = pthread_attr_getstack(&selfAttrs, &base, &size); > + > -+ invariant(getrlimit(RLIMIT_STACK, &rl) == 0); > ++#if defined(__linux__) && !defined(__GLIBC__) /* Assume Musl libc */ > ++ struct rlimit rl = { 0 }; > ++ base += size; > ++ if (syscall(SYS_gettid) == getpid()) { /* In the > main thread */ ++ invariant(getrlimit(RLIMIT_STACK, > &rl) == 0); ++ } > + size = rl.rlim_cur ? : 2 * 1024 * 1024; > ++ base -= size; > ++#endif Technically the getrlimit() is perfectly ok to do on all platforms. But we know glibc returns rlimit anway, so it can be skipped there. I would have put all of the base/size twiddling inside the if(). Then struct rlimit does not need initialization either. But thats a minor thingy. You care to fix that, or should I just apply this? > > - // TODO: Assumes a downward growing stack. Note here that > - // getstack returns the stack *base*, being the bottom of the > + invariant(result == 0); > + invariant(base != nullptr); --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---