Skip to content

Escaped user U+E002 is eaten by blind QUOTED_NULL consumers (printf emits stray U+E400, echo emits nothing, concat drops the char) #2882

Closed

Description

@caomengxuan666

Summary

An E400-escaped user U+E002 (QUOTED_NULL_MARKER as data) is eaten by blind consumers that are not E400-aware:

  • v=$'\uE002'; printf %s "$v" → emits a stray U+E400 alone (GNU: the raw U+E002 char)
  • echo "$v" → emits nothing
  • "a${v}b" → ab (char lost)

declare -p and ${#v} are correct — storage is fine; the consumers are wrong. Found by the #2879 systematic carrier-protocol sweep (battery cell c04 sub-cell; captain re-ran the repro and confirmed byte-level).

Root cause

Non-E400-aware cow_replace(QUOTED_NULL_MARKER_STR, "") / contains on the marker at:

  • src/executor/command_prepare.rs (~:1943 and :3383)
  • src/executor/embedded_mutations.rs (~:517)

Sibling sites ARE converted (conditional.rs:455, command_prepare.rs:4734 use the E400-aware helpers) — exactly the inconsistency shape of the #840 division-3 family: a single-char marker's escaped form (E400+char) is distinguishable from protocol only to a consumer that checks the E400 prefix.

Fix destination (1.5.1, simple fix — sweep item E2)

Convert the three blind sites to the aware helper family (restore_bare_sentinels / decode_bare_sentinels / push_literal_char as appropriate per site); extend tests/marker_leak_golden.rs with the E002 cell shapes.

Repro: v=$'\uE002' shapes above, run under LC_ALL=C.UTF-8 (in the POSIX locale GNU prints the literal \uE002 spelling and the shells agree — the locale is part of the repro).

Metadata

Metadata

Labels

area:expansionbuggnu-baseline

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions