Commit graph

672 commits

Author SHA1 Message Date
Nikita Popov
af3e2d3186 Initialize last_line in phpdbg globals 2019-07-01 16:14:45 +02:00
Nikita Popov
45ab57339e Use strcmp() in phpdbg_eol_global_update
memcmp() only makes sense on equal length strings, and here we don't
know anything about the length of the input.
2019-06-28 17:24:30 +02:00
Nikita Popov
cf29c0f212 Remove phpdbg_xml_asprintf()
Clang doesn't like the use of promoted zend_bool in va_start. As
the function isn't used anyway, I'm simply dropping it...
2019-06-28 16:59:52 +02:00
Nikita Popov
54dd762f59 Set up asan+ubsan scheduled build on azure
Also adds an --asan flag to run-tests.php to setup all the necessary
environment variables. Some tests are marked as skipped because they
are incompatible with asan or too slow.

I'm basing this on the DEBUG_ZTS build, which seems to give us the
most mileage.
2019-06-28 15:00:54 +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
8c4d199851 Fix init_file leak in phpdbg 2019-06-28 09:17:26 +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
42b22d3a94 Fix out of bounds write in phpdbg
It seems that this code has a peculiar interpretation of "len",
where it actually points to the last character, not one past it.
So we need +1 here for that extra char and another +1 for the
terminating null byte.
2019-06-25 14:28:58 +02:00
Nikita Popov
152ccfb08d Fix stack leak in phpdbg 2019-06-21 17:01:25 +02:00
Nikita Popov
a7bcfee9c9 Fix prompt leak in phpdbg 2019-06-21 17:01:18 +02:00
Nikita Popov
646b64b119 Fix skipif syntax errors
Apparently I did this only on masster...
2019-06-14 09:29:14 +02:00
Nikita Popov
852ab5d83f Use %define api.pure instead of %pure-parser
%pure-parser is deprecated. In our case there is no difference between
true & full, as we don't use locations.
2019-06-12 09:26:34 +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
Joe Watkins
9ecc0a4f29
use XFAILIF rather than XFAIL to avoid warnings [ci skip] 2019-06-11 12:55:28 +02:00
Joe Watkins
1e5004060e
watchpoints have flaws in implementation 2019-06-10 14:23:37 +02:00
Nikita Popov
a982125561 Try to fix phpdbg + opcache compatibility 2019-06-04 15:08:55 +02:00
Nikita Popov
3ba64545ed Update phpdbg oplog test 2019-05-29 17:05:01 +02:00
Joe Watkins
e11233dc49
Revert "Rename *.l files to *.re"
This reverts commit 969047749d.
2019-05-20 06:06:38 +02:00
Peter Kokot
969047749d Rename *.l files to *.re
This syncs PHP lexer files to all use *.re extension. The *.re files are
processed with the RE2C tool.
2019-05-17 23:53:03 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
1c94aac89e [ci skip] Fix CS in Markdown files
Checked and quickfixed with Markdown linter
- 80 columns line width (~)
- code highlighting
- ...

Some most obvious outdated content updated a bit more.
2019-04-21 15:33:20 +02:00
Nikita Popov
3c23084cf6 Fix strict aliasing violation in phpdbg
By explicitly computing the message length from bytes. This also
makes sure that the length is interpreted in an endianness-independent
manner.
2019-04-12 16:46:23 +02:00
Nikita Popov
c09b63595e Fix potentially uninitialized warnings in phpdbg 2019-04-12 11:46:03 +02:00
Nikita Popov
09b2e20333 Work around -Walloc-size-larger-than bug 2019-04-11 17:44:20 +02:00
Nikita Popov
d087a356fe Suppress warnings using zend_quiet_write 2019-04-11 12:22:52 +02:00
Peter Kokot
6acba73876 Add AS_HELP_STRING to phpdbg options 2019-04-07 23:24:10 +02:00
Peter Kokot
e06836a1a3 Remove checks for locale.h, setlocale, localeconv
The `<loccale.h>` header file, setlocale, and localeconv are part of the
standard C89 [1] and on current systems can be used unconditionally.

Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`,
`HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in
configure.ac [2] can be ommitted and simplifed.

The bundled libmagic (file) has also been patched already in version
5.35 and up in upstream location so when it will be patched also in
php-src the check for locale.h header is still left in the configure.ac
and in windows headers definition file.

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4

Omit the bundled libmagic files
2019-04-07 18:32:54 +02:00
Peter Kokot
5f8915786f Remove HAVE_SIGNAL_H
The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.

The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2019-04-07 15:55:34 +02:00
Matteo Beccati
15ff5db6b9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Ref #76801 remove old file source from file_sources hash in case of file included more than once
2019-04-03 14:36:20 +02:00
Matteo Beccati
9f02f9fd5c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Ref #76801 remove old file source from file_sources hash in case of file included more than once
2019-04-03 14:36:11 +02:00
Alessandro Chitolina
4029c0b6a2 Ref #76801 remove old file source from file_sources hash in case of file included more than once 2019-04-03 14:35:57 +02:00
Joe Watkins
330517987b
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix build: readline support must be disabled by default in phpdbg
2019-03-28 07:35:33 +01:00
Joe Watkins
62a652a0d5
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix build: readline support must be disabled by default in phpdbg
2019-03-28 07:35:15 +01:00
Joe Watkins
b7442f1bb8
fix build: readline support must be disabled by default in phpdbg 2019-03-28 07:34:45 +01:00
Joe Watkins
56293d0637
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77805 phpdbg build fails when readline is shared
2019-03-27 10:04:36 +01:00
Joe Watkins
eb405a2192
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77805 phpdbg build fails when readline is shared
2019-03-27 10:04:07 +01:00
Joe Watkins
7af270eb28
Fix #77805 phpdbg build fails when readline is shared 2019-03-27 10:02:42 +01:00
Joe Watkins
f177a2ac58
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  more work on phpdbg conditional breaks
2019-03-27 00:02:43 +01:00
Joe Watkins
1e4cff9ddb
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  more work on phpdbg conditional breaks
2019-03-27 00:02:31 +01:00
Joe Watkins
6d3a2b4693
more work on phpdbg conditional breaks 2019-03-27 00:02:15 +01:00
Joe Watkins
903c1e379b
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77800 phpdbg segfaults on conditional breakpoints
2019-03-26 23:06:54 +01:00
Joe Watkins
e177d26d0e
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77800 phpdbg segfaults on conditional breakpoints
2019-03-26 23:06:15 +01:00
Joe Watkins
7df8e4fc0a
Fix #77800 phpdbg segfaults on conditional breakpoints 2019-03-26 23:05:06 +01:00
Joe Watkins
994a897586
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix bug #76801: phpdbg too many open files error
2019-03-23 09:49:28 +01:00
Joe Watkins
93740a2482
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix bug #76801: phpdbg too many open files error
2019-03-23 09:48:20 +01:00
Alessandro Chitolina
b8b880932e
fix bug #76801: phpdbg too many open files error 2019-03-23 09:47:49 +01:00
Peter Kokot
864366ef20 Upgrade deprecated directives and use non-posix bison
With Bison 3.0 some directives are deprecated:
- %name-prefix "x" should be %define api.prefix {x}
- %error-verbose should be %define parse.error verbose

Bison 3.3 also started emiting more warnings and since PHP souce parsers
are not POSIX compliant this patch fixes this as pointed out via
495a46aa1d.
2019-03-19 20:29:20 +01:00