Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

llvm error: export_name #155495

Copy link
Copy link

Description

@matthiaskrgr
Issue body actions

I tried this code:

#[unsafe(export_name = "\
")]
pub fn main() {}

This can cause a segfault within LLVM.

Meta

rustc --version --verbose:

rustc 1.97.0-nightly (e9e32aca5 2026-04-17)
binary: rustc
commit-hash: e9e32aca5a4ffd08cbc29547b039d64b92a2c03b
commit-date: 2026-04-17
host: x86_64-unknown-linux-gnu
release: 1.97.0-nightly
LLVM version: 22.1.2

with debug assertions:

rust -Cprofile-generate=. a.rs

rustc: /checkout/src/llvm-project/llvm/include/llvm/ADT/StringRef.h:236: char llvm::StringRef::operator[](size_t) const: Assertion `Index < size() && "Invalid index!"' failed.

rustc -Cinstrument-coverage

rustc: /checkout/src/llvm-project/llvm/include/llvm/Support/Casting.h:572: decltype(auto) llvm::cast(From *) [To = llvm::ConstantDataArray, From = llvm::Constant]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-PGOArea: Profile-guided optimizations (PGO)Area: Profile-guided optimizations (PGO)A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)Area: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.