From patchwork Tue Jan 28 03:50:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 182986 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp34010ile; Mon, 27 Jan 2020 19:50:24 -0800 (PST) X-Google-Smtp-Source: APXvYqy+2h2QZvgTnNsMon9KlDZKEXWbgGfvBCFqyMYxkxLrtMbW4GirI/K26aplP9Ccd5vk27z8 X-Received: by 2002:a62:e40e:: with SMTP id r14mr1916516pfh.115.1580183423929; Mon, 27 Jan 2020 19:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580183423; cv=none; d=google.com; s=arc-20160816; b=r6SfnT1wEAGaIAu5y/ppx24beTz0unPSytCYkCJEmZzRJiE41ApJavbI5E5TWF3Zkv ozYGsK/jwJoGyAUGzLFpfJ3cEyviMN6VO3jmNztObaq/06tBTJvA5aI5uf/SHB5n+D5j AYXlIQgsNwvT9vtIdwVDJDo1Q+hwtMMHhmb7NFHMScZ5jNsdWvLwxiyDk6F2/Xt2WTNU 2VvsEPVVkni/gc4X41oI34R9WTzkOWnh4yYUQSbDpnMHReQHyNaIJML1i3Yjm6oDZ0Dd ba8vGlh35ElBuSpC/RAEBE4VQ98UL0zU5oe/fD8Up+IT1Iu//KRuXxCwEWouvFmcESRV UZPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature :dkim-signature; bh=aiILMCGOubTWUU3EKDD5KEq9AvkVjSF/NYpth6mSWTs=; b=roQNL8MYXVRn10oCtnVEYNoLTnYqUVQNm3ue4Gyp/U/JrEHbzx2FHPOD3GRul1CEFu DNgSAr/tKc/PbVHq5ajraMFYdl1kh1BEXc8/Xu9QOydK1Lf+fw/cl28cFT2Zw4szqlhW PYH6+T11JRmFN2+khK7KM18CWHeZQ1vNbrQU0WbxezE8evfRLAMdj5Hc65zcyaji4e/f to9JXagAI2QhJNIVUYiUniRNR+Opte1QLUQMsNmglf/+NTVhjDsxKxUIt+qq775EucDL GSKW54OIitn9XesFacu2voGBkd3MpygwKBF/gsq024CQlvPBUluGtmY0p6Fb0/AKZSqv t2MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=SpRgYihe; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=LX1uC6Ye; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=rCtuxJmr; spf=pass (google.com: domain of valgrind-developers-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=valgrind-developers-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id z33si13097691pgl.365.2020.01.27.19.50.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jan 2020 19:50:23 -0800 (PST) Received-SPF: pass (google.com: domain of valgrind-developers-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=SpRgYihe; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=LX1uC6Ye; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=rCtuxJmr; spf=pass (google.com: domain of valgrind-developers-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=valgrind-developers-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iwHtG-0007tT-6N; Tue, 28 Jan 2020 03:50:14 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iwHtF-0007tL-N7 for valgrind-developers@lists.sourceforge.net; Tue, 28 Jan 2020 03:50:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=v2khF11KMTQaH7EvBZX+AUgG7ZBW9dSw05l+56l7i/s=; b=SpRgYiheYRsXPz+9wojq8L/1Fd V55ASx/GFh/3udaiqUumUUnDEN4+DAqqXiOkJS67Gk7fGWMBaBsJ5no7271Y7PjRQkNVV/IRzuaOC I8rczlhwNQ/ggBGjH0zw+xkXWVGDEVrzR3ccF5yMlGjdXBFJJMOfr1XTmJsoz1o5vG4I=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=v2khF11KMTQaH7EvBZX+AUgG7ZBW9dSw05l+56l7i/s=; b=L X1uC6YedApaCQm8iIStKkT8ZQcXVPmSh4hNwQDntCHYavpsREnvwx9LMRQ9H9SgDUo2dSiKvMmI/6 rLAVN0V2HhSox+EVQqTxSLoBq4MLbv9j5C4tR63YWz6xJSjQ5+h00JCS+ptNVH8PP/WVBah/ds25Q asZVEhdAskUszrNI=; Received: from mail-pf1-f176.google.com ([209.85.210.176]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iwHtE-007lvG-Fy for valgrind-developers@lists.sourceforge.net; Tue, 28 Jan 2020 03:50:13 +0000 Received: by mail-pf1-f176.google.com with SMTP id q10so5924510pfs.6 for ; Mon, 27 Jan 2020 19:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v2khF11KMTQaH7EvBZX+AUgG7ZBW9dSw05l+56l7i/s=; b=rCtuxJmrLdR+VNNFQglznH8yAUOWKUfzon1KX1Mu/mX5zmMELlS5V5n04Lp3fDbGw0 9ZpsI1PrXNTAeP8r1rJtTLuITR4uynXbJdHUlU76NDBAdqHrE49vV8+wBIETRn+EPOl7 rFbAFDuBi0g8FR0DBm8aGlvOzUbiaWsGXRDUzEgCrPMqX53BibwB2eKFdeCtatgO2whe 1BAZEHMBH/r8+rbzYf/RlT4/+8ZotCSGpBDAZhEgFPFbPyZ55OP2fH9rIMOrZGYufe2A zDlnJhtQB5Wdaxkgu53cPn8g32Va/hsmtvNC4KjRB6SsiutHFHVSRjjNj07u12HDoIxr s24A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v2khF11KMTQaH7EvBZX+AUgG7ZBW9dSw05l+56l7i/s=; b=d2yZdvUF86QfSp2/C6UCEB8zln/iU2dcRNfqN1RoiLxKOgXz4fC2NbbbWyrIJWr0DK Ezhs30mQ7WWYFOgaOrzOZ/L5a2So32yY38gy10N+bgflTLSqKLfxbwtmylSquhmuP/3V oGzOQ4l/5W8pFpwKVgLLrFMDoqXSAROhpFFJopqfi5LlxmPYZSxjlMFz/eKDV+DxNbd7 vUz8SqS0W4P7aSwjMrbiTCrgfzxlqn1GeCj5Whn2b2x8tJyWft+i+9lULc71zKhRkdqt tO+QOlmqjv48GGJblokcRF5/SE7dcPcJq5lEdHHiMy8X8uebsPDxJMLjp5IUI0J66p1k cQ/Q== X-Gm-Message-State: APjAAAUsbnW9ldCnswdtwTzq2bpvEwXi8nd8d7hzApgVYdKVr6u7N3fH eB04PjbV5Rw7NBs6f+5nAlYTZ8T5iHE= X-Received: by 2002:a63:d041:: with SMTP id s1mr22861212pgi.363.1580183406249; Mon, 27 Jan 2020 19:50:06 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::c362]) by smtp.gmail.com with ESMTPSA id p17sm17108633pfn.31.2020.01.27.19.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 19:50:05 -0800 (PST) From: Khem Raj To: valgrind-developers@lists.sourceforge.net Date: Mon, 27 Jan 2020 19:50:04 -0800 Message-Id: <20200128035004.2440732-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (raj.khem[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.210.176 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.210.176 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1iwHtE-007lvG-Fy Subject: [Valgrind-developers] [PATCH v2] tests: Make pthread_detatch call portable across platforms X-BeenThere: valgrind-developers@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: Technical discussion for valgrind developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bvanassche@acm.org Errors-To: valgrind-developers-bounces@lists.sourceforge.net pthread_t is opaque type therefore we can not apply simple arithmetic to variables of pthread_t type this test needs to pass a invalid pthread_t handle, typcasting to uintptr_t works too and is portable across glibc and musl Fixes | pth_detached3.c:24:25: error: invalid use of undefined type 'struct __pthread' | 24 | pthread_detach(thread + 8); | | ^ --- v2: Use uintptr_t instead of long drd/tests/pth_detached3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.0 _______________________________________________ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers diff --git a/drd/tests/pth_detached3.c b/drd/tests/pth_detached3.c index c02eef11a..efeb15b72 100644 --- a/drd/tests/pth_detached3.c +++ b/drd/tests/pth_detached3.c @@ -4,6 +4,7 @@ #include #include #include +#include static void* thread_func(void* arg) { @@ -21,7 +22,7 @@ int main(int argc, char** argv) pthread_detach(thread); /* Invoke pthread_detach() with an invalid thread ID. */ - pthread_detach(thread + 8); + pthread_detach((pthread_t)((uintptr_t)thread + 8)); fprintf(stderr, "Finished.\n");