Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #4943
Closed
Open
Issue created Jun 09, 2021 by prasun3@prasun3Contributor

ASSERT (opnd_create_immed_int: value too large for 8-bit size) in offline tracer when running with L0_filter and if application has basic block longer than 256 insts

Describe the bug The assert occurs if we have a basic block longer than 256 instructions. The assert goes away if I change OPND_CREATE_INT8(ud->bb_instr_count))); to OPND_CREATE_INT16(ud->bb_instr_count)));

   1051        if (op_L0_filter.get_value()) {
   1052            // Count dynamic instructions per thread.
   1053            // It is too expensive to increment per instruction, so we increment once
   1054            // per block by the instruction count for that block.
   1055            if (drmgr_is_first_nonlabel_instr(drcontext, app)) {
   1056                // On x86 we could do this in one instruction if we clobber the flags: but
   1057                // then we'd have to preserve the flags before our same-line skip in
   1058                // insert_filter_addr().
   1059                dr_insert_read_raw_tls(drcontext, ilist, where, tls_seg,
   1060                                       tls_offs + sizeof(void *) * MEMTRACE_TLS_OFFS_ICOUNT,
   1061                                       reg_ptr);
   1062                MINSERT(ilist, where,
  >1063                        XINST_CREATE_add(drcontext, opnd_create_reg(reg_ptr),
   1064                                         OPND_CREATE_INT8(ud->bb_instr_count)));
   1065                dr_insert_write_raw_tls(drcontext, ilist, where, tls_seg,
   1066                                        tls_offs + sizeof(void *) * MEMTRACE_TLS_OFFS_ICOUNT,
   1067                                        reg_ptr);
   1068            }

(gdb) p ud->bb_instr_count
$5 = 257

To Reproduce Run offline tracer with the L0_filter option and an application that has a basic block longer than 256 instructions.

drrun -t drcachesim -offline -L0_filter -- <app>

Expected behavior The assert should not fail.

Screenshots or Pasted Text

opnd_create_immed_int: value too large for 8-bit size

Versions

  • What version of DynamoRIO are you using? cronbuild-8.0.18752
  • Does the latest build from https://github.com/DynamoRIO/dynamorio/releases solve the problem? No
  • What operating system version are you running on? Ubuntu 18.04.5 LTS
  • Is your application 32-bit or 64-bit? ELF 64-bit LSB executable

Additional context None

Assignee
Assign to
Time tracking