Commit Graph

289 Commits

Author SHA1 Message Date
Michael Pratt
603b512405 vm/gvisor: use runsc debug --stacks to diagnose
This feature has been around longer than -trace-signal. It returns the
stacks directly, which we then append to the kernel log.
2018-12-21 18:08:49 +01:00
Michael Pratt
2fc01104d0 vm: allow Diagnose to directly return diagnosis
Rather than writing the diagnosis to the kernel console, Diagnose can
now directly return the extra debugging info, which will be appended ot
the kernel console log.
2018-12-21 18:08:49 +01:00
Dmitry Vyukov
a9cc88c19f pkg/osutil: provide better Rename
os.Rename fails for cross-device renaming (e.g. to/from tmpfs).
This is quite unpleasant. Provide own version that falls back to copying.
2018-12-17 19:09:10 +01:00
Dmitry Vyukov
527230f1d9 vm: fix string duplication
gometalinter says:

vm/vm.go:295:1⚠️ fuzzerPreemptedStr is unused (deadcode)
2018-12-17 10:46:08 +01:00
Dmitry Vyukov
c7e64e2b4f vm: don't call Diagnose when VM hasn't crashed
Fixes #875
2018-12-16 13:54:07 +01:00
Dmitry Vyukov
4bc415c230 vm: add tests for MonitorExecution
This gives almost 100% coverage for MonitorExecution.
Test all corner cases like lost connection, no output,
diagnose, exiting/non-exiting programs, etc.

Update #875
2018-12-16 13:54:03 +01:00
Michael Pratt
d5cf08b04e vm/gvisor: don't close conn on error
If net.Dial returns an error, conn is nil and closing it will panic.
2018-12-13 09:38:49 +01:00
Michael Pratt
c9d6aae44b Merge pull request #872 from prattmic/patch-2
vm/gvisor: support forwarding on IPv6
2018-12-13 09:38:36 +01:00
Dmitry Vyukov
7ed11ab916 vm: respect Shutdown signal in waitForOutput 2018-12-12 13:05:51 +01:00
Michael Pratt
c3b10a5d6a vm/gvisor: replace signal panic with log
Diagnose currently sends the panic signal to generate a traceback for
additional context.

However, Diagnose is also called in otherwise successful scenarios
(vm.Instance.MonitorExecution -> vm.monitor.extractError). Triggering a
panic will make this successful scenario look like a failure.

We could simply suppress this panic, but 1) that means we never shutdown
cleanly (not important, but ugly), and 2) we're less likely to detect
delayed crashes since we kill the sandbox immediately (that's what
MonitorExecution is checking for).

Instead, switch from -panic-signal to -trace-signal, which simply logs a
traceback without exiting. This option was added to runsc in
24c1158b9c.

The other uses of Diagnose will always generate a report regardless of
an additional panic, so we're not losing any reports.
2018-12-12 10:12:35 +01:00
Dmitry Vyukov
7dcaeaf322 vm/gce: close old consolew in Run
Run can be executed several times on a VM.
2018-12-02 13:23:51 +00:00
Greg Steuck
7a0edfbe7c vm/gce: use openbsd console diagnostic code for both vmm and gce
* openbsd: use console diagnostic code for both vmm and gce.

* gometalinter wants less indentation and more stuff in scope

* Comment no longer applies
2018-12-02 13:22:10 +00:00
Michael Tüxen
271b354c51 vm/qemu: improve debug output
* vm/qemu: Improve debug output.

When running in debug mode, the number of VMs is reduced to 1.
State this in the debug output.

* vm/qemu: Don't start debug output with a capital letter.

As requested by Dimitry.

* vm: Provide debug message when reduing number of VMs.

Apply this change to all affected platforms for consistency.
Suggested by Dmitry.

* Add myself to AUTHORS/CONTRIBUTORS files.

* vm: Fix compilation issues missed in earlier commit.

* vm: Use logging to write debug message.
2018-11-30 17:12:03 +00:00
Michael Tuexen
ade12e9162 vm/qemu: Allow empty qemu-args.
Allow setting qemu_args to "" in the config file. This is needed
when running qemu from the qemu-devel package on FreeBSD, which
does not support the -enable-kvm option.
Without this patch, an entry "" is added to the list of command
line parameters, which breaks the starting of the qemu instances.
2018-11-30 13:12:57 +00:00
Greg Steuck
6419afbb77 openbsd: run on gce
* build/openbsd: minor cleanup (use tuples instead of maps)

* Grammar nits in comments.

* Simplify openbsd.Create, will defer when there's more than one error exit.

* pkg/build: Support copying kernel into GCE image

* Simple test for openbsd image copy build.

* Cleanup in case something failed before.

* Support multi-processor VMs on GCE.

* More debug

* Reformat

* OpenBSD gce image needs to be raw.

* GC

* Force format to GNU directly on Go 1.10 or newer.

* Use vmType passed as a parameter inside openbsd.go

* gofmt

* more fmt

* Can't use GENERIC.mp just yet.

* capitalize

* Copyright
2018-11-27 13:14:06 +01:00
Greg Steuck
5bb36a9ef8 openbsd: include process information into crashes 2018-11-21 05:52:48 +01:00
Anton Lindqvist
f5e275d1d9 vm/vmm: make sure to always end ddb commands with a newline
Missed one in my previous commit.
2018-11-15 14:28:30 -08:00
Anton Lindqvist
74dbb80644 vm/vmm: disable pagination and show panic in Diagnose()
The ddb(4) debugger defaults to showing 24 lines at a time, the next chunk of
lines will be displayed only after receiving keyboard input. Setting maxlines to
0 disables pagination completely.
2018-11-12 12:03:13 -08:00
Dmitry Vyukov
6d8b3311b9 vm/qemu: don't use e1000 on arm64
arm64 uses virtio net by default and does not support e1000.
So don't override the default and use e1000 only for 386/amd64.
2018-10-28 19:07:22 +01:00
Dmitry Vyukov
75f4f60336 vm/qemu: use -cpu host,migratable=off
This exposes the maximum amount of features to the guest.
migratable=off exposes features that qemu does not know about too.
2018-10-28 19:07:22 +01:00
Nicolas Lacasse
d257b2d2d8 Pass -debug flag to runsc.
As of commit 3f053259, gVisor sentry panics are no longer sent to the
stderr for "runsc run" by default, as that stderr belongs exclusively to
the application.

As a result, syzbot never sees the gVisor panic stack trace, and is only
reporting errors that occur when waiting for a dead sandbox.

Passing the "-debug" flag to runsc will make the sentry panics visible
to syzbot again.
2018-10-17 21:43:37 +02:00
Anton Lindqvist
4b94574dd4 vm/vmm: use derived disks for VMs
As a result, the boot time is significantly improved since there's no longer any
need to copy the complete disk.

This feature was recently committed to OpenBSD-current. Any existing base image
used must be recreated, this time using the qcow2 disk format.
2018-10-11 19:47:20 +02:00
Dmitry Vyukov
2d41b5d964 vm/vmm: recover from vmctl errors faster
vmctl start periodically fails with:
	vmctl: start vm command failed: Operation already in progress

So try to sleep for a bit after vmctl stop.
And detect when vmctl start terminates prematurely
to avoid 10 minute timeout for ip extraction.
2018-09-20 19:44:50 +02:00
Dmitry Vyukov
565a5452a1 vm/vmm: don't start separate process for console
vmctl console fails from time to time with:

vmctl: console not found

Probably there is some race (most of these things assume
that there is a human typing commands with delays).

Also, vmctl start can connect to console itself with -c flag.
So use that because it both solves the console race and
also makes code much more similar to other VM implementations (qemu, gvisor).
This also eliminates 3 additional goroutines per VM.
2018-09-20 14:54:07 +02:00
Dmitry Vyukov
23db2ea6f9 vm/vmm: fix fd leaks
Close pipe fd's on failure paths.
Don't close outr because OutputMerger closes all passed in fd's.
2018-09-20 14:54:03 +02:00
Dmitry Vyukov
88f20b7bcc vm/vmm: increase timeouts
A dozen of vmm's running on a GCE machine can be really slow to boot.
Timeouts have only single goal: preventing complete system stalls
when/if external commands episodically hang. There is no value
in keeping them as close as possible to expected durations.
This can only lead to various flakes. Increase timeouts by an
order of magnitude.
2018-09-20 14:53:59 +02:00
Dmitry Vyukov
d1086008f6 vm/vmm: properly shutdown output reading goroutine
The goroutine sends on bootOutputStop to notify about its completion,
but the main goroutine is not receiving from the chan on success
and since the chan in unbuffered, the output reading goroutine
hangs on the send forever.
2018-09-20 14:53:56 +02:00
Dmitry Vyukov
3af0330c9e vm/vmm: make more robust after restarts
Instances from the previous run can still be running,
so always stop the previous instances before starting new ones.
2018-09-20 14:53:52 +02:00
Dmitry Vyukov
1c10e8337a vm/vmm: don't prefix vm name with syzkaller
I am getting:
failed to run vmctl -name syzkaller-ci-openbsd-main-test-0
vmctl: name too long

The name is auto-generated from parts which ensure that it is unique.
We can't easily name it shorter. So strip the syzkaller prefix,
which is not strictly necessary.
2018-09-20 14:53:48 +02:00
Dmitry Vyukov
845e8c5895 vm/vmm: remove cpu parameter, make template optional
CPU is not used. Remove it.
Template is not strictly necessary. Make it optional.
2018-09-20 14:53:44 +02:00
Dmitry Vyukov
a6a09fb2a0 vm/vmm: increase maximum number of VMs
8 is way too low. A modern beefy machine can host a hundred of VMs freely.
Make the limit consistent for all of qemu/kvm/gvisor/vmm and set it to 128.
2018-09-20 14:53:40 +02:00
Dmitry Vyukov
7819680a0b vm/vmm: enable network
Without -L local interface vio0 is not enabled
and we can't connect to the machine.

Update #712
2018-09-17 10:51:00 +02:00
Dmitry Vyukov
a54c2b7b92 syz-ci: de-hardcode list of VMs that support overcommit
We currently have this list in multiple places (somewhat diverged).
Specify this "overcommit" property in VM implementations.
In particular, we also want to allow overcommit for "vmm" type.

Update #712
2018-09-11 15:33:45 +02:00
Dmitry Vyukov
ec887defaf vm/gvisor: use new signal-based diagnose
Presumably "debug -stacks" sometimes fails to actually dump stacks (some runtime hangs?).
Use new mechanism that just sends a signal.
2018-08-29 18:32:26 -07:00
Anton Lindqvist
14b78b9701 vm/vmm: fix IP address detection
The IP address of a VM is calculated based on the formula 100.64.X.3 where X
being the ID of the VM, starting from 0. After starting 256 VMs 64 will flip
over to 65 and so on. A more robust solution to calculating the IP is to simply
read it from output during boot.

While here, stop using the VM ID as the identifier since the VM name also works.
2018-08-29 13:31:38 -07:00
Anton Lindqvist
de20bcbb68 vm/vmm: support for vmm found on OpenBSD (#678)
vm/vmm: add vmm implementation found on OpenBSD
2018-08-18 13:06:44 -07:00
Dmitry Vyukov
f557fcdfa6 vm/gvisor: fix current binary lookup
os.Args[0] can be just binary name which was looked up using $PATH.
In such case copy will fail because the path does not exist.
Lookup binary name using $PATH.
2018-08-03 21:08:11 +02:00
Dmitry Vyukov
28e60b2339 vm/gce: move console check into separate function
Update #538
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
fbedd425b5 pkg/mgrconfig: move from syz-manager/mgrconfig
mgrconfig was used only by syz-manager initially,
but now it's used by a dozen of packages and it's
weird to import from under a binary dir.
pkg/ is much more reasonable dir for a widely used
helper package.
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
2e17e2c0ad vm: refactor MonitorExecution
Too complex. Split into several functions.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
c67a9331a4 gometalinter: clean up some errcheck warnings
Check some errors where relevant.
Unfortunately enabling errcheck does not look feasible, too many warnings.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
0824d7a1bf vm/gce: fix build
fail
2018-07-29 10:16:20 +02:00
Dmitry Vyukov
419000cc0a vm: fix "kill fuzzer on first kernel bug"
The problem with that commit is that for GCE implementation
we immidiately kill console connection too when receive diagnose signal.
This leads to truncated output.
2018-07-29 10:07:30 +02:00
Zach Riggle
0889ba7a79 adb: Add console logic for ttyUSB.serial
By using UDEV rules, we can create device nodes which exist at

	/dev/ttyUSB.{android device serial}

Which makes it easier to determine which console belongs to a device.

While this is non-standard behavior, it's an inexpensive path check
and makes the lookup faster and deterministic.
2018-07-26 20:13:37 +02:00
Dmitry Vyukov
beb957b793 vm/qemu, vm/gce: kill fuzzer on first kernel bug
Some kernel bugs don't stop kernel.
For such bugs whiel vm.MonitorExecution waits for kernel output for 10 secs,
fuzzer continues running programs and produces tons of output
after the kernel bug message. Kill fuzzer once MonitorExecution
detects a kernel bug.
2018-07-24 13:44:48 +02:00
Dmitry Vyukov
a0512a53a3 vm/qemu: use e1000 instead of e1000e
e1000e fails on recent Debian distros with:
Initialization of device e1000e failed: failed to find romfile "efi-e1000e.rom
2018-07-23 20:28:18 +02:00
Dmitry Vyukov
e9da9436ad vm: fix "no output" detection
We obviously need ticker instead of timer in MonitorExecution.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
8c2335a205 vm/vmimpl: factor out common code for ssh args and waiting for ssh
Move common code from 4 vm implementations to vmimpl.
2018-07-06 14:02:06 +02:00
Dmitry Vyukov
d3b2a0e212 dashboard/config: tune kernel timeouts
See #516 for description of the problem.

The new scheme is:

1. RCU stalls the highest priority.
CONFIG_RCU_CPU_STALL_TIMEOUT=100
which results in stalls detected after 100-101 secs.

2. Then softlockup detector.
kernel.watchdog_thresh = 55 (sysctl)
which surprisingly detects stalls after 110-132 secs.

3. Then hung tasks and workqueue stalls.
Unfortunately we can't separate them because that would
require setting "no output" timeout to 10+ minutes.
workqueue.watchdog_thresh=140 (cmdline)
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=140
Both are detected after 140-280 secs.

4. Finally, "no output" crashes.
Detected by vm.MonitorExecution after 300 secs.

Fixes #516
2018-07-05 17:43:41 +02:00
Dmitry Vyukov
be77c6967a vm/gvisor: enable watchdog panic
We need it to crash to detect hangs.
2018-07-05 17:41:06 +02:00
Dmitry Vyukov
ea88000dd9 vm/qemu: add akaros support 2018-07-05 13:12:39 +02:00
Dmitry Vyukov
3e16f33c65 vm: suppress "no output" and "lost connection" reports 2018-06-30 14:51:07 +02:00
Dmitry Vyukov
e2f6c7543e vm: simplify MonitorExecution
Simplify "no output" detection logic.
Don't allocate byte slices on every iteration.
2018-06-30 14:47:20 +02:00
Dmitry Vyukov
89d2e60023 vm/gvisor: fix empty runsc_args 2018-06-22 20:50:19 +02:00
Dmitry Vyukov
bf0a1af0cb vm/gvisor: always give vm all caps
runsc can crash on nil deref without any caps.
So give all of them all the time.
2018-06-22 19:56:39 +02:00
Dmitry Vyukov
39a5713d72 vm/gvisor: allow specifying arbitrary runsc flags 2018-06-22 19:00:12 +02:00
Dmitry Vyukov
412bfd3c58 vm/gvisor: use timeout for all runsc invocations
runsc likes to hang dead. Add timeouts to all invocations.
2018-06-22 18:37:02 +02:00
Dmitry Vyukov
2a075d57ab pkg/report: allow to specify suppressions per OS
Currently all (linux-specific) suppressions are hardcoded in mgrconfig.
This is very wrong. Move them to pkg/report and allow to specify per OS.
Add gvisor-specific suppressions.
This required a bit of refactoring. Introduce mgrconfig.KernelObj finally.
Make report.NewReporter and vm.Create accept mgrconfig directly
instead of passing it as multiple scattered args.
Remove tools/syz-parse and it always did the same as tools/syz-symbolize.
Simplify global vars in syz-manager/cover.go.
Create reporter eagerly in manager. Use sort.Slice more.
Overall -90 lines removed.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
c31f96a8c6 executor: rework fallback coverage
We have fallback coverage implmentation for freebsd.
1. It's broken after some recent changes.
2. We need it for fuchsia, windows, akaros, linux too.
3. It's painful to work with C code.

Move fallback coverage to ipc package,
fix it and provide for all OSes.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
14e6c472f5 vm/gvisor: add package
gvisor package provides support for gVisor, user-space kernel, testing.
See https://github.com/google/gvisor
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
d3bbcc35ee vm/vmimpl: add vm.Diagnose method
Diagnose is called on machine hang to try to get
some additional diagnostic information from it.
For now it's all stubs.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
87bfb99cfe vm: pass instance to MonitorExecution
It may need it later to try to obtain additional
diagnostic from hanged instances.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
0f0e5db62d vm/adb: don't fail if port 35099 is busy 2018-06-11 16:47:12 +02:00
Dmitry Vyukov
ee885b87a4 vm/qemu: fix 9p for latest distros
9p stopped working on Debian rolling.
Update the init script.
2018-06-11 11:20:55 +02:00
Dmitry Vyukov
0ac1284d5f vm/qemu: fuchsia support
Move most of linux-isms to os/arch configs.
Add proper configs for fuchsia.
2018-06-06 20:45:09 +02:00
Billy Lau
75b2448a26 vm/adb: disable kptr_restrict for Android
echo 0 to kptr_restrict in /proc/sys/kernel to unhide
kernel pointers when fuzzing for more reliable crash
dedup and easier debugging when analyzing crash.
2018-05-16 10:33:18 +02:00
Dmitry Vyukov
9e0846e8a4 all: get rid of underscores in identifiers
Underscores are against Go coding style.

Update #538
2018-05-07 17:59:06 +02:00
Dmitry Vyukov
037b77dc65 vm/{adb,isolated}: dudup common code
Found with gometalinter/dupl.

Update #538
2018-05-06 14:24:42 +02:00
Dmitry Vyukov
78b251cbd7 all: fix too long lines
Not sure why I have not seen warnings about
these lines on another machine...
2018-05-05 16:00:01 +02:00
Dmitry Vyukov
a630fd8b41 gometalinter: some fixes for unparam
But we still can't enable it as there are more [uninteresting] warnings.

Update #538
2018-05-03 15:48:26 +02:00
Dmitry Vyukov
9fe5658a1b gometalinter: check dot imports
Update #538
2018-05-03 14:41:34 +02:00
Dmitry Vyukov
39302300d9 gometalinter: check unkeyed composite literals
Update #538
2018-05-03 14:01:48 +02:00
Dmitry Vyukov
ca03d6881a vm/qemu: don't be too clever with cpu configuration
Some machine configurations have strict limits on number of CPUs
and don't support NUMA (e.g. arm vexpress-a15).
maxcpu and numa options make qemu fail.
Don't be too clever. If necessary maxcpu and numa options
can be added in qemu_args.
2018-04-20 20:14:10 +02:00
Jean-Baptiste Théou
52643b4414 adb: add debug level to ALERT for UART detector
The UART output may filter lower level messages.
This ensure proper detection of the unique ID

Signed-off-by: Jean-Baptiste Théou <jb@essential.com>
2018-04-18 09:26:01 +02:00
Dmitry Vyukov
5e6a2eea61 vm/qemu: add image_device config parameter
For some configurations device is "sd" instead of "hda".
2018-04-16 21:44:30 +02:00
Dmitry Vyukov
1bf59f0525 vm: make sshkey argument optional
An image can well be setup without a key.
Just password-less root login.
2018-04-16 21:33:13 +02:00
Dmitry Vyukov
f032e929b9 vm/qemu: don't enable usb/sound by default
Such options can be enabled in qemu_args if necessary.
2018-04-16 21:25:38 +02:00
Dmitry Vyukov
36d1c4540a all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
2018-03-08 18:48:26 +01:00
Dmitry Vyukov
64482eb948 pkg/gce: use current instance network
The current instance is not necessary in the default network.
2018-02-27 11:58:41 +01:00
Dmitry Vyukov
fc3afc7164 vm: keep more context before new output
In pkg/report we add up to 5 lines of kernel output before the report.
However, MonitorExecution leaves only up to 128 bytes of preceeding output,
so frequently preceeding lines are not included in the report.
Increase the context to 512 bytes.
2018-02-19 21:48:20 +01:00
Dmitry Vyukov
4198e58824 vm/vmimpl: unbreak freebsd build
Also add freebsd/netbsd host build to presubmit.
2018-01-16 06:41:23 +01:00
Dmitry Vyukov
376f424e08 vm/gce: connect to instances by ip
Don't connect by hostname, this seems to be broken on GCE.
Episodically connecting by hostname gives:

Could not resolve hostname: Name or service not known
2017-12-27 09:18:26 +01:00
Dmitry Vyukov
1db7a350a9 vm/qemu: respect cpu config parameter
Fixes #42
2017-12-17 11:39:14 +01:00
Dmitry Vyukov
f2d5384a68 vm/isolated: allow to specify ssh port for target machines 2017-12-17 11:39:14 +01:00
Andrey Konovalov
38a2a3f586 pkg/report: fix report extraction
Try extracting report from console output only first. If that doesn't work,
try extracting it from the whole log.

Add regexp for executor printed BUGs.

Optimize regexps for rcu detected stalls.

Update rep.StartPos and rep.EndPos in vm/vm.go as well as rep.Output.
2017-12-08 15:08:13 +01:00
Dmitry Vyukov
d9c79f8842 vm/gce: always ignore serial relay errors
GCE serial reply seems to be buggy, we see lots of "serialport: VM disconnected"
and "packet_write_wait: Connection to 1.2.3.4 port 9600: Broken pipe"
errors, which do not have any explanation.
Ignore all serial relay errors.
2017-12-05 20:08:06 +01:00
Dmitry Vyukov
2fa91450df dashboard/app: add manager monitoring
Make it possible to monitor health and operation
of all managers from dashboard.
1. Notify dashboard about internal syz-ci errors
   (currently we don't know when/if they happen).
2. Send statistics from managers to dashboard.
2017-12-01 13:58:11 +01:00
Dmitry Vyukov
5153aeaffd syz-ci: test images before using them
Boot and minimally test images before declaring them as good
and switching to using them.

If image build/boot/test fails, upload report about this to dashboard.
2017-11-30 14:50:50 +01:00
Dmitry Vyukov
29b0fd90e6 pkg/report: include Maintainers into report
Currently getting a complete report requires a complex,
multi-step dance (including getting information that
external users are not interested in -- guilty file).

Simplify interface down to 2 functions: Parse and Symbolize.
Parse does what it did before, Symbolize symbolizes report
and fills in maintainers. This simplifies both implementations
of Reporter interface and all users of the interface.

Potentially we could get this down to 1 function Parse
that does everything. However, (1) Symbolize can fail,
while Parse cannot, (2) usually we want to ignore (log)
Symbolize errors, but otherwise proceed with the report,
(3) repro does not need symbolization for all but the
last report.
2017-11-29 18:24:30 +01:00
Dmitry Vyukov
34f2c2332b pkg/report: add Output to Report
Whole raw output is indivisble part of Report,
currently we always pass Output separately along with Report.
Make Output a Report field.

Then, put whole Report into manager Crash and repro context and Result.
There is little point in passing Report as aa bunch of separate fields.
2017-11-29 14:36:51 +01:00
Dmitry Vyukov
eea051f798 vm/qemu: fix up osutil.RunCmd call 2017-11-24 13:41:08 +01:00
Dmitry Vyukov
31af2ce022 vm/gce: fix boot output capture
Turns out GetSerialPortOutput API does not work if instance has
serial port connections enabled (which we always have).
Get output from serial port relay service instead.
2017-11-22 17:56:48 +01:00
Dmitry Vyukov
ad0af9fff5 vm: return Report from MonitorExecution
This allows callers to get access to Report.Corrupted.
Better than adding 6-th return value and will allow
to pipe other report properties if necessary.
2017-11-21 19:02:35 +01:00
Dmitry Vyukov
2d24bbb225 vm/gce: fix nil deref
New console output code crashes with nil deref,
because we shadow outer err variable and then
dereference nil err.

Also express ssh connect timeout in real time.
Currently the timeout is on par of ~25 mins
(5s sleep + 10s connect timeout) * 100.
Reduce timeout to 5m of real time.
2017-11-20 11:57:42 +01:00
Dmitry Vyukov
9badd05327 vm/gce: provide VM console output on boot failures
"can't ssh into the instance" is not a very useful error.
2017-11-19 12:29:00 +01:00
Dmitry Vyukov
c4d43f4773 pkg/osutil: don't leace runaway processes
When manager is stopped there are sometimes runaway qemu
processes still running. Set PDEATHSIG for all subprocesses.
We never need child processes outliving parents.
2017-11-16 12:48:02 +01:00
Dmitry Vyukov
4bd78cef05 pkg/report, pkg/repro, syz-manager: name crash attributes consistently
We currently have several names for crash attributes, which is disturbing.
E.g. crash title is called "Title" or "Desc". Name them consistently.

Title - single line bug identity.
Report - whole crash text.
Log - whole fuzzer/kernel output.
2017-11-14 10:04:22 +01:00
Dmitry Vyukov
10112655d7 vm: remove needOutput arg for MonitorExecution
Always wait 10 secs for output.
If anything this can only lead to missed crashes during repro.
Let's unify manager and repro behavior.
2017-11-14 09:45:34 +01:00
Dmitry Vyukov
7a53e7e35d pkg/report: combine report data into a struct
Parse returns 5 variables now. Later we may want to add crash "priority".
Introduce Report struct that holds all report data.
2017-11-14 09:41:55 +01:00
Andrey Konovalov
f9a8d567eb pkg/report: add corrupted report detection
This change makes pkg/report try to detect corrupted reports by
using some heuristics.
2017-11-13 17:18:16 +03:00