Skip to content

Assertion failure in ext/phar/phar.c:2808 #16406

Closed

Description

@YuanchengJiang

Description

The following code:

<?php
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
$file = '<?php __HALT_COMPILER(); ?>';
$files['b'] = 'b';
$files['c'] = 'c';
include 'files/phar_test.inc';
$phar = new Phar($fname);
$phar->compressFiles(Phar::GZ);
$phar = $phar->convertToExecutable(Phar::TAR);
$phar = $phar->convertToExecutable(Phar::PHAR, Phar::GZ);

Resulted in this output:

php-src/ext/phar/phar.c:2808: void phar_flush_ex(phar_archive_data *, zend_string *, _Bool, char **): Assertion `entry->header_offset == 0' failed.
Aborted (core dumped)

To reproduce:

-d "phar.require_hash=0" -d "phar.readonly=0"

PHP Version

nightly

Operating System

ubuntu 22.04

Activity

  1. added 4 commits that reference this issue on Oct 16, 2024
    43370dd
    6a8d0a0
    25817ad
    d8e5166
  2. added a commit that references this issue on Oct 17, 2024
    7aeafe4
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