aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/testdata/errors2.txt
Commit message (Collapse)AuthorAgeFilesLines
* pkg/compiler: require stricter resource constructorsDmitry Vyukov2022-01-111-0/+8
| | | | | | | | | | | | | Don't consider syscalls that return resources in unions/arrays as constructors. Unions and arrays are problematic because we don't have directed generation in prog.randGen.createResource() and can fail to generate a syscall that returns a particular resource (generate a wrong union option that does not contain the necessary resource). This leads to the following panics: panic: failed to create a resource ifindex with ioctl$sock_SIOCGIFCONF Require each resource to have a constructor syscall that returns the resource outside of unions/arrays.
* pkg/compiler: fix error message spellingDmitry Vyukov2022-01-111-4/+4
| | | | Add missing space before brackets.
* pkg/compiler: prohibit use of len/flags/const/proc types in out fieldsDmitry Vyukov2022-01-111-1/+8
| | | | These types in explict out fields is either unnecessary details or bugs in descriptions.
* pkg/compiler: prohibit use of direction attribute on union fieldsDmitry Vyukov2022-01-111-8/+2
| | | | | | Direction attributes on unions work in a confusing way and don't do what users may think they do. Now we have out_overlay attribute for structs that allows to have overlapping input and output fields.
* pkg/compiler: add out_overlay field attributeDmitry Vyukov2022-01-111-0/+12
|
* pkg/compiler: check for flags with all equal valuesDmitry Vyukov2020-11-131-0/+6
| | | | | | There is no point in having flags when values are equal. This can only mean a typo or other bug. Check for such cases and fix 3 existing precedents.
* pkg, prog: add per-field direction attributeNecip Fazil Yildiran2020-08-131-5/+89
|
* pkg/compiler: check for unused resourcesDmitry Vyukov2020-08-041-1/+4
| | | | | | | | | | If a resource is never used as an input, it is not useful. It's effectively the same as using an integer. Detect such cases, they are quite confusing. Fix all existing errors in descriptions. This uncovered some interesting bugs as well, e.g. use of a completely unrelated fd subtype after copy-paste (while the resource that was supposed to be used there is completely unused).
* pkg/compiler: refactor attribute handlingDmitry Vyukov2020-04-191-0/+5
| | | | | | | | | | | | Introduce common infrastructure for describing and parsing attribute instead of custom per-attribute code scattered across several locations. Change align attribute syntax from the weird align_N to align[N]. This also allows to use literal constants as N. Introduce notion of builtin constants. Currently we have only PTR_SIZE, which is needed to replace align_ptr with align[PTR_SIZE].
* pkg/compiler: check that flags values fit into base typeDmitry Vyukov2020-03-171-0/+3
| | | | | | | | flags[foo, int8] foo = 0x12345678 is always an error, detect these cases. Found some bugs in mptcp, packet sockets, kvm.
* pkg/compiler: check that const values fit into base typeDmitry Vyukov2020-03-171-0/+4
| | | | | const[0x12345678, int8] is always an error, detect these cases. Found some bugs in mptcp, socket proto and fuchsia fidl descriptions.
* pkg/compiler: add tests for generation phaseDmitry Vyukov2020-03-171-0/+2
| | | | | | Add errors3.txt with tests for errors that are produced during generation phase. Refactor tests to reduce duplication. Tidy struct/union size errors: better locations and make testable.
* pkg/ast: introduce hex-encoded string literalsDmitry Vyukov2020-02-101-0/+1
| | | | | | | | | | | | | The stringnozescapes does not make sense with filename, also we may need similar escaping for string flags. Handle escaped strings on ast level instead. This avoids introducing new type and works seamleassly with flags. As alternative I've also tried using strconv.Quote/Unquote but it leads to ugly half-escaped strings: "\xb0\x80s\xe8\xd4N\x91\xe3ڒ,\"C\x82D\xbb\x88\\i\xe2i\xc8\xe9\xd85\xb1\x14):M\xdcn" Make hex-encoded strings a separate string format instead.
* pkg/compiler: check range is consistent with base typePaul Chaignon2019-10-251-0/+13
| | | | | | For any intN, values in the range [-MAX_INTN:MAX_INTN] are accepted. Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
* prog, pkg/compiler: alignment for integer rangesPaul Chaignon2019-10-251-0/+7
| | | | | | | | | Enables the syntax intN[start:end, alignment] for integer ranges. For instance, int32[0:10, 2] represents even 32-bit numbers between 0 and 10 included. With this change, two NEED tags in syscall descriptions can be addressed. Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
* pkg/compiler: add offsetof typeDmitry Vyukov2019-05-161-0/+2
| | | | | | Similar to C offsetof gives offset of a field from the beginning of the parent struct. We have several TODOs in descriptions asking for this.
* pkg/compiler: allow to refer to syscall arguments in len pathsDmitry Vyukov2019-05-141-0/+2
| | | | This allows to use len[syscall:arg] expressions.
* pkg/compiler: support complex len targetsDmitry Vyukov2019-05-141-3/+31
| | | | | | | | | | This change adds compiler support for complex path expressions in len targets. E.g. it allows to refer to a sibling field as len[parent_struct:field:another_field]. See the docs change for details. This is just a compiler change. The feature is not yet supported by the prog package.
* pkg/compiler: support negative integersDmitry Vyukov2018-07-091-0/+5
| | | | | | 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.
* pkg/compiler: check for unused declarationsDmitry Vyukov2018-06-301-0/+35
| | | | | Error on unused structs/unions/resources/flags. Finds tons of bugs.
* pkg/ast: support char constantsDmitry Vyukov2018-04-291-0/+1
| | | | | | | Frequently it's useful to do something like: int8['a':'z'] punctuation = ',', '-', ':'
* pkg/compiler: support size attribute for unionsDmitry Vyukov2018-03-051-0/+8
|
* pkg/compiler: add size attribute for structsDmitry Vyukov2018-03-051-0/+13
| | | | The size attribute allows to pad a struct up to the specified size.
* pkg/compiler: prohibit len of other union optionsDmitry Vyukov2018-02-231-0/+6
|
* pkg/compiler: allow len of var-len arraysDmitry Vyukov2018-02-171-2/+0
| | | | | All netfilter subsystems use this unfortunately, so demote this to a warning.
* pkg/compiler: support type templatesDmitry Vyukov2018-01-131-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Netlink descriptions contain tons of code duplication, and need much more for proper descriptions. Introduce type templates to simplify writing such descriptions and remove code duplication. Note: type templates are experimental, have poor error handling and are subject to change. Type templates can be declared as follows: ``` type buffer[DIR] ptr[DIR, array[int8]] type fileoff[BASE] BASE type nlattr[TYPE, PAYLOAD] { nla_len len[parent, int16] nla_type const[TYPE, int16] payload PAYLOAD } [align_4] ``` and later used as follows: ``` syscall(a buffer[in], b fileoff[int64], c ptr[in, nlattr[FOO, int32]]) ```
* pkg/compiler: add check that len does not refer to array with varlen elementsDmitry Vyukov2017-11-281-0/+2
| | | | | This [almost] always means a bug in descriptions. Fix all bugs identified by the check.
* pkg/compiler: don't genererate missing syscallsDmitry Vyukov2017-09-151-1/+2
| | | | | | | | We used to generate them only because manager had no idea what arch it is testing. So syscalls numbers had to match between all arches. This is not needed anymore. Also don't generate unreferenced structs/resources.
* sys, pkg/compiler: move padding computation to compilerDmitry Vyukov2017-09-041-0/+46
| | | | This makes types constant during execution, everything is precomputed.
* pkg/compiler: detect resources without ctorsDmitry Vyukov2017-09-041-0/+87
Fixes #217