Skip to content

Assertion failure when getUnicodeHost() returns empty string #20771

Closed

Description

@chongwick

Description

The following code:

<?php
$v_1030 = 'https://🐘.com/🐘?🐘=🐘';
$v_1019 = Uri\Rfc3986\Uri::parse($v_1030,);
$v_7406 = 'test://';
$v_7408 = 'http://soapinterop.org/';
$v_7410 = 1;
$v_7412 = 0;
$v_7404 = array('location' => $v_7406,'uri' => $v_7408,'trace' => $v_7410,'exceptions' => $v_7412,);
$v_1020 = var_dump($v_7404,);
$v_1021 = array();
$v_7422 = 'soapaction';
$v_7403 = NULL;
$v_7413 = new SoapClient($v_7403,$v_7404,);$v_7427 = $v_7413->__getlastrequest();
$v_1033 = var_dump($v_7427,);
$v_1024 = Uri\WhatWg\Url::parse($v_7406,$v_1033,);$v_1036 = $v_1024->getUnicodeHost();
$v_1019 = Uri\Rfc3986\Uri::parse($v_7412,);
$v_1024 = Uri\WhatWg\Url::parse($v_7422,$v_1036,$v_1019,);

Resulted in this output:

array(4) {
  ["location"]=>
  string(7) "test://"
  ["uri"]=>
  string(23) "http://soapinterop.org/"
  ["trace"]=>
  int(1)
  ["exceptions"]=>
  int(0)
}
NULL

Fatal error: Uncaught TypeError: Uri\WhatWg\Url::parse(): Argument #2 ($baseUrl) must be of type ?Uri\WhatWg\Url, string given in /home/w023dtc/TreeFuzz/scripts/trash/66e015245aebc8f01238.php.er:17
Stack trace:
#0 /home/w023dtc/TreeFuzz/scripts/trash/66e015245aebc8f01238.php.er(17): Uri\WhatWg\Url::parse('soapaction', '', Object(Uri\Rfc3986\Uri))
#1 {main}
  thrown in /home/w023dtc/TreeFuzz/scripts/trash/66e015245aebc8f01238.php.er on line 17
php: /home/w023dtc/nightly_php/php-src/Zend/zend_variables.c:64: void zend_string_destroy(zend_string *): Assertion `!(zval_gc_flags((str)->gc.u.type_info) & (1<<6))' failed.
Aborted (core dumped)

PHP Version

nightly

Operating System

22.04

Activity

  1. ndossche commented on Dec 23, 2025

    @ndossche
    Member

    Fails the assertion that it's not interned, scary. Let's see...

  2. self-assigned this
    on Dec 23, 2025
  3. ndossche commented on Dec 23, 2025

    @ndossche
    Member

    Reduction:

    <?php
    $uri = Uri\WhatWg\Url::parse('test://');
    $uri->getUnicodeHost();
  4. changed the title [-]uri segv[/-] [+]Assertion failure when getUnicodeHost() returns empty string[/+] on Dec 23, 2025
  5. added a commit that references this issue on Dec 23, 2025
    20fe817
  6. added 2 commits that reference this issue on Dec 23, 2025
    341d2d1
    13d63d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions