Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Fixed unsafe copying of exception handler #888

Merged
merged 1 commit into from
Oct 26, 2018

Conversation

dktapps
Copy link
Contributor

@dktapps dktapps commented Aug 10, 2018

This fixes #753 .

See #861 (comment) for long explanation - the TL;DR is that serialization can cause objects to be modified on the child thread, which will cause problems.

The solution here is to serialize it in pthreads_prepare_parent() and then unserialize during the thread's prepared startup. A similar solution will likely be needed for statics.

@dktapps
Copy link
Contributor Author

dktapps commented Aug 10, 2018

travis is being dumb... a run for my fork on the same commit: https://travis-ci.org/pmmp/pthreads/jobs/414434233

@dktapps dktapps closed this Aug 10, 2018
@dktapps dktapps reopened this Aug 10, 2018
@dktapps
Copy link
Contributor Author

dktapps commented Aug 12, 2018

A less invasive way to do this could be to assign it to a magic (or private) property in the thread's property store - one that isn't accessible by normal code.

@sirsnyder sirsnyder self-assigned this Sep 11, 2018
@sirsnyder sirsnyder merged commit df26d45 into krakjoe:master Oct 26, 2018
@sirsnyder
Copy link
Collaborator

Thx @dktapps

@dktapps dktapps deleted the exception-handler-fix branch November 21, 2018 11:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/exception-handler-options.phpt with fresh php 7.2
2 participants