Re: [RFC][PATCH 00/12] various perf fixes

From: Dmitry Vyukov
Date: Mon Feb 15 2016 - 12:46:31 EST


On Mon, Feb 15, 2016 at 6:07 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Mon, Feb 15, 2016 at 06:04:15PM +0100, Dmitry Vyukov wrote:
>> There is something wrong and I guess it is not actually working.
>> Please post your config file so that I can double check. In
>> particular, did you set "cover": false?
>
>
> {
> "http": "localhost:50000",
> "workdir": "root/gopath/src/github.com/google/syzkaller/workdir",
> "syzkaller": "/root/gopath/src/github.com/google/syzkaller",
> "vmlinux": "-",
> "type": "local",
> "count": 1,
> "procs": 160,
> "cover": false,
> "dropprivs": false,
> "enable_syscalls": [
> "perf_event_open",
> "ioctl$PERF*",
> "prctl$void",
> "bpf$*",
> "sched_yield"
> ]
> }


Ah, OK, it's actually working, everything is fine. You can double
check it by executing:

$ curl http://localhost:50000 | grep "exec total"

On my machine it produces (this is number of executed test programs per second):
exec total: 1196/sec<br>

However, you need to add getpid and gettid syscalls to the list of
enabled syscalls in config (they are required for perf_event_open):

"enable_syscalls": [
"getpid",
"gettid",
"perf_event_open",
"ioctl$PERF*",
"prctl$void",
"bpf$*",
"sched_yield"
]

(you can also add few other syscalls if you think they can be
relevant, but I am able to trigger perf crashes with just these)

And note that syz-manager binary won't notify you about any crashes,
you need to look in dmesg (and maybe at hanged processes).

I've collected some corpus of perf-related programs with coverage in
my setup. If you extract the attached archive into
root/gopath/src/github.com/google/syzkaller/workdir/corpus/ dir, it
should significantly speed up triggering of bugs (note that you did
not add / in front of the path, so it should be in your cwd).
While collecting the corpus I've triggered whole lot of crashes in few minutes:
https://gist.githubusercontent.com/dvyukov/9433b40adb094cc22cf2/raw/8642ad53ea44f604168189c568b419ba498dd5f3/gistfile1.txt

Attachment: corpus.zip
Description: Zip archive