Skip to content

Conversation

@iluuu1994
Copy link
Member

Closes #25215

Rebase of GH-1010. I had a hard time testing this as I'd always run out of something else first.

@jurchiks
Copy link

jurchiks commented Apr 7, 2022

No tests?

@iluuu1994 iluuu1994 requested a review from krakjoe April 14, 2022 08:51
@iluuu1994
Copy link
Member Author

@krakjoe I suggested you because you reviewed the previous patch. Any idea on how I can test this? (unit or manual, neither worked for me)

@kocsismate
Copy link
Member

kocsismate commented Apr 15, 2022

@iluuu1994 What do you mean by "I'd always run out of something else first"? There are already tests for "max execution time", so only the "input time" case would need testing. I also tried to write a test for this case, but I had to come to the conclusion that it is not currently possible.

My approach would have been to use a callable default filter (filter.default=callback) which would have gone into an infinite loop. Unfortunately, doing so always resulted in a Uncaught TypeError: (null)(): Option must be a valid callback in [no active file]:0 as there is no way to specify the callback name (there is no ini setting + filter.c:410 invokes php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL, 0); where the first NULL stands for the $options array).

@kocsismate kocsismate self-requested a review April 15, 2022 09:40
Copy link
Member

@kocsismate kocsismate left a comment

Choose a reason for hiding this comment

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

The PR looks good to me!

#endif

if (PG(max_input_time) == -1) {
zend_set_timeout(EG(timeout_seconds), 1);
Copy link
Member

@kocsismate kocsismate Apr 15, 2022

Choose a reason for hiding this comment

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

actually, this is also an input timeout: when max_input_time equals to -1 the value of max_execution_time is used (https://www.php.net/manual/en/info.configuration.php#ini.max-input-time)

@bukka
Copy link
Member

bukka commented Apr 29, 2022

Would be nice to have this covered by test.

@cmb69
Copy link
Member

cmb69 commented May 12, 2022

My approach would have been to use a callable default filter (filter.default=callback) […]

filter.default is deprecated as of PHP 8.1.0, so this wouldn't work in the long run anyway. Instead it might be possible to overwrite sapi_module_struct.input_filter in the zend_test extension.

@iluuu1994 iluuu1994 marked this pull request as draft June 16, 2022 14:39
@iluuu1994
Copy link
Member Author

This is an uncommon error message to hit so I don't want to spend more time on this. If anybody else wants to feel free to take over.

@iluuu1994 iluuu1994 closed this Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants