Project

General

Profile

Actions

Backport #65311

closed

squid: decoding chunk_refs_by_hash_t return wrong values

Added by Radoslaw Zarzynski about 1 month ago. Updated about 1 month ago.

Status:
Rejected
Priority:
Normal
Target version:
-
Release:
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;
    }


Related issues 2 (2 open0 closed)

Copied from RADOS - Bug #64854: decoding chunk_refs_by_hash_t return wrong valuesPending BackportNitzan Mordechai

Actions
Copied to RADOS - Backport #65313: squid: decoding chunk_refs_by_hash_t return wrong valuesNewNitzan MordechaiActions
Actions #1

Updated by Radoslaw Zarzynski about 1 month ago

  • Copied from Bug #64854: decoding chunk_refs_by_hash_t return wrong values added
Actions #2

Updated by Nitzan Mordechai about 1 month ago

  • Copied to Backport #65313: squid: decoding chunk_refs_by_hash_t return wrong values added
Actions #3

Updated by Nitzan Mordechai about 1 month ago

  • Status changed from Pending Backport to Rejected

backport script already created another tracker, rejecting that one

Actions

Also available in: Atom PDF