Fix bz1389219 segmentation fault in trace-cmd snapshot

This commit is contained in:
Zamir SUN 2017-03-27 22:12:15 +08:00 committed by Zamir SUN
parent 5c93b8f27d
commit e1b080ce33
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff --git a/trace-snapshot.c b/trace-snapshot.c
index 9d3608c..f1036f6 100644
--- a/trace-snapshot.c
+++ b/trace-snapshot.c
@@ -42,7 +42,7 @@ static void write_file(const char *name, char *val)
n = write(fd, val, strlen(val));
if (n < 0)
- die("failed to write '%d' to %s\n", path);
+ die("failed to write to %s\n", path);
tracecmd_put_tracing_file(path);
close(fd);
}

View File

@ -4,7 +4,7 @@
Name: trace-cmd Name: trace-cmd
Version: 2.6 Version: 2.6
Release: 3%{?dist} Release: 4%{?dist}
License: GPLv2 and LGPLv2 License: GPLv2 and LGPLv2
Summary: A user interface to Ftrace Summary: A user interface to Ftrace
@ -19,6 +19,7 @@ Source0: trace-cmd-%{version}.tar.gz
Source1: kernelshark.desktop Source1: kernelshark.desktop
Patch1: trace-cmd-2.6-libdir.patch Patch1: trace-cmd-2.6-libdir.patch
Patch2: bz1386451-trace-cmd-record-crash-f-before-e.patch Patch2: bz1386451-trace-cmd-record-crash-f-before-e.patch
Patch3: bz1389219-segmentation-fault-in-trace-snapshot.patch
BuildRequires: xmlto BuildRequires: xmlto
BuildRequires: asciidoc BuildRequires: asciidoc
@ -47,6 +48,7 @@ Kernelshark is the GUI frontend for analyzing data produced by
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
%build %build
# MANPAGE_DOCBOOK_XSL define is hack to avoid using locate # MANPAGE_DOCBOOK_XSL define is hack to avoid using locate
@ -79,6 +81,9 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/kernelshark.desktop
%changelog %changelog
* Mon Mar 27 2017 Zamir SUN <zsun@fedoraproject.org> - 2.6-4
- Fix bz1389219 segmentation fault in trace-cmd snapshot
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-3 * Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild