[KongchangAI]
ConceptUB / Undefined Behavior

Undefined Behavior

A semantic category in the ISO C standard that permits a compiler to handle certain code in arbitrary ways, including producing seemingly correct output, crashing, silently corrupting data, or deleting the relevant code. Common cases include signed integer overflow, array out-of-bounds access, and null pointer dereference.

Timeline (last 90 days)

Oct 15

Undefined behavior (UB) in the C standard allows an implementation to do anything when it encounters that behavior, including producing seemingly correct output, crashing, silently corrupting data, or deleting the relevant code entirely after optimization.

Unverified50%
Oct 15

Signed integer overflow, out-of-bounds array reads and writes, dereferencing null or dangling pointers, violating sequence point rules, and reading uninitialized variables are all explicitly listed by the C standard as undefined behavior.

Unverified50%
Oct 15

The compiler assumes that signed addition never overflows, thereby concluding that certain boundary conditions are unreachable and deleting the corresponding check branches, which is extremely common at -O2 and above.

Unverified50%
Oct 13

In Rust, soundness means: if the compiler accepts a piece of code, but that code may trigger undefined behavior at runtime, then the compiler is unsound.

Unverified50%
Oct 13

Undefined behavior (UB) refers to operations for which the language specification explicitly does not guarantee any behavior, such as dereferencing a dangling pointer, data races, out-of-bounds access, etc.

Unverified50%
Oct 13

Rust's design goal is to statically eliminate the vast majority of undefined behavior at compile time through ownership and borrowing rules.

Unverified50%

All Facts (6)

Source Articles