GreptimeTeam / greptimedb

An open-source, cloud-native, unified time series database for metrics, logs and events with SQL/PromQL supported. Available on GreptimeCloud.
https://greptime.com/
Apache License 2.0
4.19k stars 299 forks source link

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

Closed yurivict closed 6 days ago

yurivict commented 1 month ago

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
evenyag commented 1 month ago

Duplicated with https://github.com/GreptimeTeam/greptimedb/issues/4219

yurivict commented 1 month ago

rust-1.79.0

yurivict commented 6 days ago

close as a duplicate of https://github.com/GreptimeTeam/greptimedb/issues/4219