Skip to content

Rust<->C by-val ABI issues on 32bit #2064

Closed

Description

In my latest bit of work on libuv bindings in rust, I've come into some issues with passing structs, by-val, from Rust->C in windows (64bit host, 32bit rust build).

I've found a few things:

  1. The data passed, by-val, from rust->C comes out as garbage in C. C->Rust via return and C->Rust via crust don't appear to be affected (this is in the context of my uv_tcp branch work on http://github.com/olsonjeffery/rust)
  2. when a by-val struct is including in a function signature in C, it seems that all of the parameters that come after become null/garbage, as well (I encountered with a callback fn ptr that was null when it was passed into C. But moving the ptr to be before the by-val struct in question caused it to be unbroken)

This is happening after #1402 was closed, and I know it was expected that there's be some bogeymen hiding out in 32bit edge cases, so hopefully this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions