Actions
Bug #64854
opendecoding chunk_refs_by_hash_t return wrong values
% Done:
0%
Source:
Tags:
backport_processed
Backport:
squid
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
When running ceph dencoder test on clang-14 compiled JSON dump of chunk_refs_by_hash_t will show:
root@32564ef5a473:/ceph/build# bin/ceph-dencoder type chunk_refs_t import ../ceph-object-corpus/archive/18.2.0/objects/chunk_refs_t/ccb69d9ecd572c1f6ed9598899773cf1 decode dump_json { "type": "by_hash", "count": 20480, "hash_bits": 3, "hash_bytes": 1, "refs": [ { "pool": 0, "hash": 552785920, "count": 99 }, { "pool": 0, "hash": 552785921, "count": 84 }, { "pool": 0, "hash": 552785922, "count": 101 },
on GCC compiled:
{ "type": "by_hash", "count": 20480, "hash_bits": 3, "hash_bytes": 1, "refs": [ { "pool": 0, "hash": 0, "count": 99 }, { "pool": 0, "hash": 1, "count": 84 }, { "pool": 0, "hash": 2, "count": 101 },
the decoding function:
void decode(::ceph::buffer::ptr::const_iterator& p) { DENC_START(1, 1, p); denc_varint(total, p); denc_varint(hash_bits, p); uint64_t n; denc_varint(n, p); int hash_bytes = (hash_bits + 7) / 8; while (n--) { int64_t poolid; ceph_le32 hash; <---- un-initialized should have = (ceph_le32)0; uint64_t count; denc_signed_varint(poolid, p); memcpy(&hash, p.get_pos_add(hash_bytes), hash_bytes); denc_varint(count, p); by_hash[std::make_pair(poolid, (uint32_t)hash)] = count; }
Updated by Radoslaw Zarzynski about 2 months ago
Hmm, I guess I saw a PR for that.
Updated by Nitzan Mordechai about 2 months ago
- Status changed from In Progress to Fix Under Review
- Pull request ID set to 56136
Updated by Nitzan Mordechai 30 days ago
- Status changed from Fix Under Review to Pending Backport
Updated by Radoslaw Zarzynski 30 days ago
- Copied to Backport #65311: squid: decoding chunk_refs_by_hash_t return wrong values added
Updated by Backport Bot 30 days ago
- Copied to Backport #65312: squid: decoding chunk_refs_by_hash_t return wrong values added
Actions