Skip to content

rustllvm: Don't require null terminators in files #15779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2014

Conversation

alexcrichton
Copy link
Member

Apparently the default getFile implementation for a memory buffer in LLVM ends
up requiring a null terminator at the end of the file. This isn't true a good
bit of the time apparently on OSX. There have been a number of failed
nightly/snapshot builds recently with this strange assertion.

This modifies the calls to MemoryBuffer::getFile to explicitly not ask for a
null terminator.

@alexcrichton
Copy link
Member Author

Example logs:

http://buildbot.rust-lang.org/builders/nightly-mac/builds/21/steps/compile/logs/stdio
http://buildbot.rust-lang.org/builders/nightly-mac/builds/26/steps/compile/logs/stdio
http://buildbot.rust-lang.org/builders/nightly-mac/builds/33/steps/compile/logs/stdio

The relevant bit is:

Assertion failed: ((!RequiresNullTerminator || BufEnd[0] == 0) && "Buffer is not null terminated!"), function init, file /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/llvm/lib/Support/MemoryBuffer.cpp, line 49.

extern "C" LLVMMemoryBufferRef
LLVMRustCreateMemoryBufferWithContentsOfFile(const char *Path) {
OwningPtr<MemoryBuffer> buf;
error_code err = MemoryBuffer::getFile(path, buf, -1, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/path/Path/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Apparently the default getFile implementation for a memory buffer in LLVM ends
up requiring a null terminator at the end of the file. This isn't true a good
bit of the time apparently on OSX. There have been a number of failed
nightly/snapshot builds recently with this strange assertion.

This modifies the calls to MemoryBuffer::getFile to explicitly not ask for a
null terminator.
bors added a commit that referenced this pull request Jul 24, 2014
Apparently the default getFile implementation for a memory buffer in LLVM ends
up requiring a null terminator at the end of the file. This isn't true a good
bit of the time apparently on OSX. There have been a number of failed
nightly/snapshot builds recently with this strange assertion.

This modifies the calls to MemoryBuffer::getFile to explicitly not ask for a
null terminator.
@bors bors closed this Jul 24, 2014
@bors bors merged commit b29d106 into rust-lang:master Jul 24, 2014
@alexcrichton alexcrichton deleted the no-nul-terminator branch July 24, 2014 21:39
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2023
Add command for only opening external docs and attempt to fix vscode-remote issue

opening URI in a remote env causes vscode to ask the OS to handle `vscode-remote` URIs as there is no handler registered for such a scheme. This attempts to instruct vscode to handle those.

This is untested, as I can't figure out how to open a debug session on WSL rn.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants