Commit Graph

238 Commits

Author SHA1 Message Date
Craig Duncan
1d631c18de Convert phpdbg arginfo to php stubs
Closes GH-4867.
2019-10-29 11:39:58 +01:00
Nikita Popov
1c9cbc911d Small phpdbg cleanups
Add a zpp_none() call, convert E_ERROR to ValueError.
2019-10-29 11:39:02 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
fa07a9c223 Fix symtable_cache_limit assignment in phpdbg
The meaning of the limit changed in 7.4, it now points one past the
end. Adjust code accordingly.
2019-09-14 00:25:07 +02:00
Nikita Popov
d59aac58b3 Report errors from stream read and write operations
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
2019-07-22 17:17:28 +02:00
Nikita Popov
af3e2d3186 Initialize last_line in phpdbg globals 2019-07-01 16:14:45 +02:00
Nikita Popov
50cce5eb4f Avoid reliance on arena details on phpdbg oplog
Instead of guessing what the address of the first arena allocation
is going to be, embed the sentinel in the oplog_list structure
directly.
2019-06-28 14:47:42 +02:00
Joe Watkins
68485f8ab4
implement tsrm_is_shutdown API 2019-06-28 10:27:19 +02:00
Christoph M. Becker
bc0db8ce45 Use the portable zend_strndup() instead of strndup() 2019-06-28 10:23:38 +02:00
Nikita Popov
c3132781ec Fix phpdbg shutdown order
In particular, make sure that everything using zmm is released
before zmm is shut down. phpdbg currently gets away with this,
because either a) its custom handlers are used and no auto-free
happens or b) the system allocator is used and no auto-free happens.
With the tracking allocator for asan this no longer works.
2019-06-27 14:20:51 +02:00
Nikita Popov
2149ed7072 Don't use zmm for PHPDBG_G(exec)
Uses system allocator when backing up settings ... let's avoid
unnecessary confusion.
2019-06-27 14:20:30 +02:00
Nikita Popov
a7bcfee9c9 Fix prompt leak in phpdbg 2019-06-21 17:01:18 +02:00
Nikita Popov
89b2d88659 Register class before fetching parent
We want the class declaration to be available while compiling the
parent class.
2019-06-11 13:09:33 +02:00
Nikita Popov
c09b63595e Fix potentially uninitialized warnings in phpdbg 2019-04-12 11:46:03 +02:00
Dmitry Stogov
9499484ed2 Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc. 2019-03-14 03:01:01 +03:00
Dmitry Stogov
04b67bac32 Avoid reinitailization of ZTS cache pointer. Initialize it once in TSRM.c 2019-03-12 17:35:50 +03:00
Dmitry Stogov
083cfc07cc Use TSRM macros 2019-02-12 17:40:29 +03:00
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Dmitry Stogov
10abc1f010 Don't wrap php_module_shutdown() with zend_try. executor_globals are released in ZTS build, and this leads to crash. 2018-10-25 23:41:26 +03:00
Dmitry Stogov
d140df58e6 Keep information about unresolved interfaces in zend_class_entry->interface_names.
Move interface implementation code into ZEND_DECLARE_*CLASS opcodes.
Remove ZEND_ADD_INTERFACE and ZEND_VERIFY_ABSTRACT_CLASS opcodes.
2018-08-23 17:16:28 +03:00
Dmitry Stogov
67397970b2 Replace zend_class_entry->traits by persistent zend_class_entry->trait_names.
Move trait binding code into ZEND_DECLARE_*CLASS opcodes.
Remove ZEND_ADD_TRIAIT and ZEND_BIND_TRAITS opcodes.
2018-08-23 02:02:26 +03:00
Dmitry Stogov
ab8094c666 Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value. 2018-07-26 12:58:07 +03:00
Dmitry Stogov
716bbd3480 Remove duplicated code (keep destroy_zend_function() for compatibility) 2018-06-27 14:54:42 +03:00
Christoph M. Becker
0778359223 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix arginfo wrt. optional/required parameters
2018-06-25 11:57:25 +02:00
Christoph M. Becker
2458dab466 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix arginfo wrt. optional/required parameters
2018-06-25 11:54:45 +02:00
Christoph M. Becker
6b5597f7d8 Fix arginfo wrt. optional/required parameters
All parameters of phpdbg_color(), phpdbg_exec() and phpdbg_prompt() are
required.  We mark them as such.
2018-06-25 11:52:17 +02:00
Christoph M. Becker
d169d06d30 Remove useless PHPDBG_* constants
The sole purpose of `PHPDBG_FILE`, `PHPDBG_METHOD`, `PHPDBG_LINENO` and
`PHPDBG_FUNC` has been to be passed as first argument to `phpdbg_break`.
However, this functions is replaced as of PHP 5.6.3 by
`phpdbg_break_file`, `phpdbg_break_method` and 'phpdbg_break_func`,
respectively.  Therefore, we're finally removing the useless constants.
2018-06-25 11:42:54 +02:00
Thomas Punt
31914a827e Merge branch 'PHP-7.2'
* PHP-7.2:
  Allocate default ini values into persistent memory
2018-04-26 21:09:34 +01:00
Thomas Punt
972c4869a7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Allocate default ini values into persistent memory
2018-04-26 21:09:08 +01:00
Thomas Punt
2513da4b4c Allocate default ini values into persistent memory 2018-04-26 21:08:19 +01:00
Thomas Punt
d08f1c5f5b Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix memory leak when phpdbg fails to start up
2018-04-26 16:44:02 +01:00
Thomas Punt
b3fff5fc41 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix memory leak when phpdbg fails to start up
2018-04-26 16:42:21 +01:00
Thomas Punt
435e812c09 Fix memory leak when phpdbg fails to start up 2018-04-26 16:39:52 +01:00
Gabriel Caruso
8034fdc9d9 Use int instead of integer in proto 2018-02-02 22:32:15 +01:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
a7b6812ae6 Fixed stream handler override 2017-12-14 23:55:57 +03:00
Dmitry Stogov
83e495e0fd Move constants into read-only data segment 2017-12-14 22:14:36 +03:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
b59c9fb45b Added exceptions for ZEND_RC_DEBUG 2017-11-02 14:13:28 +03:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Joe Watkins
8c238c15bc
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug 74913 redirecting incorrect include <sys/poll.h>
2017-07-17 06:52:43 +01:00
Joe Watkins
2e82ed9b73
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug 74913 redirecting incorrect include <sys/poll.h>
2017-07-17 06:51:47 +01:00
Peter Kokot
0db20a7cb1
Fixed bug 74913 redirecting incorrect include <sys/poll.h> 2017-07-17 06:50:59 +01:00
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01:00
Joe Watkins
c564924d31
Revert "fix crash in phpdbg shutdown process when opcache is loaded"
This reverts commit 008fb28eaf.
2017-02-27 19:21:10 +00:00
Joe Watkins
61ecad0f53
Merge branch 'PHP-7.1'
* PHP-7.1:
  fix crash in phpdbg shutdown process when opcache is loaded
2017-02-27 17:55:31 +00:00