Skip to content

spi/phpdbg: windows update exception type falling into segfault. #15098

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sapi/phpdbg/phpdbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ int main(int argc, char **argv) /* {{{ */

#ifdef _WIN32
} __except(phpdbg_exception_handler_win32(xp = GetExceptionInformation())) {
phpdbg_error("Access violation (Segmentation fault) encountered\ntrying to abort cleanly...");
phpdbg_error("Segmentation fault encountered\ntrying to abort cleanly...");
}
#endif
phpdbg_out:
Expand Down
14 changes: 9 additions & 5 deletions sapi/phpdbg/phpdbg_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ int phpdbg_exception_handler_win32(EXCEPTION_POINTERS *xp) {
EXCEPTION_RECORD *xr = xp->ExceptionRecord;
CONTEXT *xc = xp->ContextRecord;

if(xr->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {

if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1]) == SUCCESS) {
return EXCEPTION_CONTINUE_EXECUTION;
}
switch (xr->ExceptionCode) {
case EXCEPTION_ACCESS_VIOLATION:
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
case EXCEPTION_STACK_OVERFLOW:
if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1]) == SUCCESS) {
return EXCEPTION_CONTINUE_EXECUTION;
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}

return EXCEPTION_CONTINUE_SEARCH;
Expand Down
Loading