Skip to content

Conversation

dstogov
Copy link
Member

@dstogov dstogov commented Apr 20, 2016

No description provided.

@bwoebi
Copy link
Member

bwoebi commented Apr 20, 2016

Can't we possibly just reuse exception handling for this (throw an internal uncatchable exception)? And then check in the HANDLE_EXCEPTION opcode for whether it had been caused by a timeout? And we anyway check EG(exception) often enough...

We then might need guards where altering the exceptions, but that should have a much lower impact than checking on every jump. Every loop iteration, every if statement is going to execute that check...

@dstogov
Copy link
Member Author

dstogov commented Apr 20, 2016

I think, we can't safely throw exception from a signal handler.

Because EG(exception) and EX(opline) may be changed inconsistently.


From: Bob Weinand notifications@github.com
Sent: Wednesday, April 20, 2016 16:28
To: php/php-src
Cc: Dmitry Stogov; Author
Subject: Re: [php/php-src] Safe execution timeout handling. (#1876)

Can't we possibly just reuse exception handling for this (throw an internal uncatchable exception)? And then check in the HANDLE_EXCEPTION opcode for whether it had been caused by a timeout? And we anyway check EG(exception) often enough...

We then might need guards where altering the exceptions, but that should have a much lower impact than checking on every jump. Every loop iteration, every if statement is going to execute that check...

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHubhttps://github.com//pull/1876#issuecomment-212423751

@bwoebi
Copy link
Member

bwoebi commented Apr 20, 2016

That's why I'm saying, use guards. These guards always only are a non-conflicting mov instr, which should be minimal impact as EG(exception) is only supposed to be altered rarely.

@dstogov
Copy link
Member Author

dstogov commented Apr 20, 2016

What about EX(opline), execute_data itself and OPLINE in CPU register?


From: Bob Weinand notifications@github.com
Sent: Wednesday, April 20, 2016 18:19
To: php/php-src
Cc: Dmitry Stogov; Author
Subject: Re: [php/php-src] Safe execution timeout handling. (#1876)

That's why I'm saying, use guards. These guards always only are a non-conflicting mov instr, which should be minimal impact as EG(exception) is only supposed to be altered rarely.

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHubhttps://github.com//pull/1876#issuecomment-212473801

* master:
  Fixed bug #72059 - Reference the bug id directly in NEWS
  Fix magic constants (__LINE__) with ?? for constant scalar exprs
  Add NEWS entry for ?? in constant scalar expressions
  allow null coalescing (??) on constant expressions
  Fix intl tests for ICU < 52
  Fix ZTS builds by adding a missing TSRMLS_FETCH().
  Fix bug #71737
  Update NEWS
  Fix RECV opcode to handle all kinds of exceptions
  Fix RECV opcode to handle all kinds of exceptions
@php-pulls php-pulls merged commit c026ca6 into php:master Apr 21, 2016
@dstogov dstogov deleted the safe_timeout branch October 14, 2019 20:38
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.

3 participants