Code Monkey home page Code Monkey logo

hpack's People

Contributors

bwoebi avatar kelunik avatar kooldev avatar nicolas-grekas avatar trowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hpack's Issues

Http2 protocol not handled correctly, and not recognize libnghttp2.so by ffi.

Version amphp/http-client 4.6.2.
PHP Version: 8.0, 8.1

Some request from out linux server (Ubuntu 20.04) always return Amp\Http\Client\Connection\Http2ConnectionException: The HTTP/2 connection from '192.168.1.112:41306' to '****:443' closed, but from local develop machine (MacOS 13.4) always success.

After some dig, I found that reason is local machine can correct locate libnghttp2.dylib to use HPackNgHttp2, but server can't locate libnghttp2.so.

By apt, I found that libnghttp2 package is libnghttp2-14 in server, and files list:

dpkg -L libnghttp2-14
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libnghttp2.so.14.19.0
/usr/share
/usr/share/doc
/usr/share/doc/libnghttp2-14
/usr/share/doc/libnghttp2-14/AUTHORS
/usr/share/doc/libnghttp2-14/README.rst.gz
/usr/share/doc/libnghttp2-14/changelog.Debian.gz
/usr/share/doc/libnghttp2-14/copyright
/usr/lib/x86_64-linux-gnu/libnghttp2.so.14
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libnghttp2.so.14.19.0
/usr/share
/usr/share/doc
/usr/share/doc/libnghttp2-14
/usr/share/doc/libnghttp2-14/AUTHORS
/usr/share/doc/libnghttp2-14/README.rst.gz
/usr/share/doc/libnghttp2-14/changelog.Debian.gz
/usr/share/doc/libnghttp2-14/copyright
/usr/lib/x86_64-linux-gnu/libnghttp2.so.14

There is no libnghttp2.so file in server, only libnghttp2.so.14, when I change libnghttp2.so to libnghttp2.so.14 in here:

self::$ffi = FFI::cdef($header, 'libnghttp2.so');

It's worked.

There's two problem here:

  • HPackNative not correctly handle http2 protocol, makes HTTP/2 connection closed error.
  • FFI can not locate the right libnghttp2.so.* file, fallback to HPackNative.

GPT give me a answer that we can create a symbol link to real libnghttp2.so.* file or use ldconfig -p | grep 'libnghttp2.so' | awk '{print $4}' to locate it.

Memory leak when using HPackNghttp2

In my server, Ubuntu 20.04 (amd64), php 8.0.29, when using http-client with HPackNgHttp2, php process memory will getting keep increase.
But change to HPackNative, php process memory will be stable within a certain range.

But the noted is memory info from memory_get_usage() is normal, looks like memory is leaking out of php memory manager, this makes memory_get_usage() can not get real memory usage.

Is this a FFI bug? or amphp/hpack bug?

Some related links:
php/php-src#8433

Object of class FFI\CData could not be converted to bool

Object of class FFI\CData could not be converted to bool

/Users/runner/work/http-client/http-client/vendor/amphp/hpack/src/Internal/HPackNghttp2.php:149
/Users/runner/work/http-client/http-client/vendor/amphp/hpack/src/HPack.php:33
/Users/runner/work/http-client/http-client/vendor/amphp/http/src/Http2/Http2Parser.php:357
/Users/runner/work/http-client/http-client/vendor/amphp/http/src/Http2/Http2Parser.php:469
/Users/runner/work/http-client/http-client/vendor/amphp/http/src/Http2/Http2Parser.php:207
/Users/runner/work/http-client/http-client/src/Connection/Internal/Http2ConnectionProcessor.php:1274

See https://github.com/amphp/http-client/actions/runs/5870684667/job/15918232493.

Memory leaks

<?php

require __DIR__ . '/vendor/autoload.php';

(function () {
    var_dump(count(static::$huffmanLookup));
})->bindTo(new Amp\Http\HPack, Amp\Http\HPack::class)();

That code with a debug build results in the following output when run via php test.php.

php -v
PHP 7.3.0-dev (cli) (built: Mar 11 2018 15:45:34) ( NTS DEBUG )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0-dev, Copyright (c) 1999-2018, by Zend Technologies
int(256)
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(1829) :  Freeing 0x00007fe4994626c0 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 174 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe499462720 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 1376 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe499468500 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 1312 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_vm_execute.h(46844) :  Freeing 0x00007fe499482118 (24 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 193 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_execute.c(616) :  Freeing 0x00007fe499482150 (24 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 13 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe492601000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3033 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe492606000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3123 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe492607000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 2834 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(1890) :  Freeing 0x00007fe492801000 (18432 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 17 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe492806000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3327 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe49280b000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3317 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe49280c000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3263 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe492c01000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe492c06000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe492c07000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3443 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe492a01000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe492a06000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3327 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe492a07000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3359 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(1890) :  Freeing 0x00007fe493001000 (18432 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 14 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe493006000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe49300b000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3401 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe49300e000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3263 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe492e01000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe492e06000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3401 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe492e12000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3263 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe493201000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe493206000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3401 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe493207000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3327 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe493401000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe493407000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3359 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe493408000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3327 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe493601000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe493606000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3401 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe493607000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3327 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(1890) :  Freeing 0x00007fe493801000 (18432 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 14 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe493806000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3327 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe49380b000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3359 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe49380c000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 2943 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe493c01000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3519 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe493c06000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3527 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe493c07000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 2559 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe493a01000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe493a06000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3401 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe493a07000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 2559 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe493e01000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3327 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe493e06000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3317 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe493e08000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 2431 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(1890) :  Freeing 0x00007fe494001000 (18432 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 11 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe494006000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3485 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe494007000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3455 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe49400d000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 2559 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(1890) :  Freeing 0x00007fe494201000 (18432 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 16 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe494206000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3359 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe494208000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3327 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe49421e000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 1663 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe494401000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3519 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe49440b000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3527 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe494416000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 1151 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe494601000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3443 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe494604000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3391 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe4946a3000 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 831 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe494801000 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3839 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe49480b000 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3065 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(122) :  Freeing 0x00007fe494a01140 (264 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3012 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(196) :  Freeing 0x00007fe494a10060 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 3452 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_hash.c(1829) :  Freeing 0x00007fe494a10240 (56 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 80 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_vm_execute.h(46844) :  Freeing 0x00007fe494a51000 (24 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 47 times
[Mon Mar 12 15:18:47 2018]  Script:  '/home/kelunik/GitHub/amphp/hpack/test.php'
/home/kelunik/.php-build/release/Zend/zend_string.h(136) :  Freeing 0x00007fe494ad54c0 (32 bytes), script=/home/kelunik/GitHub/amphp/hpack/test.php
Last leak repeated 44 times
=== Total 177741 memory leaks detected ===

nghttp2 implementation using FFI

PHP 7.4 offers FFI, so we can build the huffman decoding using nghttp2 and FFI if both are available on the given system and otherwise fall back to our current implementation.

Uninitialized string offset access on invalid HPack data

Doing something like (new HPack)->decode("\xff", 8192) results in an "Uninitialized string offset" warning, as decodeDynamicInteger() performs unchecked indexing.

I would expect this to yield a decoding error (null return value) instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.