Bug #75710 [Com]: single-char vars get lost
Edit report at https://bugs.php.net/bug.php?id=75710&edit=1
ID: 75710
Comment by: benjamin dot zikarsky at jaumo dot com
Reported by: benjamin dot roth at jaumo dot com
Summary: single-char vars get lost
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Ubuntu
PHP Version: 7.1.12
Block user comment: N
Private report: N
New Comment:
We triggered this bug again today. Now on PHP 7.2.4.
Many long-running processes (to be more specific: Gearman worker running an Amp-loop) started
throwing exceptions: "Undefined variable: m" in this source-file: https://github.com/aws/aws-sdk-php/blob/master/src/Api/Serializer/RestSerializer.php#L112
This source-file is obviously completely unrelated to Amp or our custom codebase. Also it can be
assumed to be rather battletested as it is part of the AWS SDK for PHP.
We are reasonable sure that the same process ran through the same function multiple times before the
error without throwing the exception.
Previous Comments:
------------------------------------------------------------------------
[2018-04-08 19:10:52] benjamin dot roth at jaumo dot com
If a $var is 'null' one line after its creation. How could that be caused by _any_
userland code?
------------------------------------------------------------------------
[2018-04-07 22:14:34] cmb@php.net
> Our observations have been made when serving PHP requests with
> amp/aerys.
Would it be possible that the strange behavior is caused by
amphp/aerys in the first place?
------------------------------------------------------------------------
[2017-12-20 08:18:20] benjamin dot roth at jaumo dot com
Description:
------------
1. I am not 100% if I got the right category for that.
2. I was NOT able to reproduce that intentionally but we obsorved that many, many times in
production.
3. This only happens in long-running PHP environments. It does NOT happen with PHPFPM as every
request creates a separate PHP runtime. Our observations have been made when serving PHP requests
with amp/aerys.
4. It does not happen in EVERY long-running process, but WHEN it happens, the current process is
affected until it dies
Symptom:
Single-char vars are instantly dropped / unset.
E.g.
----
$f = new Foo();
$f->bar();
----
Results in
----
[E_NOTICE] Undefined variable: f
----
and
----
Call to a member function bar() on null
----
This does never happen when using variable names with a couple of chars. I didn't find out the
exact limit, but as of now I have only seen single-char-vars in logs.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75710&edit=1
Thread (7 messages)