Skip to contentSkip to conversation

Patch "perf tools: Fix perf script python database export crash" has been added to the 4.5-stable tree

PATCH [email protected] 1 participant 1 message May 2, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

perf tools: Fix perf script python database export crash

to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
perf-tools-fix-perf-script-python-database-export-crash.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 616df645d7238e45d3b369933a30fee4e4e305e2 Mon Sep 17 00:00:00 2001

From: Chris Phlipot <[email protected]>
Date: Tue, 8 Mar 2016 21:11:54 -0800
Subject: perf tools: Fix perf script python database export crash

From: Chris Phlipot <[email protected]>

commit 616df645d7238e45d3b369933a30fee4e4e305e2 upstream.

Remove the union in evsel so that the database id and priv pointer can be used simultainously without conflicting and crashing.

Detailed Description for the fixed bug follows:

perf script crashes with a segmentation fault on user space tool version 4.5.rc7.ge2857b when using the python database export API. It works properly in 4.4 and prior versions.

the crash fist appeared in:

cfc8874a4859 ("perf script: Process cpu/threads maps")

How to reproduce the bug:

Remove any temporary files left over from a previous crash (if you have already attemped to reproduce the bug):

  $ rm -r test_db-perf-data
  $ dropdb test_db
  $ perf record timeout 1 yes >/dev/null
  $ perf script -s scripts/python/export-to-postgresql.py test_db

Stack Trace:
Program received signal SIGSEGV, Segmentation fault. __GI___libc_free (mem=0x1) at malloc.c:2929
2929 malloc.c: No such file or directory.
(gdb) bt

    at util/stat.c:122
    argv=<optimized out>, prefix=<optimized out>) at builtin-script.c:2231
    argc=argc@entry=4, argv=argv@entry=0x7fffffffdf70) at perf.c:390
    at perf.c:451
---
 tools/perf/util/evsel.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
tools/perf/util/evsel.h +2 -4
@@ -93,10 +93,8 @@ struct perf_evsel {
 	const char		*unit;
 	struct event_format	*tp_format;
 	off_t			id_offset;
-	union {
-		void		*priv;
-		u64		db_id;
-	};
+	void			*priv;
+	u64			db_id;
 	struct cgroup_sel	*cgrp;
 	void			*handler;
 	struct cpu_map		*cpus;

Patches currently in stable-queue which might be from [email protected] are

queue-4.5/perf-tools-fix-perf-script-python-database-export-crash.patch