Skip to content

WasmVM: realloc(ptr, 0) returns non-NULL instead of NULL per POSIX #32

@NathanFlurry

Description

@NathanFlurry

Summary

realloc(ptr, 0) returns a non-NULL pointer in WASM (WASI libc / dlmalloc) but returns NULL on native Linux (glibc). POSIX allows either behavior, but the os-test suite expects NULL.

Affected os-test cases

  • malloc/realloc-0

Expected behavior

realloc(ptr, 0) should return NULL to match glibc behavior and os-test expectations.

Context

This is a WASI sysroot (dlmalloc) behavioral difference. Discovered via os-test POSIX conformance suite. Tracked in posix-exclusions.json as fail / patched-sysroot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions