[abrt-java-connector/f20] Fix build

Jakub Filak jfilak at fedoraproject.org
Wed Feb 5 14:17:14 UTC 2014


commit a0edd4275f7e1e26068cb4e208d77a87a3f34536
Author: Jakub Filak <jfilak at redhat.com>
Date:   Tue Feb 4 17:04:36 2014 +0100

    Fix build

 ...turn-the-right-constant-from-Agent_OnLoad.patch |   26 +++++++++
 ...a-test-for-multiple-calls-of-Agent_OnLoad.patch |   54 ++++++++++++++++++++
 abrt-java-connector.spec                           |    8 +++-
 3 files changed, 87 insertions(+), 1 deletions(-)
---
diff --git a/0003-Return-the-right-constant-from-Agent_OnLoad.patch b/0003-Return-the-right-constant-from-Agent_OnLoad.patch
new file mode 100644
index 0000000..874b63a
--- /dev/null
+++ b/0003-Return-the-right-constant-from-Agent_OnLoad.patch
@@ -0,0 +1,26 @@
+From 9b09814b2a7b04105f784d7cb79836c057b92830 Mon Sep 17 00:00:00 2001
+From: Jakub Filak <jfilak at redhat.com>
+Date: Tue, 4 Feb 2014 16:37:12 +0100
+Subject: [PATCH 3/4] Return the right constant from Agent_OnLoad
+
+Related to rhbz#1049011
+---
+ src/abrt-checker.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/abrt-checker.c b/src/abrt-checker.c
+index f142d7e..e9caada 100644
+--- a/src/abrt-checker.c
++++ b/src/abrt-checker.c
+@@ -2930,7 +2930,7 @@ JNIEXPORT jint JNICALL Agent_OnLoad(
+ 
+     /* we need to make sure the agent is initialized once */
+     if (already_called) {
+-        return;
++        return JNI_OK;
+     }
+ 
+     already_called = 1;
+-- 
+1.8.3.1
+
diff --git a/0004-Add-a-test-for-multiple-calls-of-Agent_OnLoad.patch b/0004-Add-a-test-for-multiple-calls-of-Agent_OnLoad.patch
new file mode 100644
index 0000000..0e33925
--- /dev/null
+++ b/0004-Add-a-test-for-multiple-calls-of-Agent_OnLoad.patch
@@ -0,0 +1,54 @@
+From 3fdb3cebe489b75d23f1f21672d4aadd10471ad2 Mon Sep 17 00:00:00 2001
+From: Jakub Filak <jfilak at redhat.com>
+Date: Tue, 4 Feb 2014 16:38:02 +0100
+Subject: [PATCH 4/4] Add a test for multiple calls of Agent_OnLoad
+
+Related rhbz#1049011
+---
+ test/CMakeLists.txt                 | 10 ++++++++++
+ test/outputs/run_three_times.log.in | 13 +++++++++++++
+ 2 files changed, 23 insertions(+)
+ create mode 100644 test/outputs/run_three_times.log.in
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 0439294..5b117a1 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -317,5 +317,15 @@ _add_test(run_remote_thread 0)
+ _add_analyze_test(not_reportable_1remote_class)
+ _add_analyze_test(not_reportable_3remote_classes)
+ 
++_add_test_target(
++    run_three_times
++    SimpleTest
++    DEPENDS ${TEST_JAVA_TARGETS}
++    AGENT_OPTIONS caught=java.lang.ArrayIndexOutOfBoundsException:java.lang.NullPointerException -agentlib=${AGENT_NAME}=output=/proc/pid/0/java.log -agentlib=${AGENT_NAME}=output=/proc/pid/1/java.log
++)
++_add_test(run_three_times 2)
++
++
++
+ get_directory_property(all_run_targets ALL_RUN_TARGETS)
+ add_custom_target(run_all DEPENDS ${all_run_targets})
+diff --git a/test/outputs/run_three_times.log.in b/test/outputs/run_three_times.log.in
+new file mode 100644
+index 0000000..aa8b2c8
+--- /dev/null
++++ b/test/outputs/run_three_times.log.in
+@@ -0,0 +1,13 @@
++Caught exception java.lang.ArrayIndexOutOfBoundsException in method SimpleTest.throwIndexOutOfBoundsException()
++Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 42
++	at SimpleTest.throwIndexOutOfBoundsException(SimpleTest.java:24) [file:@CMAKE_BINARY_DIR@/test/SimpleTest.class]
++	at SimpleTest.catchIndexOutOfBoundsException(SimpleTest.java:47) [file:@CMAKE_BINARY_DIR@/test/SimpleTest.class]
++	at SimpleTest.throwAndCatchAllExceptions(SimpleTest.java:61) [file:@CMAKE_BINARY_DIR@/test/SimpleTest.class]
++	at SimpleTest.main(SimpleTest.java:81) [file:@CMAKE_BINARY_DIR@/test/SimpleTest.class]
++executable: @CMAKE_BINARY_DIR@/test/SimpleTest.class
++Uncaught exception java.lang.NullPointerException in method SimpleTest.throwNullPointerException()
++Exception in thread "main" java.lang.NullPointerException
++	at SimpleTest.throwNullPointerException(SimpleTest.java:36) [file:@CMAKE_BINARY_DIR@/test/SimpleTest.class]
++	at SimpleTest.throwAndDontCatchException(SimpleTest.java:71) [file:@CMAKE_BINARY_DIR@/test/SimpleTest.class]
++	at SimpleTest.main(SimpleTest.java:83) [file:@CMAKE_BINARY_DIR@/test/SimpleTest.class]
++executable: @CMAKE_BINARY_DIR@/test/SimpleTest.class
+-- 
+1.8.3.1
+
diff --git a/abrt-java-connector.spec b/abrt-java-connector.spec
index fc94fb7..f17d8c3 100644
--- a/abrt-java-connector.spec
+++ b/abrt-java-connector.spec
@@ -3,7 +3,7 @@
 
 Name:		abrt-java-connector
 Version:	1.0.8
-Release:	2%{?dist}
+Release:	3%{?dist}
 Summary:	JNI Agent library converting Java exceptions to ABRT problems
 
 Group:		System Environment/Libraries
@@ -13,6 +13,8 @@ Source0:	https://github.com/jfilak/%{name}/archive/%{commit}/%{name}-%{version}-
 
 Patch0001:	0001-Fix-a-pair-of-defects-uncovered-by-coverity.patch
 Patch0002:	0002-Make-sure-that-agent_onload-and-agent_onunload-are-p.patch
+Patch0003:	0003-Return-the-right-constant-from-Agent_OnLoad.patch
+Patch0004:	0004-Add-a-test-for-multiple-calls-of-Agent_OnLoad.patch
 
 BuildRequires:	cmake
 BuildRequires:	satyr-devel
@@ -71,6 +73,10 @@ make test
 
 
 %changelog
+* Tue Feb 04 2014 Jakub Filak <jfilak at redhat.com> - 1.0.8-3
+- Return the correct value from Agent_OnLoad
+- Add test for multiple calls of Agent_On*
+
 * Tue Feb 04 2014 Jakub Filak <jfilak at redhat.com> - 1.0.8-2
 - Make sure that agent_onload and agent_onunload are processed only once
 - Fix a pair of defects uncovered by coverity


More information about the scm-commits mailing list