aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encoding.go
Commit message (Collapse)AuthorAgeFilesLines
* prog: validate deserialized programsDmitry Vyukov2017-01-241-2/+7
| | | | | | | The optimization change removed validation too aggressively. We do need program validation during deserialization, because we can get bad programs from corpus or hub. Restore program validation after deserialization.
* prog: add FieldName to TypeAndrey Konovalov2017-01-231-2/+2
| | | | | FieldName() is the name of the struct field or union option with this type. TypeName() is now always the name of the type.
* all: spot optimizationsDmitry Vyukov2017-01-201-5/+3
| | | | | | | | | | | | | A bunch of spot optmizations after cpu/memory profiling: 1. Optimize hot-path coverage comparison in fuzzer. 2. Don't allocate and copy serialized program, serialize directly into shmem. 3. Reduce allocations during parsing of output shmem (encoding/binary sucks). 4. Don't allocate and copy coverage arrays, refer directly to the shmem region (we are not going to mutate them). 5. Don't validate programs outside of tests, validation allocates tons of memory. 6. Replace the choose primitive with simpler switches. Choose allocates fullload of memory (for int, func, and everything the func refers). 7. Other minor optimizations.
* prog: generate larger arraysDmitry Vyukov2017-01-201-1/+1
| | | | | | | | | Currently we generate arrays of size [0,5] with equal probability. Generate [0,10] with bias towards smaller arrays. But 0 has the lowest probability. I've benchmark a slightly different change with max array size of 20, results are somewhat inconclusive: it was better than baseline almost all way, but baseline suddenly caught up at the end. It also considerably reduced executions per second (by ~20%). So increasing array size to 10 should be a win...
* prog: increase line length limit when deserializing programsDmitry Vyukov2017-01-091-1/+7
| | | | | | | | bufio.Scanner has a default limit of 4K per line, if a program contains longer line, it fails. Extend the limit to 64K. Also check scanning errors. Turns out even scanning of bytes.Buffer can fail due to the line limit.
* syz-hub: add programDmitry Vyukov2016-11-171-0/+33
| | | | syz-hub is used to exchange programs between syz-managers.
* prog: assign types to args during constructionDmitry Vyukov2016-11-111-15/+15
| | | | | | Eliminate assignTypeAndDir function and instead assign types to all args during construction. This will allow considerable simplifation of assignSizes.
* sys: always use pointers to typesDmitry Vyukov2016-11-111-4/+4
| | | | | | | | Currently we store most types by value in sys.Type. This is somewhat counter-intuitive for C++ programmers, because one can't easily update the type object. Store pointers to type objects for all types. It also makes it easier to update types, e.g. adding paddings.
* Refactor & improve len type handlingAndrey Konovalov2016-10-111-10/+25
|
* sys: support recursive structsDmitry Vyukov2016-09-051-3/+3
| | | | | | A struct can have a pointer to itself directly or indirectly. Currently it leads to inifinite recursion when generating descriptions. Fix this.
* sys: add union typeDmitry Vyukov2015-12-291-0/+26
|
* prog: don't serialize paddingsDmitry Vyukov2015-12-281-13/+77
| | | | | | Paddings in serialized programs are unnecessary and confusing. Instead restore them implicitly. Also use [,,,,] for arrays.
* sys: automatically add padding to structsDmitry Vyukov2015-12-171-1/+3
|
* prog: allow comments in programsDmitry Vyukov2015-11-201-1/+1
| | | | Useful for manual program minimization.
* initial commitDmitry Vyukov2015-10-121-0/+411