summaryrefslogtreecommitdiff
path: root/sapi/phpdbg
Commit message (Collapse)AuthorAgeFilesLines
* Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-162-12/+10
| | | | | This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS.
* Reference dynamic functions through dynamic_defsNikita Popov2021-03-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, dynamically declared functions and closures are inserted into the function table under a runtime definition key, and then later possibly renamed. When opcache is not used and a file containing a closure is repeatedly included, this leads to a very large memory leak, as the no longer needed closure declarations will never be freed (https://bugs.php.net/bug.php?id=76982). With this patch, dynamic functions are instead stored in a dynamic_func_defs member on the op_array, which opcodes reference by index. When the parent op_array is destroyed, the dynamic_func_defs it contains are also destroyed (unless they are stilled used elsewhere, e.g. because they have been bound, or are used by a live closure). This resolves the fundamental part of the leak, though doesn't completely fix it yet due to some arena allocations. The main non-obvious change here is to static variable handling: We can't destroy static_variables_ptr in destroy_op_array, as e.g. that would clear the static variables in a dynamic function when the op_array containing it is destroyed. Static variable destruction is separated out for this reason (we already do static variable destruction separately for normal functions, so we only need to handle main scripts). Closes GH-5595.
* Improve SPL directory and stat() cache using zend_srting* instead of char*Dmitry Stogov2021-02-261-4/+4
|
* Merge branch 'PHP-8.0'Nikita Popov2021-02-241-0/+1
|\ | | | | | | | | | | | | * PHP-8.0: Fix potential file collision in dom tests Fix bug #80757 (Exit code is 0 when could not open file) Update NEWS
| * Merge branch 'PHP-7.4' into PHP-8.0Felipe Pena2021-02-241-0/+1
| |\
| | * Fix bug #80757 (Exit code is 0 when could not open file)Felipe Pena2021-02-241-0/+1
| | |
* | | Improve class entry generationMáté Kocsis2021-02-161-1/+0
| | | | | | | | | | | | Related to GH-6701
* | | Enable class entry generation for sapi extensionsMáté Kocsis2021-02-142-2/+3
| | |
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-021-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Update year to 2021
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-021-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Update year to 2021
| | * Update year to 2021Peter Kokot2021-02-021-1/+1
| | | | | | | | | | | | Closes GH-6636.
| | * Revert "Fix #76813: Access violation near NULL on source operand"Christoph M. Becker2021-01-113-21/+3
| | | | | | | | | | | | | | | This reverts commit 5e15c9c41f8318a8392c2e2c78544f218736549c, since re2c default rules are only available as of re2c 0.13.7.
* | | Remove unused mmap member in phpdbg_file_sourceNikita Popov2021-01-261-3/+0
| | |
* | | Replace zend_bool uses with boolNikita Popov2021-01-1523-82/+82
| | | | | | | | | | | | | | | | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-01-113-21/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Revert fix for bug 76813 and re2c version bump
| * | Revert fix for bug 76813 and re2c version bumpChristoph M. Becker2021-01-113-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CentOS 7 ships with re2c 0.13.5 by default, so we should not have bumped the required re2c version to 0.13.7. However, 0.13.5 does not support default rules, so we cannot use them to fix bug 76813. This reverts commit 420184ad529443182c9a348a55b1c9216005c613 and 5e15c9c41f8318a8392c2e2c78544f218736549c. Closes GH-6593.
* | | Restrict allowed usages of $GLOBALSNikita Popov2021-01-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This restricts allowed usage of $GLOBALS, with the effect that plain PHP arrays can no longer contain INDIRECT elements. RFC: https://wiki.php.net/rfc/restrict_globals_usage Closes GH-6487.
* | | Ensure consistent error message in phpdbg parserNikita Popov2020-12-022-3/+4
| | | | | | | | | | | | | | | | | | This would be either $end or "end of file" depending on bison version. Explicitly specify "end of command" instead, which seems more appropriate in context.
* | | Add const modifier for zend_extension memberscodinghuang2020-12-011-5/+4
|/ / | | | | | | Closes GH-6462.
* | Drop all JIT related XFAILS from phpdbg test suiteChristoph M. Becker2020-11-3019-93/+0
| | | | | | | | phpdbg now disables JIT, so these cause XFAIL warnings.
* | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2020-11-303-3/+21
|\ \ | |/ | | | | | | * PHP-7.4: Fix #76813: Access violation near NULL on source operand
| * Fix #76813: Access violation near NULL on source operandChristoph M. Becker2020-11-303-3/+21
| | | | | | | | | | | | | | | | | | | | We avoid `YYCURSOR` becoming `NULL` by initializing `YYMARKER`, and add a default rule for `<NORMAL>` where we catch unexpected input. We also fix the only superficially related issue regarding empty input followed by `T_SEPARATOR` and command, which caused another segfault. Closes GH-6464.
* | Consolidate the usage of "either" and "one of" in error messagesMáté Kocsis2020-09-201-1/+1
| | | | | | | | Closes GH-6173
* | Remove support for EXT_NOPNikita Popov2020-09-181-1/+2
| | | | | | | | | | | | This is an annoying edge case that regularly gets broken. As we're not aware of significant users of this API, and there are other ways to hook this, remove support for EXT_NOP.
* | Simplify error type filtertwosee2020-09-101-25/+18
| | | | | | | | Closes GH-6049.
* | Adjust assignment line number for matchIlija Tovilo2020-09-084-0/+128
| | | | | | | | | | | | | | | | Otherwise the assignment will have the same number as the default arm which will 1. mis-trigger a breakpoint and 2. mark the line as covered even when it isn't. Closes GH-6083
* | Accept zend_string instead of zval in zend_compile_stringNikita Popov2020-09-074-22/+11
| |
* | Disable report_zend_debug by defaultNikita Popov2020-08-121-12/+1
| | | | | | | | | | | | We might just want to drop this completely, but at least don't enable it by default. It already gets disabled by a number of SAPIs, but we should make that the default state.
* | Fixed bug #62294Nikita Popov2020-08-101-1/+0
| | | | | | | | | | | | | | The primary issue was already resolved in 7c3e487289ec41e560cf7a77e36eb43da2234f33, but the particular example used in this bug report ran into an additional issue on PHP 8, because I forgot to drop a number of zend_bailout calls when switch require failure to throw.
* | Accept zend_object* in zend_update_propertyNikita Popov2020-08-071-3/+2
| |
* | Accept zend_object* in zend_get_exception_baseNikita Popov2020-08-071-11/+8
| |
* | Accept zend_object in zend_read_propertyNikita Popov2020-08-071-6/+6
| |
* | Add more argument types to stubsMáté Kocsis2020-08-071-3/+1
| | | | | | | | Closes GH-5943
* | Disable JIT for PHPDBGDmitry Stogov2020-07-211-0/+12
| |
* | Remove no_separation flagNikita Popov2020-07-071-1/+0
| |
* | Remove proto comments from C filesMax Semenik2020-07-061-16/+12
| | | | | | | | Closes GH-5758
* | Use zend_string_equals API in a couple placesNikita Popov2020-07-031-1/+1
| |
* | Make exit() unwind properlyNikita Popov2020-06-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | exit() is now internally implemented by throwing an exception, performing a normal stack unwind and a clean shutdown. This ensures that no persistent resource leaks occur. The exception is internal, cannot be caught and does not result in the execution of finally blocks. This may be relaxed in the future. Closes GH-5768.
* | Mark phpdbg test as XFAIL on Windows with JIT enabledChristoph M. Becker2020-06-241-0/+6
| | | | | | | | The test fails as of commit 8b12ea04ee405f746ca2394672f8372c57fd05b2.
* | Include stub hash in generated arginfo filesNikita Popov2020-06-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The hash is used to check whether the arginfo file needs to be regenerated. PHP-Parser will only be downloaded if this is actually necessary. This ensures that release artifacts will never try to regenerate stubs and thus fetch PHP-Parser, as long as you do not modify any files. Closes GH-5739.
* | Remove unnecessary initialization in phpdbg webhelperNikita Popov2020-06-231-1/+1
| | | | | | | | | | This whole code is very dubious and should possibly be dropped. For now just fix the build warning.
* | Fix Haiku buildDavid Carlier2020-06-191-0/+3
| | | | | | | | | | | | getrusage supports only two fields. The network api sits in the network lib. Closes GH-5732.
* | Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)Christoph M. Becker2020-06-161-2/+2
| | | | | | | | | | | | | | | | | | Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce `ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)` to mark unreachable code does no longer trigger C4715[1] warnings in debug builds. This may be useful for other compilers as well. [1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>
* | Add zend_call_known_function() API familyNikita Popov2020-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the following APIs: void zend_call_known_function( zend_function *fn, zend_object *object, zend_class_entry *called_scope, zval *retval_ptr, int param_count, zval *params); void zend_call_known_instance_method( zend_function *fn, zend_object *object, zval *retval_ptr, int param_count, zval *params); void zend_call_known_instance_method_with_0_params( zend_function *fn, zend_object *object, zval *retval_ptr); void zend_call_known_instance_method_with_1_params( zend_function *fn, zend_object *object, zval *retval_ptr, zval *param); void zend_call_known_instance_method_with_2_params( zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2); These are used to perform a call if you already have the zend_function you want to call. zend_call_known_function() is the base API, the rest are just really thin wrappers around it for the common case of instance method calls. Closes GH-5692.
* | Constify char * arguments of APIstwosee2020-06-085-23/+17
| | | | | | | | Closes GH-5676.
* | Fix MSVC level 1 (severe) warningsChristoph M. Becker2020-06-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We fix (hopefully) all instances of: * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312> `zend_llist_add_element()` and `zend_llist_prepend_element()` now explicitly expect a *const* pointer. We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress C4090; this should prevent accidential removal of the cast by clarifying the intention, and makes it easier to remove the casts if the issue[1] will be resolved sometime. [1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
* | Fix phpdbg watchpoints wrt. negative_array_index RFCChristoph M. Becker2020-06-051-3/+5
| | | | | | | | | | | | | | | | The implementation of that RFC changed the initial value of `zend_array.nNextFreeElement` to `-1`; we work around that by inserting first, and retrieving the index afterwards. We also fix the erroneous printf specifier for the unsigned integer.
* | Fix typo in skipif sectionNikita Popov2020-06-031-0/+1
| | | | | | | | Merge mistake...
* | Merge branch 'PHP-7.4'Nikita Popov2020-06-031-1/+3
|\ \ | |/ | | | | | | * PHP-7.4: Skip new watch point test under asan
| * Skip new watch point test under asanNikita Popov2020-06-031-0/+6
| |