Skip to content

Commit

Permalink
Add log line for mprotect failure
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Weinand <[email protected]>
  • Loading branch information
bwoebi committed Jan 17, 2024
1 parent 001ca15 commit b5621a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/ddtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ static void dd_patch_zend_call_known_function(void) {
page_size <<= 1; // if overlapping pages, use two
}
if (mprotect(page, page_size, PROT_READ | PROT_WRITE) != 0) { // Some architectures enforce W^X (either write _or_ execute, but not both).
LOG(Error, "Could not alter the memory protection for zend_call_known_function. Tracer execution continues, but may crash when encountering attributes.");
return; // Make absolutely sure we can write
}

Expand Down

0 comments on commit b5621a6

Please sign in to comment.