summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@debian.org>2020-08-17 07:47:34 -0400
committerJames McCoy <jamessan@debian.org>2020-08-17 07:47:34 -0400
commit784c2ded595f3ba1170627904d03ff5e7d1483c4 (patch)
tree554b0984664dbce64f8bc6ea72b3dc96a73f19ef
parentb135d80d412574356f0ce405ac122658d2ca4eb9 (diff)
Commit patch queue (exported by git-debrebase)
[git-debrebase make-patches: export and commit patches]
-rw-r--r--debian/patches/Fix-crash-in-JavaHL-JNI-wrapper-caused-by-object-lifetime.patch44
-rw-r--r--debian/patches/series1
2 files changed, 45 insertions, 0 deletions
diff --git a/debian/patches/Fix-crash-in-JavaHL-JNI-wrapper-caused-by-object-lifetime.patch b/debian/patches/Fix-crash-in-JavaHL-JNI-wrapper-caused-by-object-lifetime.patch
new file mode 100644
index 0000000..08044aa
--- /dev/null
+++ b/debian/patches/Fix-crash-in-JavaHL-JNI-wrapper-caused-by-object-lifetime.patch
@@ -0,0 +1,44 @@
+From: Nathan Hartman <hartman.nathan@gmail.com>
+Date: Mon, 17 Aug 2020 07:46:49 -0400
+Subject: Fix crash in JavaHL JNI wrapper caused by object lifetimes
+
+See dev@ email thread "JNI segfault while running Java tests" started
+2020/08/08, archived at:
+
+https://lists.apache.org/thread.html/rff3fa5ea97267adf36cc9daa3be01392e53fbc8050a91df4bbac01d8%40%3Cdev.subversion.apache.org%3E
+https://svn.haxx.se/dev/archive-2020-08/0010.shtml
+
+* subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp
+ (Java::BaseImmutableMap::Entry::key): As the locally-scoped String::Contents
+ object keeps a reference to a String, ensure the String will remain in
+ scope for the lifetime of the String::Contents object by instantiating it
+ as a local variable.
+
+Reported by: jamessan
+
+Patch by: Daniel Sahlberg <daniel.l.sahlberg {_AT_} gmail.com>
+
+Reviewed by: Alexandr Miloslavskiy <alexandr.miloslavskiy {_AT_} syntevo.com>
+ hartmannathan
+
+Tested by: jamessan
+
+Signed-off-by: James McCoy <jamessan@debian.org>
+---
+ subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp b/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp
+index db05e28..3d6b588 100644
+--- a/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp
++++ b/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp
+@@ -144,7 +144,8 @@ protected:
+ {
+ const jstring jkey =
+ jstring(m_env.CallObjectMethod(m_jthis, impl().m_mid_get_key));
+- const String::Contents key(String(m_env, jkey));
++ const String str(m_env, jkey);
++ const String::Contents key(str);
+ return std::string(key.c_str());
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index d1e1ffb..a320583 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ python-builds
examples-compile-instructions
workaround_EINVAL_on_kfreebsd
use-python3-as-the-interpreter-now-for-tests-not-python.patch
+Fix-crash-in-JavaHL-JNI-wrapper-caused-by-object-lifetime.patch