All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] valgrind: Fix ptest builds on musl
@ 2020-01-28  3:58 Khem Raj
  2020-01-28  4:03 ` ✗ patchtest: failure for valgrind: Fix ptest builds on musl (rev2) Patchwork
  2020-01-28  8:09 ` [PATCH v2] valgrind: Fix ptest builds on musl Alexander Kanavin
  0 siblings, 2 replies; 5+ messages in thread
From: Khem Raj @ 2020-01-28  3:58 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Alexander Kanavin <alex.kanavin@gmail.com>
---
v2: Use uintptr_t instead of long

 ...ad_detatch-call-portable-across-plat.patch | 44 +++++++++++++++++++
 .../valgrind/valgrind_3.15.0.bb               |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch

diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch b/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
new file mode 100644
index 0000000000..44d707a235
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
@@ -0,0 +1,44 @@
+From 90fdb0ae0418f7907f09b763343a457bdf6855fa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 27 Jan 2020 17:17:19 -0800
+Subject: [PATCH] tests: Make pthread_detatch call portable across platforms
+
+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);
+|       |                         ^
+
+Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36910506/]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ drd/tests/pth_detached3.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+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 <errno.h>
+ #include <pthread.h>
+ #include <stdio.h>
++#include <stdint.h>
+ 
+ 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");
+ 
+-- 
+2.25.0
+
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
index 0f86aa44ca..1475ff841e 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
@@ -40,6 +40,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
            file://0001-adjust-path-filter-for-2-memcheck-tests.patch \
            file://s390x_vec_op_t.patch \
            file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
+           file://0001-tests-Make-pthread_detatch-call-portable-across-plat.patch \
            "
 SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975"
 SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1"
-- 
2.25.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* ✗ patchtest: failure for valgrind: Fix ptest builds on musl (rev2)
  2020-01-28  3:58 [PATCH v2] valgrind: Fix ptest builds on musl Khem Raj
@ 2020-01-28  4:03 ` Patchwork
  2020-01-28  8:09 ` [PATCH v2] valgrind: Fix ptest builds on musl Alexander Kanavin
  1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2020-01-28  4:03 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

== Series Details ==

Series: valgrind: Fix ptest builds on musl (rev2)
Revision: 2
URL   : https://patchwork.openembedded.org/series/22320/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 037bef5c7d)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] valgrind: Fix ptest builds on musl
  2020-01-28  3:58 [PATCH v2] valgrind: Fix ptest builds on musl Khem Raj
  2020-01-28  4:03 ` ✗ patchtest: failure for valgrind: Fix ptest builds on musl (rev2) Patchwork
@ 2020-01-28  8:09 ` Alexander Kanavin
  2020-01-28 10:07   ` Richard Purdie
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2020-01-28  8:09 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

The reason I dropped the previous version of this is that with the patch the test failed, without the patch it passed. If you can confirm that the new version doesn’t regress the test I would appreciate. You can edit run-ptest prior to running it to include only the test suite with this test to make it quicker.

Alex

> On 28 Jan 2020, at 4.58, Khem Raj <raj.khem@gmail.com> wrote:
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Alexander Kanavin <alex.kanavin@gmail.com>
> ---
> v2: Use uintptr_t instead of long
> 
> ...ad_detatch-call-portable-across-plat.patch | 44 +++++++++++++++++++
> .../valgrind/valgrind_3.15.0.bb               |  1 +
> 2 files changed, 45 insertions(+)
> create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
> 
> diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch b/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
> new file mode 100644
> index 0000000000..44d707a235
> --- /dev/null
> +++ b/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
> @@ -0,0 +1,44 @@
> +From 90fdb0ae0418f7907f09b763343a457bdf6855fa Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Mon, 27 Jan 2020 17:17:19 -0800
> +Subject: [PATCH] tests: Make pthread_detatch call portable across platforms
> +
> +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);
> +|       |                         ^
> +
> +Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36910506/]
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + drd/tests/pth_detached3.c | 3 ++-
> + 1 file changed, 2 insertions(+), 1 deletion(-)
> +
> +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 <errno.h>
> + #include <pthread.h>
> + #include <stdio.h>
> ++#include <stdint.h>
> + 
> + 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");
> + 
> +-- 
> +2.25.0
> +
> diff --git a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
> index 0f86aa44ca..1475ff841e 100644
> --- a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
> +++ b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
> @@ -40,6 +40,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
>            file://0001-adjust-path-filter-for-2-memcheck-tests.patch \
>            file://s390x_vec_op_t.patch \
>            file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
> +           file://0001-tests-Make-pthread_detatch-call-portable-across-plat.patch \
>            "
> SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975"
> SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1"
> -- 
> 2.25.0
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] valgrind: Fix ptest builds on musl
  2020-01-28  8:09 ` [PATCH v2] valgrind: Fix ptest builds on musl Alexander Kanavin
@ 2020-01-28 10:07   ` Richard Purdie
  2020-01-28 16:08     ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2020-01-28 10:07 UTC (permalink / raw)
  To: Alexander Kanavin, Khem Raj; +Cc: openembedded-core

On Tue, 2020-01-28 at 09:09 +0100, Alexander Kanavin wrote:
> The reason I dropped the previous version of this is that with the
> patch the test failed, without the patch it passed. If you can
> confirm that the new version doesn’t regress the test I would
> appreciate. You can edit run-ptest prior to running it to include
> only the test suite with this test to make it quicker.

valgrind fails to build on musl without a patch:

https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/1499
https://autobuilder.yoctoproject.org/typhoon/#/builders/45/builds/1503

Cheers,

Richard



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] valgrind: Fix ptest builds on musl
  2020-01-28 10:07   ` Richard Purdie
@ 2020-01-28 16:08     ` Khem Raj
  0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2020-01-28 16:08 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

On Tue, Jan 28, 2020 at 2:07 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Tue, 2020-01-28 at 09:09 +0100, Alexander Kanavin wrote:
> > The reason I dropped the previous version of this is that with the
> > patch the test failed, without the patch it passed. If you can
> > confirm that the new version doesn’t regress the test I would
> > appreciate. You can edit run-ptest prior to running it to include
> > only the test suite with this test to make it quicker.
>
> valgrind fails to build on musl without a patch:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/1499
> https://autobuilder.yoctoproject.org/typhoon/#/builders/45/builds/1503
>

I have already sent a patch on top of master-next to fix this


> Cheers,
>
> Richard
>
>

[-- Attachment #2: Type: text/html, Size: 1554 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-28 16:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-28  3:58 [PATCH v2] valgrind: Fix ptest builds on musl Khem Raj
2020-01-28  4:03 ` ✗ patchtest: failure for valgrind: Fix ptest builds on musl (rev2) Patchwork
2020-01-28  8:09 ` [PATCH v2] valgrind: Fix ptest builds on musl Alexander Kanavin
2020-01-28 10:07   ` Richard Purdie
2020-01-28 16:08     ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.