Skip to content

SimpleXMLElement with stream_wrapper_register can segfault #12929

Closed

Description

@mvorisek

Description

repro: https://3v4l.org/sR5ZB

inspired by #12926 and https://github.com/php/php-src/pull/12546/files

SimpleXMLIterator , SodiumException, IntlChar have the same issue

because of https://github.com/php/php-src/blob/php-8.3.0/run-tests.php#L2077 the run-tests.php test should be improved to allow to specify something like * in EXTENSIONS section, as currently the https://github.com/php/php-src/pull/12546/files is not really tested with all ext

PHP Version

8.1.0 - 8.1.7, 8.3.0

Operating System

any

Activity

  1. ndossche commented on Dec 11, 2023

    @ndossche
    Member

    Can confirm, at least for SimpleXML it's because in 8.3 I added the invalidation code which accesses node->doc but apparently node can be NULL after GET_NODE because that macro doesn't perform the return...
    The locations of GET_NODE have to be checked on 8.2+.

  2. ndossche commented on Dec 12, 2023

    @ndossche
    Member

    SodiumException, IntlChar have the same issue

    I can't reproduce it for these two classes though, not on my local machine and not in 3v4l...

    Anyway PR is up to fix SimpleXML.

  3. mvorisek commented on Dec 12, 2023

    @mvorisek
    ContributorAuthor

    SodiumException, IntlChar have the same issue

    I can't reproduce it for these two classes though, not on my local machine and not in 3v4l...

    3v4l repro: https://3v4l.org/pDpKO

  4. ndossche commented on Dec 12, 2023

    @ndossche
    Member

    3v4l repro: https://3v4l.org/pDpKO

    But that doesn't segfault/crash right? https://3v4l.org/shafO I added a var_dump at the end and it prints, I don't see a code 139.

  5. mvorisek commented on Dec 12, 2023

    @mvorisek
    ContributorAuthor

    I can confirm this is present for the XML classes only, at least today :)

  6. added a commit that references this issue on Dec 17, 2023
    f75931a
  7. added a commit that references this issue on Dec 17, 2023
    61b7370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions