aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/crypt_ops/crypto_rand_fast.c6
-rw-r--r--src/lib/malloc/map_anon.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/crypt_ops/crypto_rand_fast.c b/src/lib/crypt_ops/crypto_rand_fast.c
index c7f71a17c9..e6ceb42ccb 100644
--- a/src/lib/crypt_ops/crypto_rand_fast.c
+++ b/src/lib/crypt_ops/crypto_rand_fast.c
@@ -181,7 +181,11 @@ crypto_fast_rng_new_from_seed(const uint8_t *seed)
#else
/* We decided above that noinherit would always do _something_. Assert here
* that we were correct. */
- tor_assert(inherit != INHERIT_RES_KEEP);
+ tor_assertf(inherit != INHERIT_RES_KEEP,
+ "We failed to create a non-inheritable memory region, even "
+ "though we believed such a failure to be impossible! This is "
+ "probably a bug in Tor support for your platform; please report "
+ "it.");
#endif /* defined(CHECK_PID) || ... */
return result;
}
diff --git a/src/lib/malloc/map_anon.c b/src/lib/malloc/map_anon.c
index 219bd706cc..0f6a4150c7 100644
--- a/src/lib/malloc/map_anon.c
+++ b/src/lib/malloc/map_anon.c
@@ -74,6 +74,11 @@
#endif /* defined(HAVE_MINHERIT) || ... */
+#if defined(HAVE_MINHERIT) && !defined(FLAG_ZERO) && !defined(FLAG_NOINHERIT)
+#warn "minherit() is defined, but we couldn't find the right flag for it."
+#warn "This is probably a bug in Tor's support for this platform."
+#endif
+
/**
* Helper: try to prevent the <b>sz</b> bytes at <b>mem</b> from being swapped
* to disk. Return 0 on success or if the facility is not available on this