Skip to content

Solarish: standard allocator uses memalign incorrectly #124787

Closed
@RalfJung

Description

@RalfJung

The docs for that function state

The memalign() function allocates size bytes on a specified alignment boundary and returns a pointer to the allocated block. The value of the returned address is guaranteed to be an even multiple of alignment. The value of alignment must be a power of two and must be greater than or equal to the size of a word.

(emphasis mine)

However, the way this function gets called here does not ensure that the alignment is at least the size of a word.

Cc @devnexen (discovered by failing CI in rust-lang/miri#3575)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-illumosthe other shiny OSO-solarisOperating system: SolarisT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions