syz-fuzzer: write programs directly to stdout

On fuchsia log package misbehaves and programs are lost:
https://fuchsia.atlassian.net/browse/TC-151
Write directly to stdout. Also should be slightly faster and shorter.
This commit is contained in:
Dmitry Vyukov 2018-06-06 20:39:36 +02:00
parent a6bf43aeeb
commit 7efe08c90a

View File

@ -295,8 +295,11 @@ func (proc *Proc) logProgram(opts *ipc.ExecOpts, p *prog.Prog) {
// It must not be intermixed.
switch proc.fuzzer.outputType {
case OutputStdout:
now := time.Now()
proc.fuzzer.logMu.Lock()
log.Logf(0, "executing program %v%v:\n%s\n", proc.pid, strOpts, data)
fmt.Printf("%02v:%02v:%02v executing program %v%v:\n%s\n",
now.Hour(), now.Minute(), now.Second(),
proc.pid, strOpts, data)
proc.fuzzer.logMu.Unlock()
case OutputDmesg:
fd, err := syscall.Open("/dev/kmsg", syscall.O_WRONLY, 0)