Module Name: src
Committed By: pooka
Date: Tue Dec 16 17:00:17 UTC 2014
Modified Files:
src/lib/librumpuser: rumpuser_pth.c
Log Message:
With glibc on ARM kthread_exit() aborts because pthread_exit() fails
to unwind the stack. Add a temporary workaround where we simply don't
allow the thread to exit (a kernel thread exit is a relatively uncommon
event in a rump kernel anyway).
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/librumpuser/rumpuser_pth.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/librumpuser/rumpuser_pth.c
diff -u src/lib/librumpuser/rumpuser_pth.c:1.43 src/lib/librumpuser/rumpuser_pth.c:1.44
--- src/lib/librumpuser/rumpuser_pth.c:1.43 Tue Nov 4 19:05:17 2014
+++ src/lib/librumpuser/rumpuser_pth.c Tue Dec 16 17:00:17 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser_pth.c,v 1.43 2014/11/04 19:05:17 pooka Exp $ */
+/* $NetBSD: rumpuser_pth.c,v 1.44 2014/12/16 17:00:17 pooka Exp $ */
/*
* Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
#include "rumpuser_port.h"
#if !defined(lint)
-__RCSID("$NetBSD: rumpuser_pth.c,v 1.43 2014/11/04 19:05:17 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_pth.c,v 1.44 2014/12/16 17:00:17 pooka Exp $");
#endif /* !lint */
#include <sys/queue.h>
@@ -104,6 +104,17 @@ __dead void
rumpuser_thread_exit(void)
{
+ /*
+ * FIXXXME: with glibc on ARM pthread_exit() aborts because
+ * it fails to unwind the stack. In the typical case, only
+ * the mountroothook thread will exit and even that's
+ * conditional on vfs being present.
+ */
+#if (defined(__ARMEL__) || defined(__ARMEB__)) && defined(__GLIBC__)
+ for (;;)
+ pause();
+#endif
+
pthread_exit(NULL);
}