New upstream release 1.0.9

This commit is contained in:
Jakub Filak 2014-03-18 11:53:25 +01:00
commit 2c11d95d21
7 changed files with 13 additions and 191 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@
/abrt-java-connector-1.0.6-befb850.tar.gz
/abrt-java-connector-1.0.7-873f82e.tar.gz
/abrt-java-connector-1.0.8-39322b0.tar.gz
/abrt-java-connector-1.0.9-c933894.tar.gz

View file

@ -1,51 +0,0 @@
From 54be469b8b91272e1f9852670a2f49e6bbecd0d8 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Wed, 22 Jan 2014 15:33:50 +0100
Subject: [PATCH 1/2] Fix a pair of defects uncovered by coverity
---
src/abrt-checker.c | 8 ++++++--
src/jthread_map.c | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/abrt-checker.c b/src/abrt-checker.c
index 91485e0..713053c 100644
--- a/src/abrt-checker.c
+++ b/src/abrt-checker.c
@@ -2886,7 +2886,11 @@ void parse_commandline_options(char *options)
}
else if (strcmp("executable", key) == 0)
{
- if (strcmp("threadclass", value) == 0)
+ if (NULL == value || '\0' == value[0])
+ {
+ fprintf(stderr, "A value of '%s' option cannot be empty\n", key);
+ }
+ else if (strcmp("threadclass", value) == 0)
{
VERBOSE_PRINT("Use a thread class for 'executable'\n");
executableFlags |= ABRT_EXECUTABLE_THREAD;
@@ -2899,7 +2903,7 @@ void parse_commandline_options(char *options)
}
else
{
- fprintf(stderr, "Unknown 'executable' option's value '%s'\n", key);
+ fprintf(stderr, "Unknown '%s' option's value '%s'\n", key, value);
}
}
else
diff --git a/src/jthread_map.c b/src/jthread_map.c
index 4517398..4cb417b 100644
--- a/src/jthread_map.c
+++ b/src/jthread_map.c
@@ -55,6 +55,7 @@ T_jthreadMap *jthread_map_new()
if (NULL == map)
{
fprintf(stderr, __FILE__ ":" STRINGIZE(__LINE__) ": calloc() error\n");
+ return NULL;
}
pthread_mutex_init(&map->mutex, /*use default attributes*/NULL);
--
1.8.3.1

View file

@ -1,51 +0,0 @@
From 71ac5da86488ace3ebb3f3fa4adc747a511634e2 Mon Sep 17 00:00:00 2001
From: Pavel Tisnovsky <ptisnovs@dhcp-lab-190.englab.brq.redhat.com>
Date: Mon, 3 Feb 2014 18:00:35 +0100
Subject: [PATCH 2/2] Make sure that agent_onload and agent_onunload are
processed only once.
---
src/abrt-checker.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/abrt-checker.c b/src/abrt-checker.c
index 713053c..f142d7e 100644
--- a/src/abrt-checker.c
+++ b/src/abrt-checker.c
@@ -2923,10 +2923,17 @@ JNIEXPORT jint JNICALL Agent_OnLoad(
char *options,
void *reserved __UNUSED_VAR)
{
+ static int already_called = 0;
jvmtiEnv *jvmti_env = NULL;
jvmtiError error_code = JVMTI_ERROR_NONE;
jint result;
+ /* we need to make sure the agent is initialized once */
+ if (already_called) {
+ return;
+ }
+
+ already_called = 1;
pthread_mutex_init(&abrt_print_mutex, /*attr*/NULL);
INFO_PRINT("Agent_OnLoad\n");
@@ -3001,6 +3008,15 @@ JNIEXPORT jint JNICALL Agent_OnLoad(
*/
JNIEXPORT void JNICALL Agent_OnUnload(JavaVM *vm __UNUSED_VAR)
{
+ static int already_called = 0;
+
+ /* we need to make sure the agent is initialized once */
+ if (already_called) {
+ return;
+ }
+
+ already_called = 1;
+
pthread_mutex_destroy(&abrt_print_mutex);
INFO_PRINT("Agent_OnUnLoad\n");
--
1.8.3.1

View file

@ -1,26 +0,0 @@
From 9b09814b2a7b04105f784d7cb79836c057b92830 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@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

View file

@ -1,54 +0,0 @@
From 3fdb3cebe489b75d23f1f21672d4aadd10471ad2 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@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

View file

@ -1,9 +1,9 @@
%global commit 39322b058d182855559ce0d6679e3ad5de5dc82e
%global commit c933894f160345a685ee2b1664adc1d1c65a4875
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: abrt-java-connector
Version: 1.0.8
Release: 3%{?dist}
Version: 1.0.9
Release: 1%{?dist}
Summary: JNI Agent library converting Java exceptions to ABRT problems
Group: System Environment/Libraries
@ -11,11 +11,6 @@ License: GPLv2+
URL: https://github.com/jfilak/abrt-java-connector
Source0: https://github.com/jfilak/%{name}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
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
BuildRequires: libreport-devel
@ -23,6 +18,7 @@ BuildRequires: abrt-devel
BuildRequires: java-1.7.0-openjdk-devel
BuildRequires: systemd-devel
BuildRequires: gettext
BuildRequires: check-devel
BuildRequires: git
Requires: abrt
@ -49,11 +45,13 @@ make install DESTDIR=%{buildroot}
%config(noreplace) %{_sysconfdir}/libreport/plugins/bugzilla_format_java.conf
%config(noreplace) %{_sysconfdir}/libreport/plugins/bugzilla_formatdup_java.conf
%config(noreplace) %{_sysconfdir}/libreport/events.d/java_event.conf
%config(noreplace) %{_sysconfdir}/abrt/plugins/java.conf
%{_bindir}/abrt-action-analyze-java
%{_mandir}/man1/abrt-action-analyze-java.1*
%{_mandir}/man5/java_event.conf.5*
%{_mandir}/man5/bugzilla_format_java.conf.5*
%{_mandir}/man5/bugzilla_formatdup_java.conf.5*
%{_datadir}/abrt/conf.d/plugins/java.conf
# install only unversioned shared object because the package is a Java plugin
# and not a system library but unfortunately the library must be placed in ld
@ -73,6 +71,11 @@ make test
%changelog
* Tue Mar 18 2014 Jakub Filak <jfilak@redhat.com> - 1.0.9-1
- Make the agent configurable via a configuration file
- Include custom debug info in bug reports
- Make the detection of 'executable' working with JAR files
* Tue Feb 04 2014 Jakub Filak <jfilak@redhat.com> - 1.0.8-3
- Return the correct value from Agent_OnLoad
- Add test for multiple calls of Agent_On*

View file

@ -1 +1 @@
5dd39a61a4775e3bea30a46968668ede abrt-java-connector-1.0.8-39322b0.tar.gz
0984ec9f3459c142b39b18db229e441e abrt-java-connector-1.0.9-c933894.tar.gz