Commit f895f6f
committed
fix(text-json): a misaligned u16 literal UBSan found, and #1894 closes on a rule-14 sweep
#1894's gate went stale the same day. Its own note set the condition -- "close
the negative-fixture half as not applicable if #1899 is declined/wontfix; do not
invent Text.Json sites while #1888 remains declined" -- and #1899 was declined on
2026-08-19 while #1888 remains declined, so both became determinate.
NEGATIVE-FIXTURE HALF: NOT APPLICABLE, verified rather than trusted. A probe
against the shipped headers confirms all four spellings #1888/#1899 would have
outlawed are STILL LEGAL: JsonArray copy- and move-constructible,
JsonNode::DetachParent() callable, and Extensions::Ancestors returning
std::vector<XElement*>. A negative fixture asserts a spelling is REJECTED BY THE
COMPILER; with nothing rejected, writing one would mean inventing an outlawed
spelling to pin. Not a claim that CCF-019 produced no fixtures at all -- its
async members did, in #1959 -- only that the two owned-tree modules #1894 scoped
outlawed nothing.
SANITIZER HALF: RE-MEASURED, AND THE RE-MEASUREMENT FOUND A REAL DEFECT. The
recorded figures were 218/218 Text_Json and 184/184 Xml_Linq from 2026-07-31;
both suites have since grown to 302 and 349, so they described a tree that no
longer exists. ASan+LSan came back clean on both. UBSan ABORTED Text_Json on a
misaligned reference binding in char_traits<char16_t>::length.
It is a defect in a TEST, not in production code, and finding which construction
caused it needed measurement rather than reading: the array copied verbatim into
a standalone probe did NOT reproduce, and neither did any literal alone. The
manifestation is translation-unit-layout dependent -- the empty u"" literal is
merged into a 1-byte-aligned mergeable section beside narrow literals, so
length() binds a const char16_t& to an odd address. One line: u"" becomes
std::u16string(), the same empty string with no literal to misalign. The
mutation that restores the literal reproduces the report.
The instrumentation was shown able to report before any of this was believed
(the #1957/SR-AUD-204 lesson): deliberate defects built with the same flags gave
one report each for ASan, LSan and UBSan, and the no-defect control gave none.
docs/NegativeConsumerFixtureValidation.md section 22 records all of it, and
corrects that document's running total -- stale since 2026-08-04 at 11
fixtures/94 sites -- to the measured 45/231.
Gate: 17,585 run, 17,585 passed, 0 failed, 0 skipped across 38 executables (+0,
deliberately -- a test was repaired, not added).
Build directories: build/ (gate), build-asan (reused), build-ubsan (created),
all --parallel 2 with ccache.1 parent 848a951 commit f895f6f
4 files changed
Lines changed: 116 additions & 2 deletions
File tree
- docs
- modules/text-json/tests/System/Text/Json
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1447 | 1447 | | |
1448 | 1448 | | |
1449 | 1449 | | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
| 495 | + | |
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| |||
Binary file not shown.
0 commit comments