Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected payload size for non byte aligned payload #32

Open
mgeisler opened this issue Jun 15, 2023 · 0 comments
Open

Unexpected payload size for non byte aligned payload #32

mgeisler opened this issue Jun 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@mgeisler
Copy link
Collaborator

mgeisler commented Jun 15, 2023

The following PDL file crashes backends::rust::generate, even though it passes through the analyzer:

little_endian_packets

struct Foo {
  ts_sec: 20,
  ts_usec: 32,
  _size_(_payload_): 32,
  _payload_,
}

Stack trace:

thread '<unnamed>' panicked at 'Unexpected payload size for non byte aligned payload', /home/mgeisler/src/pdl/src/backends/rust/parser.rs:526:17
stack backtrace:
   0: begin_panic_handler
             at /rustc/b2b34bd83192c3d16c88655158f7d8d612513e88/library/std/src/panicking.rs:593:5
   1: panic_fmt
             at /rustc/b2b34bd83192c3d16c88655158f7d8d612513e88/library/core/src/panicking.rs:67:14
   2: pdl_compiler::backends::rust::parser::FieldParser::add_payload_field
             at ./src/backends/rust/parser.rs:526:17
   3: pdl_compiler::backends::rust::parser::FieldParser::add
             at ./src/backends/rust/parser.rs:77:17
   4: pdl_compiler::backends::rust::generate_data_struct
             at ./src/backends/rust.rs:236:9
   5: pdl_compiler::backends::rust::generate_struct_decl
             at ./src/backends/rust.rs:696:38
   6: pdl_compiler::backends::rust::generate_decl
             at ./src/backends/rust.rs:979:13
   7: pdl_compiler::backends::rust::generate::{{closure}}
             at ./src/backends/rust.rs:998:53
@mgeisler mgeisler added the bug Something isn't working label Jun 15, 2023
mgeisler added a commit that referenced this issue Jun 15, 2023
The fuzzer for the Rust backend quickly found two bugs where PDL files
were not sufficiently vetted by the analyzer:

- #32 and
- #33.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant