5

As of yesterday (perhaps after a recent PHP update?), I'm getting some very strange non-deterministic bugs in php 5.3.3. These appear in our production server in PHP 5.3.2 as well.

The errors essentially amount to Fatal error: Uncaught exception 'ErrorException' with message 'Attempt to assign property of non-object' in various parts of the code base. Generally, the error line is something like: $this->foo = $bar in a __construct() call.

$this is not found in the constructor?!

I have no idea what is going on. Any ideas? Is this possibly a regression of this bug?: http://bugs.php.net/31525

Edit: I should mention, refreshing the script after a little while, with absolutely no changes to the code, makes it work again. Hence non-deterministic.

Edit 2: Furthermore, while PHP is set to log even the tiniest of errors, and is logging other errors as they occur, this error is not logged in the log file. This brings me to think we are looking at a PHP engine dependency error.

j0k
  • 22,600
  • 28
  • 79
  • 90
Karan
  • 1,636
  • 4
  • 19
  • 35
  • On my local box, there isn't any: http://pastie.org/pastes/1300493/text?key=79mmr7dmm10qi4cvy6kvg – Karan Nov 15 '10 at 19:55
  • Show the constructor... Actually, show the whole class if you can... Does it always happen on the same class? Or does the error wander? Do you have full back-traces to be sure the error isn't being triggered on another line, but displaying there (like inside of a magic-method perhaps)? – ircmaxell Nov 15 '10 at 20:03
  • The error started happening in various places as of this morning, but it consistently occurs here: http://pastie.org/private/93cnqeowtwzawudurgrg9g – Karan Nov 15 '10 at 20:07

1 Answers1

4

Well, it looks to be a bug...

Here's some relevant bug reports:

ircmaxell
  • 163,128
  • 34
  • 264
  • 314
  • Yep, this confirms my suspicions. We're going to install the latest snapshot of 5.3.x, and will post our progress here. Thanks for the answer! – Karan Nov 15 '10 at 20:42
  • Out of curiosity, what platform are you on (32-bit x86? or 64-bit x64)? – ircmaxell Nov 15 '10 at 20:46
  • Linux karan-desktop 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:36:48 UTC 2010 i686 GNU/Linux (32 bit) and the production server is running 64 bit (Linux cyphontech 2.6.32-25-server #45-Ubuntu SMP Sat Oct 16 20:06:58 UTC 2010 x86_64 GNU/Linux) – Karan Nov 15 '10 at 20:49
  • That's interesting since the second bug suggests it's a 64 bit issue. I'd suggest trying the snapshot. Either way (if it works or does not) post a reply to one of the bugs with the associated info (I'd suggest `50027`), and then a reply to the other indicating that they are likely related issues... – ircmaxell Nov 15 '10 at 20:55
  • Will do, snapshot is currently compiling. – Karan Nov 15 '10 at 21:28
  • Just an update, we have updated to php 5.3.4-dev, compiling from the snapshot. Note, the build forces the php.ini file to be in /usr/local/lib for some reason – Karan Nov 16 '10 at 01:34