-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widen modidx field in offline_entry_t. #2969
Widen modidx field in offline_entry_t. #2969
Conversation
Extend the modidx field from 12 bits to 16. The 4 bits are claimed from the instr_count field which records the number of instructions in the basic block. The number of instructions is controlled by a command line parameter. We check that the max_bb_instr is set to number lower than what we can accomodate in the bitfield. Fixes DynamoRIO#2956
Extend the modidx field from 12 bits to 16. The 4 bits are claimed from the instr_count field which records the number of instructions in the basic block. The number of instructions is controlled by a command line parameter. We check that the max_bb_instr is set to number lower than what we can accomodate in the bitfield. Fixes DynamoRIO#2956
…o into i2956-modidx-overflow
Extend the modidx field from 12 bits to 16. The 4 bits are claimed from the instr_count field which records the number of instructions in the basic block. The number of instructions is controlled by a command line parameter. We check that the max_bb_instr is set to number lower than what we can accomodate in the bitfield. Fixes DynamoRIO#2956
Extend the modidx field from 12 bits to 16. The 4 bits are claimed from the instr_count field which records the number of instructions in the basic block. The number of instructions is controlled by a command line parameter. We check that the max_bb_instr is set to number lower than what we can accomodate in the bitfield. Fixes DynamoRIO#2956
uint64_t modidx:12; | ||
uint64_t instr_count:16; | ||
uint64_t modidx:16; | ||
uint64_t instr_count:12; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest either a comment here advising that a change here needs to also update the hardcoded sizes in the 2 other files, or to use named constants (as is done with EXT_VALUE_A_BITS, e.g.) -- I would vote for the named constants.
uint64_t modoffs = dr_app_pc_as_jump_target(instr_get_isa_mode(where), pc) - modbase; | ||
// Check that the values we want to assign to the bitfields in offline_entry_t do not | ||
// overflow. In i#2956 we observed an overflow for the modidx field. | ||
DR_ASSERT(modoffs < uint64_t(1) << 34); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should all be the bitfield size, not +1
Use named constants for the bit widths. Fix bug in bit width check.
PTAL. Thanks! |
Fix typo in bitfield declaration.
This reverts commit 48db566 which reverted the changes in PR DynamoRIO#2940. The changes pushed caused some apps to overflow the modidx field (issue DynamoRIO#2956). PR DynamoRIO#2969 increased the width of the modidx field. We can now safely revert the revert.
Extend the modidx field from 12 bits to 16. The 4 bits are claimed from
the instr_count field which records the number of instructions in the
basic block. The number of instructions is controlled by a command line
parameter. We check that the max_bb_instr is set to number lower than
what we can accomodate in the bitfield.
Fixes #2956