Skip to content

Property hooks #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 28 commits into from
Closed

Property hooks #122

wants to merge 28 commits into from

Conversation

iluuu1994
Copy link
Owner

No description provided.

nielsdos and others added 13 commits February 13, 2024 21:11
* Update libmagic to 5.45

This also cleans up magicdata.patch: changes that are already in upstream file
were removed from that patch file.

There are five (expected) test output changes.
All these were also checked with the file command.

  - bug77961.phpt changes because there's now an early error-return in the
    `if (ts == FILE_BADSIZE) {` branch.
  - cve-2014-1943.phpt and cve-2014-1943-mb.phpt change because now the crafted
    data is recognised as a simh file.
  - bug71434.phpt now properly recognises it as a Python file.
  - ext/fileinfo/tests/finfo_file_basic.phpt more specific mime type.

* Adjust memory requirement for s390x fileinfo run

The larger database causes a higher memory usage.
Similar to 962c082.

* [ci skip] NEWS
Credits to ranvis for finding the upstream commit that fixes the issue.

This backports file/file@029b824

Closes phpGH-13370.
* PHP-8.2:
  Fix phpGH-13344: finfo::buffer(): Failed identify data 0:(null)
* PHP-8.3:
  Fix phpGH-13344: finfo::buffer(): Failed identify data 0:(null)
On shutdown in ZTS the following happens:
- https://github.com/php/php-src/blob/master/Zend/zend.c#L1124-L1125
  gets executed. This destroys global persistent resources and destroys
  the modules. Furthermore, the modules are unloaded too.
- Further down, `ts_free_id(executor_globals_id)` gets executed, which
  calls `executor_globals_dtor`. This function destroys persistent
  resources for each thread.

Notice that in the last step, the modules that the persistent resource
belong to may already have been destroyed. This means that accessing
globals will cause a crash (I previously fixed this with ifdef magic),
or when the module is dynamically loaded we'll try jumping to a
destructor that is no longer loaded in memory. These scenarios cause
crashes.

It's not possible to move the `ts_free_id` call upwards, because that
may break assumptions of callers, and furthermore this would deallocate
the executor globals structure, which means that any access to those
will cause a segfault.

This patch adds a new API to the TSRM that allows running a callback on
a certain resource type. We use this API to destroy the persistent
resources in all threads prior to the module destruction, and keep the
rest of the resource dtor intact.

I verified this fix on Apache with postgres, both dynamically and
statically.

Fixes phpGH-12974.
_zend_ssa_pid::has_range_constraint being the only bool, the bitfield would not bring
any benefit.
Following 68f6ab7, the ext/curl doesn't
need to be linked against OpenSSL anymore, if curl_version_info_data
ssl_version is OpenSSL/1.1 or later.

With OpenSSL 3 and later the check for old SSL crypto locking callbacks
was detected here.

This also uses a common PHP_SETUP_OPENSSL macro for checking OpenSSL and
syncs the minimum OpenSSL version (currently 1.0.2 or later) across the
PHP build system.
The siginfo_t is defined by including the signal.h. Some systems include
the siginfo.h in the signal.h. Including it separately is obsolete on
current systems.
IR commit: f7c0ddb1b4630e1287b0239f85d64a6965dfea29
The struct flock is defined in fcntl.h, if system has it. This removes
redundant PHP_STRUCT_FLOCK M4 macro in favor of the AC_CHECK_TYPES,
which by default defines symbol HAVE_STRUCT_FLOCK.
libmagic 5.45 has a regression on 32-bit that is fixed in current HEAD,
but that's not released yet. Pull in the upstream fix [1].

[1] file/file@218fdf8
@ghost
Copy link

ghost commented Feb 15, 2024

Hello my dear friend. How is our new feature doing? The last comment in the discussion on https://externals.io/message/120213 is 7 months old. Do you think this will get accepted before feature freeze that starts in 5 months?

@iluuu1994
Copy link
Owner Author

Working on it.

arnaud-lb and others added 8 commits February 16, 2024 13:02
* PHP-8.3:
  [ci skip] Adding myself as reviewer
  [ci skip] Adding myself as reviewer
Instead of the project macro, the sockaddr_storage and sockaddr.sa_len
can be checked with the AC_CHECK_TYPES and AC_CHECK_MEMBERS by including
the sys/socket.h. Some systems (~1988) didn't include the sys/types.h in
the socket.h (obsolete on current systems).

These macros by default define the HAVE_STRUCT_SOCKADDR_STORAGE and
HAVE_STRUCT_SOCKADDR_SA_LEN.
This simplifies the check. On AIX 6 and newer, the ss_family is
available, if compiled without defining COMPAT_43 (BSD 4.3
compatibility).
for threaded context, it solely uses a new api only available on
illumos.
Here using a common older api to get the stack info for the current
thread.
while at it, completing stack_limit_010 test for these platforms.
[skip ci] add entry on return type of long2ip to NEWS and to UPGRADING.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment