Skip to content

cargo reports soon-to-be unaligned errors #130

@alxiord

Description

@alxiord
cargo report future-incompatibilities --id 2

reports 121 unaligned warnings (warning: reference to packed field is unaligned) that will become errors in future Rust versions and should be fixed.

The following warnings were discovered during the build. These warnings are an
indication that the packages contain code that will become an error in a
future release of Rust. These warnings typically cover changes to close
soundness problems, unintended or undocumented behavior, or critical problems
that cannot be fixed in a backwards-compatible fashion, and are not expected
to be in wide use.

Each warning should contain a link for more information on what the warning
means and how to resolve it.


To solve this problem, you can try the following approaches:


- If the issue is not solved by updating the dependencies, a fix has to be
implemented by those dependencies. You can help with that by notifying the
maintainers of this problem (e.g. by creating a bug report) or by proposing a
fix to the maintainers (e.g. by creating a pull request):

  - linux-loader@0.8.1
  - Repository: https://github.com/rust-vmm/linux-loader
  - Detailed warning command: `cargo report future-incompatibilities --id 2 --package linux-loader@0.8.1`

- If waiting for an upstream fix is not an option, you can use the `[patch]`
section in `Cargo.toml` to use your own version of the dependency. For more
information, see:
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
        
The package `linux-loader v0.8.1 (/workdir)` currently triggers the following future incompatibility lints:
> warning: reference to packed field is unaligned
>    --> src/loader_gen/x86_64/bootparam.rs:383:18
>     |
> 383 |         unsafe { &(*(::std::ptr::null::<screen_info>())).ext_mem_k as *const _ as usize },
>     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
>     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
>     = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
>     = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
>     = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
> note: the lint level is defined here
>    --> src/loader_gen/mod.rs:14:40
>     |


...

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededsecurityA security enhancement or public security issue (do not use for reporting security vuln)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions