aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource_test.go
Commit message (Collapse)AuthorAgeFilesLines
...
* all: fix warnings pointed to by golangci-lintDmitry Vyukov2019-03-281-1/+1
| | | | Update #977
* executor: prevent non-null expected warningsDmitry Vyukov2019-03-211-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The added test triggers warnings like these: <stdin>: In function ‘syz_mount_image.constprop’: <stdin>:298:3: error: argument 1 null where non-null expected [-Werror=nonnull] In file included from <stdin>:26:0: /usr/include/x86_64-linux-gnu/sys/stat.h:320:12: note: in a call to function ‘mkdir’ declared here extern int mkdir (const char *__path, __mode_t __mode) ^~~~~ cc1: all warnings being treated as errors <stdin>: In function ‘syz_open_procfs.constprop’: <stdin>:530:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=] <stdin>:85:110: note: in definition of macro ‘NONFAILING’ <stdin>:532:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=] <stdin>:85:110: note: in definition of macro ‘NONFAILING’ <stdin>:534:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=] <stdin>:85:110: note: in definition of macro ‘NONFAILING’ Use volatile for all arguments of syz_ functions to prevent compiler from treating the arguments as constants in reproducers. Popped up during bisection that used a repro that previously worked. Update #501
* prog, pkg/{csource,ifuzz,ipc,repro}: make tests deterministic on travisDmitry Vyukov2019-01-021-0/+3
| | | | | Don't use random seed on travis as it produces flaky coverage reports, and probably generally better for CI setting.
* pkg/csource: exclude linux/arm64 testsDmitry Vyukov2018-12-051-7/+5
| | | | | | | | | | | | | | | I think I misinterpreted the error that episodically happens on ci: collect2: error: ld terminated with signal 11 [Segmentation fault], core dumped compiler invocation: aarch64-linux-gnu-gcc [-Wall -Werror -O1 -g -o /tmp/syz-executor570589071 -pthread -DGOOS_linux=1 -DGOARCH_arm64=1 -x c - -static] as OOM, but they all involve aarch64-linux-gnu-gcc: https://travis-ci.org/google/syzkaller/jobs/461827347 https://travis-ci.org/google/syzkaller/jobs/460226110 https://travis-ci.org/google/syzkaller/jobs/463564291 So I guess the problem can be with the arm64 toolchain that just crashes randomly.
* pkg/csource: reduce short testsDmitry Vyukov2018-12-031-39/+42
| | | | | | | | | | | | pkg/csource test gets OOM-killed on travis: https://travis-ci.org/google/syzkaller/jobs/461827347 https://travis-ci.org/google/syzkaller/jobs/460226110 Add several measures: - set GOMAXPROCS=1 to restrict parallel processes - remove -g from compiler invocation - reduce set of tests run in short mode to compensate for GOMAXPROCS=1 - also reduce set of tests in full mode as they timeout now
* openbsd: repair pkg/csource_testGreg Steuck2018-11-301-4/+0
|
* sys/targest: introduce target.BuildOSDmitry Vyukov2018-11-171-3/+3
| | | | | | | | We can't cross-compile native binaries from just any OS to any other. For most OSes we can do only native compilation. Some can only be compiled from linux. To date we avoided this problem completely (mostly assumed linux build OS). Make this notion of what can build what explicit.
* pkg/runtest, pkg/csource: don't run tests on openbsdDmitry Vyukov2018-09-171-0/+5
| | | | The tests are currently broken on openbsd.
* pkg/csource: turn off 32-bit testsDmitry Vyukov2018-07-271-0/+4
| | | | Test OS fails the same was as linux on travis.
* pkg/csource: say what compiler is missingDmitry Vyukov2018-07-251-3/+4
|
* executor: overhaulDmitry Vyukov2018-07-241-64/+33
| | | | | | | | | | | | | | | | | 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.
* pkg/csource: support fuchsiaDmitry Vyukov2018-06-291-26/+35
| | | | Lots of assorted heavylifting to support csource on fuchsia.
* pkg/csource: allow to build source fom memoryDmitry Vyukov2018-06-061-8/+1
| | | | | | In most cases we have source in memory, so provide a function to build right from memory without creating temp files.
* pkg/csource: reduce test sizeDmitry Vyukov2018-05-071-4/+6
| | | | | | | The test times out on travis: https://travis-ci.org/google/syzkaller/jobs/375965899 https://travis-ci.org/google/syzkaller/jobs/375965900
* sys/linux: add cgroup descriptionsDmitry Vyukov2018-03-251-0/+1
|
* all: fix gometalinter warningsDmitry Vyukov2018-03-081-1/+1
| | | | Fix typos, non-canonical code, remove dead code, etc.
* sys: move test syscalls to a separate targetDmitry Vyukov2017-12-171-0/+3
| | | | | | We have them in linux solely for historical reasons. Fixes #462
* pkg/csource: add function to parse serialized optionsDmitry Vyukov2017-11-171-61/+2
| | | | | Also move options and options tests into a separate file, add serialization function.
* all: basic freebsd supportDmitry Vyukov2017-10-021-0/+3
| | | | For now we just make Go part build for freebsd.
* executor, sys/windows: initial windows supportDmitry Vyukov2017-09-251-2/+4
|
* pkg/csource: disable linux/386 testsDmitry Vyukov2017-09-221-0/+5
| | | | Another attempt to fix travis build.
* all: more assorted fuchsia supportDmitry Vyukov2017-09-221-0/+4
|
* pkg/csource: support archs other than x86_64Dmitry Vyukov2017-09-151-4/+20
|
* prog: remove default target and all global stateDmitry Vyukov2017-09-151-12/+12
| | | | | | Now each prog function accepts the desired target explicitly. No global, implicit state involved. This is much cleaner and allows cross-OS/arch testing, etc.
* syz-manager/mgrconfig: explicitly specify target in configDmitry Vyukov2017-09-151-0/+5
| | | | | Add target config parameter (e.g. linux/amd64) which controls target OS/arch. No more explicit assumptions about target.
* prog, sys: move types to progDmitry Vyukov2017-09-051-0/+1
| | | | | | | | | | | Large overhaul moves syscalls and arg types from sys to prog. Sys package now depends on prog and contains only generated descriptions of syscalls. Introduce prog.Target type that encapsulates all targer properties, like syscall list, ptr/page size, etc. Also moves OS-dependent pieces like mmap call generation from prog to sys. Update #191
* pkg/repro: fix invalid options minimizationDmitry Vyukov2017-08-091-6/+7
| | | | | | | | | | | Repro can generate Sandbox="namespace"/UseTmpDir=false. This combination is broken for two reasons: - on second and subsequent executions of the program, it fails to create syz-tmp dir - with Procs>1, it fails right away, because all procs try to create syz-tmp dir Don't generate such combination.
* pkg/csource, pkg/repro: filter out invalid options combinationsDmitry Vyukov2017-08-091-2/+8
| | | | | | | | | We currently have 2 invalid options combinations: - collide without threads - procs>1 without repeat They are invalid in the sense that result of csource.Write is the same for them. Filter out these combinations. This cuts csource testing time in half and reduces repro minimization time.
* all: use consistent file permissionsDmitry Vyukov2017-07-031-2/+2
| | | | | | | | | | | | | | | | Currently we have unix permissions for new files/dirs hardcoded throughout the code base. Some places use 0644, some - 0640, some - 0600 and a variety of other constants. Introduce osutil.MkdirAll/WriteFile that use the default permissions and use them throughout the code base. This makes permissions consistent and also allows to easily change the permissions later if we change our minds. Also merge pkg/fileutil into pkg/osutil as they become dependent on each other. The line between them was poorly defined anyway as both operate on files.
* pkg/csource: move from csourceDmitry Vyukov2017-06-171-0/+138