Dmitry Vyukov
50c3709eb0
.gometalinter: reduce dupl threshold
...
Reduce dupl threshold from 63 to 60 and fix violations.
Update #538
2018-07-31 12:42:52 +02:00
Dmitry Vyukov
f5d67fbd9c
.gometalinter.json: enable gofmt
...
The part that we want from gofmt is simplify (-s).
Fix all code that needs fixing.
Update #538
2018-07-31 12:16:54 +02:00
Dmitry Vyukov
b8bd991ee2
executor: make current_time_ms/sleep_ms
...
Fix conditions for when current_time_ms/sleep_ms are used
and make them static.
2018-07-30 11:17:44 +02:00
Dmitry Vyukov
1a381291a3
executor: collect coverage from unfinished syscalls
...
Write coverage from unfinished syscalls.
Also detect when a syscall was blocked during execution,
even if it finished. Helpful for fallback coverage.
Fixes #580
2018-07-29 19:46:05 +02:00
Dmitry Vyukov
a43c5ed638
pkg/csource: turn off 32-bit tests
...
Test OS fails the same was as linux on travis.
2018-07-27 13:48:44 +02:00
Dmitry Vyukov
9faf980ad5
executor: disable clang-format for some parts
...
clang-format badly mishandles this part,
moreover different versions mishandle it differently.
2018-07-27 13:48:44 +02:00
Dmitry Vyukov
788351b1b0
pkg/csource: rewrite gen.sh in Go
...
Shell files cause portability problems.
On Linux it's hard to install /bin/sh,
/bin/bash is not present on *BSD.
Any solution is hard to test on Darwin.
Don't even want to mention Windows.
Just do it in Go.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
b25fc7b831
pkg/csource: add option to trace syscall results
...
This will be needed for testing of generated programs.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
9d92841b4e
pkg/csource: tidy generated code
...
1. Remove unnecessary includes.
2. Remove thunk function in threaded mode.
3. Inline syscalls into main for the simplest case.
4. Define main in common.h rather than form with printfs.
5. Fix generation for repeat mode
(we had 2 infinite loops: in main and in loop).
6. Remove unused functions (setup/reset_loop, setup/reset_test,
sandbox_namespace, etc).
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
c3da5dc5e0
executor: simplify event_timedwait
...
We always have current_time_ms in event_timedwait
so use it instead of manual clock_gettime calls
which tend to be bulkier.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
4dcfea28eb
pkg/host: support test OS
...
test OS parasitizeson other OSes just as akaros,
and there is nothing to detect as well.
So use the same stub for test as for akaros.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
22105302cc
executor: ignore unshare errors in setuid sandbox
...
We already do this in sandbox=none, but forgot about setuid.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
ad155aa428
pkg/csource: say what compiler is missing
2018-07-25 10:44:45 +02:00
Dmitry Vyukov
e0c1bcbabc
prog: move MaxPids const to prog
...
The const may be needed by other packages.
E.g. when checking manager config.
2018-07-25 10:39:29 +02:00
Dmitry Vyukov
3cbc0ac516
pkg/csource: tun/cgroups are linux-specific
2018-07-25 10:39:29 +02:00
Anton Lindqvist
9182049979
pkg/csource: remove /bin/bash assumption
...
OpenBSD and probably other BSDs does not ship with /bin/bash. This particular
script runs fine with regular /bin/sh.
2018-07-25 08:30:07 +02:00
Dmitry Vyukov
375a3e31e1
pkg/build: save kernel config early
...
Currently we don't capture kernel config for broken builds
because the config is saved as the last step.
Save it as early as possible.
2018-07-24 14:30:05 +02:00
Dmitry Vyukov
9fe4bdc5f1
executor: overhaul
...
Make as much code as possible shared between all OSes.
In particular main is now common across all OSes.
Make more code shared between executor and csource
(in particular, loop function and threaded execution logic).
Also make loop and threaded logic shared across all OSes.
Make more posix/unix code shared across OSes
(e.g. signal handling, pthread creation, etc).
Plus other changes along similar lines.
Also support test OS in executor (based on portable posix)
and add 4 arches that cover all execution modes
(fork server/no fork server, shmem/no shmem).
This change paves way for testing of executor code
and allows to preserve consistency across OSes and executor/csource.
2018-07-24 12:04:27 +02:00
Dmitry Vyukov
db7957bc09
pkg/report: add format for akaros warnings
2018-07-24 10:10:45 +02:00
Dmitry Vyukov
af255b09a7
pkg/vcs: poll fixing commits on akaros and fuchsia
2018-07-20 20:26:59 +02:00
Dmitry Vyukov
49f3583951
pkg/report: add another akaros backtrace message
2018-07-18 17:34:19 +02:00
Dmitry Vyukov
6d5bd5b5eb
syz-ci: fix arch passed to build.Clean
2018-07-17 17:55:52 +02:00
Dmitry Vyukov
bad4246bf2
pkg/report: improve akaros reporter and implement symbolization
2018-07-16 17:03:14 +02:00
Dmitry Vyukov
58293c9eb3
pkg/report: fix kmalloc bug in krealloc
2018-07-16 10:16:21 +02:00
Dmitry Vyukov
92a4950507
pkg/host: add "network devices" feature
...
Linux executor sets up some network devices for testing,
detect when that's supported on the machine and don't
do it if it's not supported.
2018-07-13 12:46:32 +02:00
Dmitry Vyukov
d1dc5f516d
pkg/compiler: fix error format string
2018-07-13 12:35:16 +02:00
Dmitry Vyukov
3d741171f2
pkg/report: add "lock held when returning to user space" format for older kernels
2018-07-13 10:31:26 +02:00
Dmitry Vyukov
3986ce95fd
pkg/report: add report format for "lock held when returning to user space"
...
This report does not have stack trace, so we always detected it as corrupted.
2018-07-12 12:38:52 +02:00
Dmitry Vyukov
95e7a88b97
sys/linux: implement fuse as normal syscalls
...
Remove syz_fuse* and implement them as normal syscalls.
We not have enough expressive power to form mount options.
2018-07-10 16:18:45 +02:00
Dmitry Vyukov
01e3571841
pkg/host: check that we can open files rather than that they exist
...
See issue #640 where /dev/net/tun is present, but open fails with ENODEV.
Check that we can actually open all these files.
Fixes #640
2018-07-10 13:44:59 +02:00
Dmitry Vyukov
2e0e3130f9
pkg/build: update initrd name
...
Seems to have been renamed.
2018-07-10 11:14:36 +02:00
Dmitry Vyukov
7c31f7a78d
pkg/build: always do clean build for fuchsia
...
We frequently see boot errors like:
[00010.201] 02991.03067> pkgsvr: 2018/06/30 23:39:41 system: failed to set system root from blob "ccbadb3901372b1e0fc5275f627f708bf3e5f3acfb0d4268638db0ff75fc7fd4": file does not exist
or:
[00003.691] 01126.01153> devmgr: launchpad /fs/blob/e66739acdd3d8efa3b7c9021e2107cf8431765c0b8eb0a1ec7f7dc7fd305f2f7 (pkgfs) failed: launchpad_vmo_from_file failure: -40
Presumably clean build may help.
2018-07-10 11:05:04 +02:00
Dmitry Vyukov
710eefe85a
pkg/compiler: support negative integers
...
Currently we have to use 0xffffffffffffffff to represent -1,
and we can't express e.g. -20:20 int range.
Support negative consts to fix both problems.
2018-07-09 20:47:07 +02:00
Dmitry Vyukov
7004c9c8a8
executor: tweaks for better 9p testing
...
See the added comments.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
306ca0571c
prog, pkg/compiler: support fmt type
...
fmt type allows to convert intergers and resources
to string representation.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
c9a7a4dccd
executor: executor fix fuchsia build
2018-07-07 19:08:38 +02:00
Dmitry Vyukov
3abb98207d
pkg/report: detect partial result errors
2018-07-06 20:25:02 +02:00
Dmitry Vyukov
0b95b8ec49
pkg/host: disable for akaros
...
akaros can't have own host version
because fuzzer does not run on akaros,
so just disable it all.
2018-07-06 20:18:05 +02:00
Dmitry Vyukov
0fb38ef496
pkg/report: detect fuchsia double faults
2018-07-06 16:35:21 +02:00
Dmitry Vyukov
04bd6c3d9e
pkg/instance: pass -os to execprog/fuzzer only for akaros
...
Only akaros needs OS, because the rest assume host OS.
But speciying OS for all OSes breaks patch testing on syzbot
because old execprog does not have os flag.
2018-07-06 14:43: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
d02d039529
pkg/report: fix lambda demangling
...
demangle package does not minimize lambda symbols properly
(does not strip parameters and template paratemeter).
Do it manually.
See: https://github.com/ianlancetaylor/demangle/issues/5
2018-07-05 13:21:01 +02:00
Dmitry Vyukov
538df42ec7
pkg/repro: provide stats even for failed repro
...
Provide stats and logs for failed repro and save it in manager.
In particular log is useful for failed repros,
currently there is no visibility into why bugs
failed to reproduce.
2018-07-05 13:14:00 +02:00
Dmitry Vyukov
7e2e7aa3e4
pkg/instance: pass os flag to execprog/fuzzer
2018-07-05 13:09:40 +02:00
Dmitry Vyukov
63226a5844
pkg/ipc: add rate limiting for akaros
2018-07-05 13:03:38 +02:00
Dmitry Vyukov
1c9d305894
pkg/build: add akaros support
2018-07-05 13:03:10 +02:00
Dmitry Vyukov
8ebdf5923d
pkg/vcs: add akaros support
2018-07-05 13:02:56 +02:00
Dmitry Vyukov
bc1210b614
pkg/ipc: create default config based on target
...
Pass actual target to DefaultConfig, that's what we really want,
not the stray ipc flag.
2018-07-05 10:44:34 +02:00
Dmitry Vyukov
2290cea0a3
pkg/repro: pass target OS to execprog
...
Pass target OS to execprog and pass executor the same way
manager passes it to fuzzer.
2018-07-05 10:44:34 +02:00
Dmitry Vyukov
3e6e034413
executor: repair akaros support
2018-07-05 10:44:34 +02:00