All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf
@ 2019-05-09 11:04 Jörg Krause
  2019-05-09 11:04 ` [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl Jörg Krause
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jörg Krause @ 2019-05-09 11:04 UTC (permalink / raw)
  To: buildroot

Otherwise build fails with:

```
configure.ac:630: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
```

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 package/libupnp18/libupnp18.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/libupnp18/libupnp18.mk b/package/libupnp18/libupnp18.mk
index 5154be5316..35e8dc4a47 100644
--- a/package/libupnp18/libupnp18.mk
+++ b/package/libupnp18/libupnp18.mk
@@ -11,12 +11,13 @@ LIBUPNP18_CONF_ENV = ac_cv_lib_compat_ftime=no
 LIBUPNP18_INSTALL_STAGING = YES
 LIBUPNP18_LICENSE = BSD-3-Clause
 LIBUPNP18_LICENSE_FILES = COPYING
+LIBUPNP18_DEPENDENCIES = host-pkgconf
 # We're patching configure.ac
 LIBUPNP18_AUTORECONF = YES
 
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
 LIBUPNP18_CONF_OPTS += --enable-open-ssl
-LIBUPNP18_DEPENDENCIES += host-pkgconf openssl
+LIBUPNP18_DEPENDENCIES += openssl
 else
 LIBUPNP18_CONF_OPTS += --disable-open-ssl
 endif
-- 
2.21.0

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

* [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl
  2019-05-09 11:04 [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf Jörg Krause
@ 2019-05-09 11:04 ` Jörg Krause
  2019-05-18 21:32   ` Thomas Petazzoni
  2019-06-06  7:35   ` Peter Korsgaard
  2019-05-18 21:32 ` [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf Thomas Petazzoni
  2019-06-06  7:35 ` Peter Korsgaard
  2 siblings, 2 replies; 6+ messages in thread
From: Jörg Krause @ 2019-05-09 11:04 UTC (permalink / raw)
  To: buildroot

Applications build with a musl 1.1.20+ toolchain and linked with libupnpp will
crash at runtime with `Illegal instruction` as musl is more strict with
trying to detach an already detached thread resulting in undefined
behaviour.

Upstream status:
https://github.com/mrjimenez/pupnp/issues/102

Backported from:
https://github.com/mrjimenez/pupnp/commit/04b454f693d0c71336252380d08f1d02967e133e

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 ...tach-detached-thread-the-result-is-u.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/libupnp18/0002-Do-not-try-to-detach-detached-thread-the-result-is-u.patch

diff --git a/package/libupnp18/0002-Do-not-try-to-detach-detached-thread-the-result-is-u.patch b/package/libupnp18/0002-Do-not-try-to-detach-detached-thread-the-result-is-u.patch
new file mode 100644
index 0000000000..601ea89be7
--- /dev/null
+++ b/package/libupnp18/0002-Do-not-try-to-detach-detached-thread-the-result-is-u.patch
@@ -0,0 +1,39 @@
+From 04b454f693d0c71336252380d08f1d02967e133e Mon Sep 17 00:00:00 2001
+From: Jean-Francois Dockes <jf@dockes.org>
+Date: Sun, 27 Jan 2019 10:44:17 +0100
+Subject: [PATCH] Do not try to detach detached thread, the result is
+ undefined. Fixes issue #102
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes runtime crash with musl 1.1.20+. The problem is that libupnp is
+calling pthread_detach() on a thread which was created in the detached state.
+
+Backported from: 04b454f693d0c71336252380d08f1d02967e133e
+
+(cherry picked from commit 386b7ed79146ecf7a3bba49f48cb8f41a9b49170)
+Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
+---
+ upnp/src/threadutil/ThreadPool.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/upnp/src/threadutil/ThreadPool.c b/upnp/src/threadutil/ThreadPool.c
+index d272907..5e590ed 100644
+--- a/upnp/src/threadutil/ThreadPool.c
++++ b/upnp/src/threadutil/ThreadPool.c
+@@ -651,11 +651,6 @@ static int CreateWorker(
+ 	rc = ithread_create(&temp, &attr, WorkerThread, tp);
+ 	ithread_attr_destroy(&attr);
+ 	if (rc == 0) {
+-		rc = ithread_detach(temp);
+-		/* ithread_detach will return EINVAL if thread has been
+-		 successfully detached by ithread_create */
+-		if (rc == EINVAL)
+-			rc = 0;
+ 		tp->pendingWorkerThreadStart = 1;
+ 		/* wait until the new worker thread starts */
+ 		while (tp->pendingWorkerThreadStart) {
+-- 
+2.21.0
+
-- 
2.21.0

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

* [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf
  2019-05-09 11:04 [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf Jörg Krause
  2019-05-09 11:04 ` [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl Jörg Krause
@ 2019-05-18 21:32 ` Thomas Petazzoni
  2019-06-06  7:35 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2019-05-18 21:32 UTC (permalink / raw)
  To: buildroot

On Thu,  9 May 2019 13:04:37 +0200
J?rg Krause <joerg.krause@embedded.rocks> wrote:

> Otherwise build fails with:
> 
> ```
> configure.ac:630: error: possibly undefined macro: AC_MSG_ERROR
>       If this token and others are legitimate, please use m4_pattern_allow.
> ```
> 

You forgot to add a reference to the autobuilder failure that this
commit fixes, so I've added it and applied to master. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl
  2019-05-09 11:04 ` [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl Jörg Krause
@ 2019-05-18 21:32   ` Thomas Petazzoni
  2019-06-06  7:35   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2019-05-18 21:32 UTC (permalink / raw)
  To: buildroot

On Thu,  9 May 2019 13:04:38 +0200
J?rg Krause <joerg.krause@embedded.rocks> wrote:

> Applications build with a musl 1.1.20+ toolchain and linked with libupnpp will
> crash at runtime with `Illegal instruction` as musl is more strict with
> trying to detach an already detached thread resulting in undefined
> behaviour.
> 
> Upstream status:
> https://github.com/mrjimenez/pupnp/issues/102
> 
> Backported from:
> https://github.com/mrjimenez/pupnp/commit/04b454f693d0c71336252380d08f1d02967e133e
> 
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
>  ...tach-detached-thread-the-result-is-u.patch | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 package/libupnp18/0002-Do-not-try-to-detach-detached-thread-the-result-is-u.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf
  2019-05-09 11:04 [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf Jörg Krause
  2019-05-09 11:04 ` [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl Jörg Krause
  2019-05-18 21:32 ` [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf Thomas Petazzoni
@ 2019-06-06  7:35 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-06-06  7:35 UTC (permalink / raw)
  To: buildroot

>>>>> "J?rg" == J?rg Krause <joerg.krause@embedded.rocks> writes:

 > Otherwise build fails with:
 > ```
 > configure.ac:630: error: possibly undefined macro: AC_MSG_ERROR
 >       If this token and others are legitimate, please use m4_pattern_allow.
 > ```

 > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>

Committed to 2019.02.x, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl
  2019-05-09 11:04 ` [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl Jörg Krause
  2019-05-18 21:32   ` Thomas Petazzoni
@ 2019-06-06  7:35   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-06-06  7:35 UTC (permalink / raw)
  To: buildroot

>>>>> "J?rg" == J?rg Krause <joerg.krause@embedded.rocks> writes:

 > Applications build with a musl 1.1.20+ toolchain and linked with libupnpp will
 > crash at runtime with `Illegal instruction` as musl is more strict with
 > trying to detach an already detached thread resulting in undefined
 > behaviour.

 > Upstream status:
 > https://github.com/mrjimenez/pupnp/issues/102

 > Backported from:
 > https://github.com/mrjimenez/pupnp/commit/04b454f693d0c71336252380d08f1d02967e133e

 > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>

Committed to 2019.02.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2019-06-06  7:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 11:04 [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf Jörg Krause
2019-05-09 11:04 ` [Buildroot] [PATCH 2/2] package/libupnp18: add upstream patch to fix runtime crash with musl Jörg Krause
2019-05-18 21:32   ` Thomas Petazzoni
2019-06-06  7:35   ` Peter Korsgaard
2019-05-18 21:32 ` [Buildroot] [PATCH 1/2] package/libupnp18: needs host-pkgconf Thomas Petazzoni
2019-06-06  7:35 ` Peter Korsgaard

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.