1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

6472 Commits

Author SHA1 Message Date
Christoph M. Becker
26bf239e6d Resolve -Wincompatible-pointer-types warnings (GH-17456)
The phpdbg issue is a real issue, although it's unlikely that harm can
be done due to stack alignment and little-endianess.  The others seem
to be more cosmetic.
2025-01-13 10:54:13 +01:00
Gina Peter Banyard
e2e7b46542 sapi/phpdbg: Grab the function pointer directly
Allocating a string zval to let zend_call_function() do the same thing is slightly pointless
2025-01-06 20:17:25 +00:00
Niels Dossche
a58c6d56bb Make docs consistent with help text 2025-01-06 20:17:25 +00:00
Niels Dossche
8cb15f6203 Fix crashes in function registration + test
Internal function won't need their refcount increased as they outlive
the debugger session, and userland functions won't be unloaded either.
So no refcount management is necessary for registered functions.
2025-01-06 20:17:25 +00:00
Niels Dossche
65524e5d53 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17208: bug64539-status-json-encoding.phpt fail on 32-bits
2024-12-27 21:48:58 +01:00
Niels Dossche
2161959834 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17208: bug64539-status-json-encoding.phpt fail on 32-bits
2024-12-27 21:48:52 +01:00
Niels Dossche
847d1401a0 Fix GH-17208: bug64539-status-json-encoding.phpt fail on 32-bits
The reason this breaks is because of a type mismatch.
The following line uses fields of the timeval struct which are both 8 bytes on
Alpine 32-bit, which results in a computed value of also 8 bytes:
b09ed9a0f2/sapi/fpm/fpm/fpm_status.c (L611)

However, it is passed to a format string which expects 4 bytes
(`unsigned long` and thus the `%lu` format specifier is 4 bytes on Alpine 32-bit),
resulting in argument corruption.
Since the value is generally small, truncating to 4 bytes is sufficient to fix this.

Closes GH-17286.
2024-12-27 21:48:15 +01:00
Niels Dossche
48b37fe384 Merge branch 'PHP-8.4'
* PHP-8.4:
  [ci skip] Make build command for program using embed portable
2024-12-24 14:38:20 +01:00
Niels Dossche
ce322fd1f3 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [ci skip] Make build command for program using embed portable
2024-12-24 14:38:13 +01:00
Kévin Dunglas
a24eada99b [ci skip] Make build command for program using embed portable
Closes GH-17247.
2024-12-24 14:37:44 +01:00
Christoph M. Becker
f6469054dc Merge branch 'PHP-8.4'
* PHP-8.4:
  Include relevant system headers before defining fallbacks
2024-12-22 16:30:45 +01:00
Christoph M. Becker
0285e9a868 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Include relevant system headers before defining fallbacks
2024-12-22 16:30:04 +01:00
Christoph M. Becker
fcbfd5a680 Include relevant system headers before defining fallbacks
Otherwise we may define the fallbacks, and later inclusion of the
system headers may attempt to redefine those.

Fixes GH-17112.
Closes GH-17129.
2024-12-22 16:27:01 +01:00
Jakub Zelenka
0aeac68063 Merge branch 'PHP-8.4' 2024-12-22 14:58:36 +01:00
Jakub Zelenka
c4c536da4c Merge branch 'PHP-8.3' into PHP-8.4 2024-12-22 14:58:08 +01:00
Jakub Zelenka
e0b79cdc5c Introduce FPM_TEST_DEBUG_FILTER env var and extend multi request tracing 2024-12-22 14:15:03 +01:00
Tim Düsterhus
3fea6468fe phpdbg: Call enums “Enum” and traits “Trait” in info classes (#17191)
* phpdbg: Call enums “Enum” in `info classes`

* phpdbg: Call traits “Trait” in `info classes`
2024-12-17 19:32:47 +01:00
Gina Peter Banyard
d21777d4a2 sapi/cli: Refactor process title setting code (#17177) 2024-12-16 22:50:06 +00:00
Jakub Zelenka
7bfd19880f Merge branch 'PHP-8.4' 2024-12-14 15:01:55 +01:00
Jakub Zelenka
0cc0c7c7d9 Merge branch 'PHP-8.3' into PHP-8.4 2024-12-14 15:01:17 +01:00
Jakub Zelenka
3490ac0cb3 Fix GH-13437: FPM: ERROR: scoreboard: failed to lock (already locked)
This changes locking for scoreboard to reduce contention between readers
and adds retries for acquiring scoreboard for read.

Closes GH-15805
2024-12-14 14:59:56 +01:00
Christoph M. Becker
a7cf0725d8 Skip sapi_windows_set_ctrl_handler.phpt under ASan
For some reason, terminating the child process by sending CTRL+C won't
work under ASan instrumentation.  Since termination via CTRL+BREAK
works, there is apparently nothing fundamentally wrong, so we just
skip the test.

Closes GH-17086.
2024-12-13 14:29:40 +01:00
Jakub Zelenka
f953bd983e Merge branch 'PHP-8.4' 2024-11-28 09:03:12 +01:00
Jakub Zelenka
d165670d04 Fix GH-16932: wrong FPM status output
Closes GH-16974

Co-authored-by: James Lucas <james@lucas.net.au>
2024-11-28 08:59:55 +01:00
Niels Dossche
c2a6a7da7b Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-15208: Segfault with breakpoint map and phpdbg_clear()
2024-11-26 22:27:40 +01:00
Niels Dossche
5ff67f8720 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-15208: Segfault with breakpoint map and phpdbg_clear()
2024-11-26 22:27:35 +01:00
Niels Dossche
3c3ec0e61a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15208: Segfault with breakpoint map and phpdbg_clear()
2024-11-26 22:27:06 +01:00
Niels Dossche
97b03186c4 Fix GH-15208: Segfault with breakpoint map and phpdbg_clear()
It crashes because it's gonna try accessing the breakpoint which was cleared
by user code in `phpdbg_clear();`. Not all breakpoint data was properly
cleaned.

Closes GH-16953.
2024-11-26 22:26:37 +01:00
Jakub Zelenka
4b211a7769 Merge branch 'PHP-8.4' 2024-11-20 11:14:32 +01:00
Jakub Zelenka
7c96af42b7 Merge branch 'PHP-8.3' into PHP-8.4 2024-11-20 11:14:04 +01:00
Jakub Zelenka
ffff27f734 Merge branch 'PHP-8.2' into PHP-8.3 2024-11-20 11:12:19 +01:00
Niels Dossche
f18d429b20 Fix GHSA-4w77-75f9-2c8w 2024-11-20 11:07:28 +01:00
Jakub Zelenka
84400eefbb Merge branch 'PHP-8.4' 2024-11-08 16:51:19 +01:00
Jakub Zelenka
49bc011c9f Merge branch 'PHP-8.3' into PHP-8.4 2024-11-08 16:50:41 +01:00
Jakub Zelenka
af8ebb12ca Merge branch 'PHP-8.2' into PHP-8.3 2024-11-08 16:48:25 +01:00
Jakub Zelenka
065bde1e13 Fix GH-16432: PHP-FPM 8.2 SIGSEGV in fpm_get_status 2024-11-08 16:44:05 +01:00
Niels Dossche
228c27112a Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix test with shared zend_test (#16705)
2024-11-05 21:36:54 +01:00
Niels Dossche
2f5021b6bd Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix test with shared zend_test (#16705)
2024-11-05 21:36:48 +01:00
Niels Dossche
9a255b384f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix test with shared zend_test (#16705)
2024-11-05 21:36:41 +01:00
Niels Dossche
3f1ea1b663 Fix test with shared zend_test (#16705) 2024-11-05 21:35:47 +01:00
Ilija Tovilo
0ad6e4efb0 [skip ci] Document --repeat flag as internal (GH-16698)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-11-04 17:40:08 +01:00
Niels Dossche
64f2d11e38 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16628: FPM logs are getting corrupted with this log statement
  Fix GH-16601: Memory leak in Reflection constructors
2024-11-02 19:39:00 +01:00
Niels Dossche
bfd9e0cca3 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16628: FPM logs are getting corrupted with this log statement
  Fix GH-16601: Memory leak in Reflection constructors
2024-11-02 19:38:54 +01:00
Niels Dossche
16cda10650 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16628: FPM logs are getting corrupted with this log statement
  Fix GH-16601: Memory leak in Reflection constructors
2024-11-02 19:37:28 +01:00
Niels Dossche
e643129bbb Fix GH-16628: FPM logs are getting corrupted with this log statement
zlog_buf_prefix() can return a larger length than what actually was
written due to its use of snprintf(). The code in
zlog_stream_prefix_ex() does not take this into account, other callers
do. What ends up happening then is that stream->length is set to the
length as if snprintf() was able to write all bytes, causing
stream->length to become larger than stream->buf.size, causing a
segfault.

In case the buffer was too small we try with a larger buffer up to a
limit of zlog_limit. This makes sure that the stream length will remain
bounded by the buffer size.

This also adds assertions to make the programmer intent clear and catch
this more easily in debug builds.

Closes GH-16680.
2024-11-02 19:36:20 +01:00
Gina Peter Banyard
6ddab74d55 sapi: Fix some variable shadowing (#16485)
sapi_module, mime_type_map, zend_extensions, php_cgi_globals, and phpdbg_globals are true globals which are being shadowed
2024-10-17 22:46:23 +01:00
Ilija Tovilo
0f172715b0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Skip shebang in cli-server router script
2024-10-14 13:35:48 +02:00
Ilija Tovilo
3074cbf5b6 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Skip shebang in cli-server router script
2024-10-14 13:35:41 +02:00
Ilija Tovilo
77f770871b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Skip shebang in cli-server router script
2024-10-14 13:34:21 +02:00
Ilija Tovilo
06efe44c2e Skip shebang in cli-server router script
Fixes GH-16373
Closes GH-16403
2024-10-14 13:33:16 +02:00