aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gce
Commit message (Collapse)AuthorAgeFilesLines
* vm/gce: connect to instances by ipDmitry Vyukov2017-12-271-2/+2
| | | | | | | 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
* vm/gce: always ignore serial relay errorsDmitry Vyukov2017-12-051-0/+5
| | | | | | | 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.
* syz-ci: test images before using themDmitry Vyukov2017-11-301-1/+1
| | | | | | | 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.
* vm/gce: fix boot output captureDmitry Vyukov2017-11-221-7/+52
| | | | | | 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.
* vm/gce: fix nil derefDmitry Vyukov2017-11-201-2/+2
| | | | | | | | | | | 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.
* vm/gce: provide VM console output on boot failuresDmitry Vyukov2017-11-191-0/+4
| | | | "can't ssh into the instance" is not a very useful error.
* pkg/osutil: don't leace runaway processesDmitry Vyukov2017-11-161-4/+3
| | | | | | When manager is stopped there are sometimes runaway qemu processes still running. Set PDEATHSIG for all subprocesses. We never need child processes outliving parents.
* vm/gce: fix error formattingDmitry Vyukov2017-11-071-2/+2
| | | | | | | This is detected with newer Go toolchain: vm/gce/gce.go:376: Errorf format %v reads arg #1, but call has only 0 args vm/gce/gce.go:381: Errorf format %v reads arg #1, but call has only 0 args
* pkg/kd: add KD protocol decoderDmitry Vyukov2017-09-281-1/+6
| | | | | | | | | | | | | | | | | | Very primitive decoder that only decodes amd64 exceptions. Use it in vm/gce. Now crashes contain something more or less reasonable which is caught by manager as crash: BUG: first chance exception 0x80000003 &kd.stateChange64{state:0x3030, processorLevel:0x6, processor:0x0, numProcessors:0x2, thread:0xffff9c0bd015e080, pc:0xfffff8017615c380, exception:kd.exception64{code:0x80000003, flags:0x0, record:0x0, address:0xfffff8017615c380, numParams:0x1, unused:0x0, params:[15]uint64{ 0x0, 0x40, 0xfffff801768699e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, firstChance:0x1}, report:kd.controlReport{ dr6:0xffff0ff0, dr7:0x400, eflags:0x86, numInstr:0x10, reportFlags:0x3, instr:[16]uint8{0xcc, 0xc3, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0}, cs:0x10, ds:0x2b, es:0x2b, fs:0x53}}
* vm/gce: fix GCE image checkDmitry Vyukov2017-09-281-3/+3
|
* vm/gce: windows supportDmitry Vyukov2017-09-271-31/+43
| | | | | | | Support custom pre-created images. Support non-root user. Use dir instead of pwd on windows. Don't use sudo on windows.
* vm/gce: work around GCE console bugDmitry Vyukov2017-08-081-3/+9
| | | | | Sometimes connects to serial console spuriously fail with: Permission denied (publickey)
* vm/gce: another attempt to fix trimmed console outputDmitry Vyukov2017-08-011-0/+2
| | | | | We still see trimmed reports even with the "serialport" grep. Add a 5 second sleep in an attempt to fix it.
* vm/gce: fix truncated console outputDmitry Vyukov2017-07-251-8/+40
| | | | | | | | Sometimes we get truncated console output during repro. The problem is that we start the console reading ssh command, but do not wait for it to actually connect and start piping console. Wait while the command actually starts piping console before starting the target command.
* vm/gce: support debug modeDmitry Vyukov2017-06-301-25/+32
| | | | Print ssh/console output to stdout in debug mode.
* vm/gce: fix image archive creationDmitry Vyukov2017-06-171-4/+8
| | | | See the added comment.
* vm/gce: accept un-tar-ed imageDmitry Vyukov2017-06-171-9/+63
| | | | | | | | | | vm/gce differs from other VM types in that it accepts image in a weird, GCE-specific format (namely, image named disk.raw is put into .tar.gz file). This makes it impossible to write generic code that creates images for any VM types. Make vm/gce accept just image like e.g. vm/qemu and handle own specifics internally.
* syz-manager/mgrconfig: move sshkey from vm config to manager configDmitry Vyukov2017-06-171-4/+2
| | | | | | | | | | | | | | Sshkey is a property of image, which is in manager config. Move sshkey to the same location as image. The motivation for the move is as follows. Continuous build produces an image and the key, both need to be passed manager instance. Continuous build system should not distinguish different VM types and mess with their configs. NOTE FOR USERS: this breaks manager configs again. Hopefully the last time for now. Docs are updated.
* vm/gce: accept local imageDmitry Vyukov2017-06-031-8/+36
| | | | | | | | | | Currently gce accepts precreated GCE image name as image config param, while all other VM types accept local file path as image. This makes it impossible to write generic code that works with all VM types, i.e. after building a new image it's unclear if it needs to be uploaded to GCE or not, and what needs to be passed as image in config. Eliminate this difference by making gce accept local image file as well.
* vm: overhaulDmitry Vyukov2017-06-031-44/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VM infrastructure currently has several problems: - Config struct is complete mess with a superset of params for all VM types - verification of Config is mess spread across several places - there is no place where VM code could do global initialization like creating GCE connection, uploading GCE image to GCS, matching adb devices with consoles, etc - it hard to add private VM implementations such impl would need to add code to config package which would lead to constant merge conflicts - interface for VM implementation is mixed with interface for VM users this does not allow to provide best interface for both of them - there is no way to add common code for all VM implementations This change solves these problems by: - splitting VM interface for users (vm package) and VM interface for VM implementations (vmimpl pacakge), this in turn allows to add common code - adding Pool concept that allows to do global initialization and config checking at the right time - decoupling manager config from VM-specific config each VM type now defines own config Note: manager configs need to be changed after this change: VM-specific parts are moved to own "vm" subobject. Note: this change also drops "local" VM type. Its story was long unclear and there is now syz-stress which solves the same problem.
* pkg/gce: move from gceDmitry Vyukov2017-06-031-1/+1
|
* pkg/log: move from logDmitry Vyukov2017-06-031-1/+1
|
* vm: properly detect when a program exitsDmitry Vyukov2017-02-021-5/+16
| | | | | | | | syz-fuzzer never exits (normally) so this does not affect syz-manager. But during reproduction we can run a short running program (no repeat mode) and currently VMs treat premature exit as an error. Properly detect when a program exits and let callers decide what to do with it.
* vm/adb: support BeagleBone consoleDmitry Vyukov2016-12-191-23/+7
| | | | | BeagleBone console requires some special tty-ism to work. Fortunately, this code also works with Suzy-Q.
* vm/gce: handle graceful preemptionDmitry Vyukov2016-12-161-1/+1
| | | | | In case of graceful preemption fuzzer should be terminated by SIGTERM. Catch it and propagate to manager.
* vm/gce: use preemptible instancesDmitry Vyukov2016-12-021-0/+6
| | | | | Preemptible instances are cheaper, try to use them. Also try to enable vmx support.
* vm: add ability to interrupt commandsDmitry Vyukov2016-11-191-1/+5
| | | | This is required for crash reproduction in manager.
* vm/gce: don't require ssh key for GCE-compatible imagesDmitry Vyukov2016-11-171-18/+32
| | | | | If an image supports all GCE fanciness, we don't need a separate ssh key for it. It should accept the instance private key that we specify during VM creation.
* vm/gce: actually append name to instance namesDmitry Vyukov2016-11-161-8/+7
|
* syz-gce,syz-manager: add name config parameterDmitry Vyukov2016-11-161-1/+1
| | | | | | Name is used for identification on web ui and included in gce instance names (so that several managers can coexist in a single project).
* vm/gce: don't wait for instance deletion on exitDmitry Vyukov2016-10-101-3/+3
| | | | | | | VM.Close is called when syz-manager terminates on SIGINT. Waiting for instance deletion in this case is unnecessary, creation of a new instance will handle deleting instance. So exit faster.
* log: add packageDmitry Vyukov2016-10-091-6/+6
| | | | | | | | | | | Log is a simple wrapper around std log package. It is meant to solve 2 main problems: 1. Logging from non-main packages (mainly, vm/* packages). Currently they can either always log or not log at all. But they can't respect program verbosity setting. Log package allows all packages to use the same verbosity setting. 2. Exposing recent logs in html UI. Namely we want to tee logs to console and html UI.
* vm/gce: fix bug introduced during refactoringDmitry Vyukov2016-10-071-1/+2
|
* syz-gce: add autonomous GCE runnerDmitry Vyukov2016-10-071-204/+13
| | | | | | It is meant to download new kernel images from GCS, update and rebuild syzkaller and restart syz-manager. Work in progress...
* vm/gce: add support GCE VMsDmitry Vyukov2016-10-061-0/+441