)]}'
{
  "commit": "3169b734cf07ec8800436b2c5298897aa993d2be",
  "tree": "8bbea74563363a576b3f2fbb34e512c096880f46",
  "parents": [
    "b7b6f36275d5ff6a9e2bf679a5e3d354e531648a"
  ],
  "author": {
    "name": "Indu Bhagat",
    "email": "indu.bhagat@oracle.com",
    "time": "Thu Jun 29 11:03:32 2023 -0700"
  },
  "committer": {
    "name": "Indu Bhagat",
    "email": "indu.bhagat@oracle.com",
    "time": "Thu Jun 29 11:03:32 2023 -0700"
  },
  "message": "libsframe: fix sframe_find_fre for pltN entries\n\nFor a toy application on x86_64, for example, following is the SFrame\nstack trace information for the 3 pltN entries of 16 bytes each:\n\n   func idx [1]: pc \u003d 0x401030, size \u003d 48 bytes\n   STARTPC[m]      CFA       FP        RA\n   0000000000000000  sp+8      u         u\n   000000000000000b  sp+16     u         u\n\nThe data in first column is the start_ip_offset.  Also note that the FDE\nis of type SFRAME_FDE_TYPE_PCMASK (denoted by the [m] on LHS).\n\nWhere each pltN (note: excluding plt0 entry) entry looks like:\n\n  401030: jmp    *0x2fca(%rip)\n  401036: push   $0x0\n  40103b: jmp    401020\u003c_init+0x20\u003e\n\n  401040: jmp    *0x2fc2(%rip)\n  401046: push   $0x1\n  40104b: jmp    401020\u003c_init+0x20\u003e\n\n  401050: jmp    *0x2fba(%rip)\n  401056: push   $0x2\n  40105b: jmp    401020\u003c_init+0x20\u003e\n\nNow, to find SFrame stack trace information from an FDE of type\nSFRAME_FDE_TYPE_PCMASK, sframe_find_fre () was doing an operation\nlike,\n  (start_ip_offset \u0026 0xf) \u003e\u003d (pc \u0026 0xf)\n\nThis works for pltN entry of size, say, less than 16 bytes.  But if the\npltN entries or similar code stubs (for which SFrame FDE of type\nSFRAME_FDE_TYPE_PCMASK may be used), evolve to be of size \u003e 16 bytes,\nthis will cease to work.\n\nTo match the range covered by the SFrame FRE, one should instead perform\na modulo operation.  The constant for the modulo operation must be the\nsize of the pltN entry.  Further, this constant should ideally be\nencoded in the format, as it may be different for each ABI.\n\nIn SFrame Version 2 of the format, we will move towards encoding it\nexplicitly in the SFrame FDE.  For now, fix up the logic to at least\nmove towards modulo operation.\n\nlibsframe/\n\t* sframe.c (sframe_fre_check_range_p): New definition.\n\t(sframe_find_fre): Refactor a bit and use the new definition\n\tabove.\ninclude/\n\t* sframe.h (SFRAME_FDE_TYPE_PCMASK): Update comment.\nlibsframe/doc/\n\t* sframe-spec.texi: Fix the text for SFRAME_FDE_TYPE_PCMASK FDE\n\ttype.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c3dbb3a4097181794bbb43ed293f7ea74f5af1d6",
      "old_mode": 33188,
      "old_path": "include/sframe.h",
      "new_id": "cdf275f69e494e75373559d8b95e8d9176fbe873",
      "new_mode": 33188,
      "new_path": "include/sframe.h"
    },
    {
      "type": "modify",
      "old_id": "5155410bdc8a55d825abfd99c0df4ea32915de29",
      "old_mode": 33188,
      "old_path": "libsframe/doc/sframe-spec.texi",
      "new_id": "a37a6f91414466abe9ad9f22ef5fbd9f37bac132",
      "new_mode": 33188,
      "new_path": "libsframe/doc/sframe-spec.texi"
    },
    {
      "type": "modify",
      "old_id": "29142436b842fe7e9cdd595da0e927678cd722aa",
      "old_mode": 33188,
      "old_path": "libsframe/sframe.c",
      "new_id": "fd966cfffd48f4fd74b634b3d459d3aee0559706",
      "new_mode": 33188,
      "new_path": "libsframe/sframe.c"
    }
  ]
}
