Project

General

Profile

Actions

Bug #64854

open

decoding chunk_refs_by_hash_t return wrong values

Added by Nitzan Mordechai about 2 months ago. Updated 30 days ago.

Status:
Pending Backport
Priority:
Normal
Category:
-
Target version:
-
% 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;
    }


Related issues 2 (1 open1 closed)

Copied to RADOS - Backport #65311: squid: decoding chunk_refs_by_hash_t return wrong valuesRejectedNitzan MordechaiActions
Copied to RADOS - Backport #65312: squid: decoding chunk_refs_by_hash_t return wrong valuesIn ProgressNitzan MordechaiActions
Actions #1

Updated by Radoslaw Zarzynski about 2 months ago

Hmm, I guess I saw a PR for that.

Actions #2

Updated by Nitzan Mordechai about 2 months ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 56136
Actions #3

Updated by Radoslaw Zarzynski about 1 month ago

In QA.

Actions #4

Updated by Nitzan Mordechai 30 days ago

  • Backport set to squid
Actions #5

Updated by Nitzan Mordechai 30 days ago

  • Status changed from Fix Under Review to Pending Backport
Actions #6

Updated by Radoslaw Zarzynski 30 days ago

  • Copied to Backport #65311: squid: decoding chunk_refs_by_hash_t return wrong values added
Actions #7

Updated by Backport Bot 30 days ago

  • Copied to Backport #65312: squid: decoding chunk_refs_by_hash_t return wrong values added
Actions #8

Updated by Backport Bot 30 days ago

  • Tags set to backport_processed
Actions

Also available in: Atom PDF