Skip to content

Commit

Permalink
rec_process_syscall_arch: when the old brk is the same as new brk avo…
Browse files Browse the repository at this point in the history
…id writing a zero length mapped region into the trace
  • Loading branch information
sidkshatriya committed Feb 28, 2024
1 parent 53e4b37 commit bb669e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/record_syscall.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6582,6 +6582,12 @@ static void rec_process_syscall_arch(RecordTask* t,
remote_ptr<void> old_brk = ceil_page_size(t->vm()->current_brk());
remote_ptr<void> new_brk = ceil_page_size(t->regs().syscall_result());
KernelMapping km;
// This should be a nop.
// Otherwise we end up writing a redundant (though seemingly benign) zero length mapped region in the trace.
if (old_brk == new_brk) {
LOG(debug) << "brk(" << new_brk << "). Unchanged from old brk, so doing nothing";
break;
}
if (old_brk < new_brk) {
// Read the kernel's mapping. There doesn't seem to be any other way to
// get the correct prot bits for heaps. Usually it's READ|WRITE but
Expand Down

0 comments on commit bb669e0

Please sign in to comment.