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

error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused #4392

Closed
yurivict opened this issue Jul 18, 2024 · 3 comments
Labels
C-bug Category Bugs

Comments

@yurivict
Copy link

What type of bug is this?

Other

What subsystems are affected?

Other

Minimal reproduce step

Regular build.

What did you expect to see?

n/a

What did you see instead?

error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
   --> /wrkdirs/usr/ports/databases/greptimedb/work/RustPython-9ed51374125b5f1a9e5cee5dd7e27023b8591f1e/vm/src/class.rs:124:17
    |
123 |                 let r: &Py<PyType> = &typ;
    |                                       --- backing allocation comes from here
124 |                 &*(r as *const _)
    |                 ^^^^^^^^^^^^^^^^^
    |
    = note: casting from `core::PyRef<type_::PyType>` (8 bytes) to `core::Py<type_::PyType>` (856 bytes)
    = note: `#[deny(invalid_reference_casting)]` on by default

warning: `rustpython-vm` (lib) generated 5 warnings
error: could not compile `rustpython-vm` (lib) due to 1 previous error; 5 warnings emitted

What operating system did you use?

FreeBSD 14.1

What version of GreptimeDB did you use?

0.9.0

Relevant log output and stack trace

n/a
@yurivict yurivict added the C-bug Category Bugs label Jul 18, 2024
@evenyag
Copy link
Contributor

evenyag commented Jul 19, 2024

Duplicated with #4219

@yurivict
Copy link
Author

rust-1.79.0

@yurivict
Copy link
Author

yurivict commented Sep 7, 2024

close as a duplicate of #4219

@yurivict yurivict closed this as completed Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

No branches or pull requests

2 participants