pmmp / ext-pmmpthread

Fork of https://github.com/krakjoe/pthreads with a revamped API and PHP 8.1+ support
Other
82 stars 15 forks source link

Segfault when using PTHREADS_INHERIT_NONE and anonymous class in run() #115

Open dktapps opened 1 year ago

dktapps commented 1 year ago

Any runnable class which declares anonymous classes inside its run() method will segfault when used, because the respective anonymous classes are not copied.

The only clear way to address this issue is to copy all classes whose declarations are in the same file as the as the Runnable class being copied. I'm not clear on how practical this is, though.

dktapps commented 1 year ago

Related to #111, in that the solution appears to be the same: All classes and functions declared within a copied class's file must also be copied.

dktapps commented 1 year ago

There doesn't seem to be any way to do this on the fly. There's no persisted script index in the main interpreter context.

It would seem that the only way to fix this is to implement #62.