An instance of PHP being actually WTF
-
Yes, yes, I know, but I found a case where it is.
Because of the stuff I do - dealing with crappy shared hosting - I don't have a current version of PHP installed as my main installation (I do on actual servers of course but on localhost it's really not necessary)
So, my WampServer installation is still using PHP 5.3.10 since that's what it had when I installed it.
And last night weird stuff happened. I was merrily writing code and suddenly every page load was causing PHP to crash.
I don't mean my script was failing - I mean PHP was flat out crashing and nuking the Apache children to which it was bound.
After some head-scratching and some poking around, I discovered that PHP 5.3.10 has a very interesting bug.
If you try to load a PHP at any point whose filesize is an exact multiple of 4096, PHP 5.3.10 will shit itself.
And it just so happened that I had a file whose length was precisely 16384 bytes. And since it was a file included every run-time, the entire application shat itself every time I tried to refresh the page.
It has of course since been fixed but you almost have to wonder how such a thing came to be a bug - since AFAICT only the early 5.3.x releases had it.
-
TRWTF is that this has been going on for like 30 years and people haven't figured out how to stop.
No, really. The 8-bit Ataris had a bug in their BASIC that would cause a lockup or something if you inserted an amount of code that was a multiple of 256 bytes. Entertainingly (to people who didn't suffer from it) when they fixed the bug, they overzealously applied the fix to the delete-code logic...which didn't previously have the bug, but now did.
-
Ugh
-
Fortunately, reboot time was measured in single-digit seconds. Hope you saved your program (to cassette) recently, though.
-
Also, we found another place where that smiley is correct!
-
Yes, Apache rebooting is measured in seconds
-
Yes, Apache rebooting is measured in seconds
Um,
was measured
saved your program (to cassette)
I think he was referring to rebooting
The 8-bit Ataris
-
Yes, yes he was. I was being deliberately cheeky about it.
-
-
No whooosh for you!
I told him we already got one!
-
[I told him we already got one][1]!
FTFY!
Wouldn't it be awesome if there was a plugin that did this for you?
[1]: https://www.youtube.com/watch?v=1bKooUgk6N8
-
Yeah, we need a dropdown of such things that we can select from and have it add the appropriate link.
-
Yeah, we need a dropdown of such things that we can select from and have it add the appropriate link.
I once saw an ad or something about a guy who had a library of sound clips for every occasion.
If I found a magic lamp there's a good chance that would be my first wish.
-
Wow. I'll have to try that one out sometime.
I had a cool one in a PHP 4 project the other day. It only happened in production and only for me, because it only happened when a certain variable equaled true, and this variable is used to provide us with debugging information.
When I would write
include("somefile.php");
that would take 30 seconds but without the parentheses it would be as fast as I'd expect. And the difference, I'm absolutely sure about this, is in the step where PHP includes the file. It's in the execution of the include statement itself. Still no clue why this happens or how to replicate the problem.
-
Believe me, I know. Our hosting provider is thankfully scrapping all their php 4 boxes so my boss no longer has any excuse to hang onto that. Soon, no more four. SOON.
-
I still have to support PHP 1.
-
This bit me quite a while ago as well.
This fuckup in PHP's lexer is the reason why I stopped caching stuff via
var_export()
and writing it to.php
files. You get bad luck and your data is exactly 4k in size and bam, project dead.
-
Yup. Fortunately it has been fixed. I probably should update WampServer sometime.
-
switch ($yourMum / ($fileSize % 4096)) { ... }
-
lol.
my markov needs to generate the state it doesn't seem to the UI back into the Quote properly.