summaryrefslogtreecommitdiff
path: root/debian/patches/0028-xxx-hopefully-fix-proc-crash.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0028-xxx-hopefully-fix-proc-crash.patch')
-rw-r--r--debian/patches/0028-xxx-hopefully-fix-proc-crash.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/debian/patches/0028-xxx-hopefully-fix-proc-crash.patch b/debian/patches/0028-xxx-hopefully-fix-proc-crash.patch
new file mode 100644
index 00000000..f780e570
--- /dev/null
+++ b/debian/patches/0028-xxx-hopefully-fix-proc-crash.patch
@@ -0,0 +1,70 @@
+From 5b177309d41bd79506c9d96df8da00313603569a Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Fri, 21 Nov 2014 04:48:41 +0100
+Subject: [PATCH hurd 28/29] xxx hopefully fix proc crash
+
+---
+ libports/destroy-right.c | 26 ++++++--------------------
+ 1 file changed, 6 insertions(+), 20 deletions(-)
+
+diff --git a/libports/destroy-right.c b/libports/destroy-right.c
+index 9eb29eb..3a78e0b 100644
+--- a/libports/destroy-right.c
++++ b/libports/destroy-right.c
+@@ -27,7 +27,7 @@
+ #include <time.h>
+
+ /* To prevent protected payloads from becoming stale, we defer the
+- derefercing of port_info objects. */
++ derefercing of port_info objects. Consumes PI. */
+ static error_t defer_dereferencing (struct port_info *pi);
+
+ error_t
+@@ -116,19 +116,6 @@ gc_loop (void *arg)
+ while (d != NULL)
+ {
+ struct deferred_dereference *next = d->next;
+- struct references refs;
+-
+- refcounts_references (&d->pi->refcounts, &refs);
+-
+- // XXX: Need to think more about this.
+- assert (refs.hard <= 2 || !"reference to destroyed right leaked");
+-
+- if (refs.hard == 2)
+- {
+- /* XXX: does this actually happen? if so, why?? */
+- /* Get rid of the hash table reference. */
+- ports_port_deref (d->pi);
+- }
+
+ /* Get rid of our reference. */
+ ports_port_deref (d->pi);
+@@ -161,19 +148,18 @@ start_gc (void)
+ assert_perror (err);
+ }
+
+-/* Defer the derefercing of port_info objects. */
++/* Defer the derefercing of port_info objects. Consumes PI. */
+ static error_t
+ defer_dereferencing (struct port_info *pi)
+ {
+ static pthread_once_t once = PTHREAD_ONCE_INIT;
+ int g;
+- struct deferred_dereference *d = malloc (sizeof *d);
+- if (d == NULL)
+- return ENOMEM;
+-
++ struct deferred_dereference *d;
+ pthread_once (&once, start_gc);
+
+- ports_port_ref (pi);
++ d = malloc (sizeof *d);
++ if (d == NULL)
++ return ENOMEM;
+ d->pi = pi;
+
+ retry:
+--
+2.1.3
+