Skip to content

Linker invocation failed with: nul byte found in provided data #72744

Closed
@tmiasko

Description

@tmiasko

In rollup #72681, the long-linker-command-lines test failed on macOS x86_64-apple with:

error: could not exec the linker `/Users/runner/runners/2.168.2/work/1/s/build/x86_64-apple-darwin/test/run-make-fulldeps/long-linker-command-lines/long-linker-command-lines/foo`
  |
  = note: nul byte found in provided data
  = note: "/Users/runner/runners/2.168.2/work/1/s/build/x86_64-apple-darwin/test/run-make-fulldeps/long-linker-command-lines/long-linker-command-lines/foo" "-m64" "-L" "/Users/runner/runners/2.168.2/w...

error: aborting due to previous error

', foo.rs:76:13

Which means that rustc attempted to invoke a linker, but incorrectly provided a string with a null byte to a Command through arg, cwd, env.

Hypothetical reproduction steps (would be nice to attempt to reproduce on macOS):

$ cd src/test/run-make-fulldeps/long-linker-command-lines
$ rustc -gO foo.rs
# NOTE: Expects TMPDIR environment variable to be set.
$ while ./foo; do :; done

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesA-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.O-macosOperating system: macOST-compilerRelevant to the compiler 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