Closed bzbarsky-apple closed 1 month ago
Disabling this in https://github.com/project-chip/connectedhomeip/pull/35307 for now to work around SVE problems.
Reproduced via python script by:
attr = await devCtrl.ReadAttribute(
node_id, [Clusters.WaterHeaterManagement.Attributes.HeaterTypes]
)
(wrote a test script in https://github.com/andy31415/chip-repl-tests/blob/main/energy_management_read.py). Looking into fixing this
It seems the logic in the code states that we do not compare data length for non-unit-tests because it is not reliable (time-dependent sizes may differ). However the logic for this seems broken as CONFIG_BUILD_FOR_HOST_UNIT_TEST
seems to be enabled when building the energy management app. This seems odd.
Reproduction steps
Then run
./out/debug/chip-energy-management-app
, commission it, and do:The app crashes. This happens because that attribute read fails in both the "data model" and "ember" versions of read, but the "ember" version does the equivalent of
AttributeReportBuilder::PrepareAttribute
before it tries the part that fails, while the "data model" version does them in the opposite order. So whilestatusEmber != statusDm
tests false,lengthWrittenEmber != reportBuilder.GetWriter()->GetLengthWritten()
is true and we hit the fatal assert.There's a comment there that says:
but that's just not true. The StatusIB encoding is done by the caller of
RetrieveClusterData
(Engine::BuildSingleReportDataAttributeReportIBs
) after rolling back the TLV in error cases. Except forIsOutOfSpaceEncodingResponse()
situations.So presumably either the logic in Read-Checked needs to be fixed to be looser in its assertions or the two RetrieveClusterData implementations need to be changed to produce equivalent output as this code expects.
Bug prevalence
Always
GitHub hash of the SDK that was being used
ebc4237ca928bb5a7eecfe423f67a8f5ef587b48
Platform
core
Platform Version(s)
No response
Anything else?
No response