Skip to content
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

Address segmentation fault caused by accessing lookup data once the extension data was freed #505

Merged
merged 6 commits into from Jul 25, 2019

Conversation

pawelchcki
Copy link
Contributor

@pawelchcki pawelchcki commented Jul 23, 2019

Description

In some cases PHP code could be run after extension destructor has run, causing a segmentation fault when accessing lookup data from within PHP code. This PR changes the code to use pointers to hashtables and sets them to NULL to denote they're not to be used. Additional checks have been added to lookup code to make sure we check the status of those pointers before accessing them.

Additionally this PR includes fixes for:

  • open basedir request init hook limitation that caused the request init hook not to be loaded when basedir restriction was in place causing fatal errors.
  • fixes our autoloader overrides errors found when testing against PHP tests.

Readiness checklist

@pawelchcki pawelchcki force-pushed the pawel/build_fix_errors_found_in_tests branch from b53d432 to 2c429f2 Compare July 23, 2019 15:19
Copy link
Contributor

@SammyK SammyK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice improvements @pawelchcki! I just suggested a few tweaks. :)

tests/ext/from_php_7_3_bug61728.phpt Show resolved Hide resolved
src/ext/request_hooks.c Show resolved Hide resolved
bridge/functions.php Outdated Show resolved Hide resolved
bridge/functions.php Show resolved Hide resolved
src/ext/ddtrace.c Show resolved Hide resolved
src/ext/dispatch.c Show resolved Hide resolved
@pawelchcki pawelchcki force-pushed the pawel/build_fix_errors_found_in_tests branch from 8d8e709 to b6fac9c Compare July 24, 2019 11:40
@pawelchcki
Copy link
Contributor Author

Thanks @SammyK for the review, I've addressed all suggestions. Should be ready for next review round.

SammyK
SammyK previously approved these changes Jul 24, 2019
Copy link
Contributor

@SammyK SammyK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @pawelchcki! :)

@pawelchcki pawelchcki force-pushed the pawel/build_fix_errors_found_in_tests branch from dd7872c to 8a2944a Compare July 25, 2019 10:07
@labbati labbati merged commit fede016 into master Jul 25, 2019
@pawelchcki pawelchcki added this to the 0.30.0 milestone Aug 8, 2019
@palazzem palazzem deleted the pawel/build_fix_errors_found_in_tests branch September 23, 2019 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants