Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
meta-openharmony
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
oniro4openharmony
meta-openharmony
Merge requests
!91
Fix ActsFautLoggerTest
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix ActsFautLoggerTest
faultloggertest
into
kirkstone
Overview
1
Commits
4
Pipelines
9
Changes
9
Merged
Esben Haabendal
requested to merge
faultloggertest
into
kirkstone
2 years ago
Overview
1
Commits
4
Pipelines
9
Changes
9
Expand
Closes eclipse/oniro-core/meta-openharmony#84
Edited
2 years ago
by
Esben Haabendal
0
0
Merge request reports
Compare
kirkstone
version 3
214b265b
2 years ago
version 2
8ffa8113
2 years ago
version 1
64faa76b
2 years ago
kirkstone (base)
and
latest version
latest version
6671cc18
4 commits,
2 years ago
version 3
214b265b
3 commits,
2 years ago
version 2
8ffa8113
3 commits,
2 years ago
version 1
64faa76b
3 commits,
2 years ago
9 files
+
161
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-fix-faultloggertest.patch
0 → 100644
+
86
−
0
Options
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Patch for //test/xts/acts repository of OpenHarmony 3.0 codebase.
This fixes the ActsFaultLogger test-case.
- Optimization needs to be disabled to avoid compiler optimizing out the null
pointer dereference.
- In order for the faultloggerd process to actually generate the log files,
applications needs to install the needed signal handlers, as documented in
base/hiviewdfx/faultloggerd/README.md
- Align the test with it's own name, so it actually matches on the generated
crash log.
Signed-off-by: Esben Haabendal <esben@geanix.com>
Upstream-Status: Inappropritate [test-case was dropped in 3.0.2]
diff --git a/hiviewdfx/faultloggertest/faultloggercpptest/BUILD.gn b/hiviewdfx/faultloggertest/faultloggercpptest/BUILD.gn
index 0eeb66084952..4ba249d8c4af 100755
--- a/hiviewdfx/faultloggertest/faultloggercpptest/BUILD.gn
+++ b/hiviewdfx/faultloggertest/faultloggercpptest/BUILD.gn
@@ -23,6 +23,7 @@
config("faultloggertest_config") {
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
"genfault.h",
]
+ cflags = [ "-O0" ]
}
ohos_moduletest_suite("ActsFaultLoggerTest") {
module_out_path = module_output_path
@@ -33,6 +34,7 @@
ohos_moduletest_suite("ActsFaultLoggerTest") {
deps = [
"../../utils/native:utilskit",
"//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
+ "//base/hiviewdfx/faultloggerd/interfaces/innerkits/signal_handler:dfx_signalhandler",
"//third_party/googletest:gtest_main",
"//utils/native/base:utils",
]
diff --git a/hiviewdfx/faultloggertest/faultloggercpptest/faultloggertest.cpp b/hiviewdfx/faultloggertest/faultloggercpptest/faultloggertest.cpp
index 5870de2257c1..ff00cffddf9f 100755
--- a/hiviewdfx/faultloggertest/faultloggercpptest/faultloggertest.cpp
+++ b/hiviewdfx/faultloggertest/faultloggercpptest/faultloggertest.cpp
@@ -22,6 +22,8 @@
#include "hilog/log_c.h"
#include "hilog/log_cpp.h"
+#include "dfx_signal_handler.h"
+
#undef LOG_DOMAIN
#undef LOG_TAG
#define LOG_DOMAIN 0xD003200
@@ -60,6 +62,7 @@
pid_t faultloggertest::DoTestProcess(int faulttype)
{
printf("DoTestProcess, param is %d\r\n", faulttype);
pid_t pid;
+ static int installed = 0;
pid = fork();
printf("pid is %d\r\n", pid);
switch (pid) {
@@ -70,6 +73,11 @@
pid_t faultloggertest::DoTestProcess(int faulttype)
GenFault(faulttype);
break;
default:
+ if (installed == 0) {
+ DFX_InstallSignalHandler();
+ std::cout << "DFX signal handler installed"<<std::endl;
+ installed = 1;
+ }
break;
}
wait(&status);
@@ -130,9 +138,9 @@
HWTEST_F(faultloggertest, Faultlogger_Faultdetect1, Function|MediumTest|Level1)
string fileinfo;
fileinfo = ReadFile("/data/log/faultlog/temp/" + faultloggerfile);
std::vector<std::string> para = {"Pid:" + to_string(pid), "Uid:0",
- "Process name:", "/data/local/tmp/faultloggertest",
+ "Process name:", "/data/local/tmp/ActsFaultLoggerTest",
"Reason:Signal:SIGILL", "Fault thread Info:",
- "Tid:" + to_string(pid), "Name:faultloggertest"};
+ "Tid:" + to_string(pid), "Name:ActsFaultLoggerTest"};
if (!fileinfo.empty()) {
result = CheckInfo(para, fileinfo);
} else {
Loading