Zend Weekly Summaries Issue #193

July 19, 2004

Uncategorized

FIX: hash table copy
FIX: file_get_contents()
FIX: alloca() revisited
TLK: Test roll
FIX: threaded bcmath
NEW: PHP 5.0.0
NEW: PHP 4.3.8
FIX: HTTP_AUTH
TLK: Commit policy for HEAD?
NEW: Load-order dependencies
NEW: TRUE, FALSE, NULL
NEW: exslt support on win32
PAT: gd namespace collisions


FIX: hash table copy

Kamesh Jayachandran, who is trying to make PHP 5 work on netware, wrote in
several times to report some complex problems with copying a class entry to a hash
table. Nobody was entirely sure what the issue was, until Moriyoshi Koizumi asked
Kamesh to clarify the problem. It turned out that a too-large class entry was being
copied to a too-small amount of allocated memory, and that this caused a segfault on
netware, where it could not be accommodated. It was also potentially a problem on
other less forgiving platforms.

Andi Gutmans picked up on the thread, and quickly provided a fix as soon as the
issue was clear to him.

Short version: Stamina pays dividends.


FIX: file_get_contents()

Curt Zirzow’s report that file_get_contents() was ‘completely
broken’ in PHP 5-dev caught Andi’s attention. He asked Curt to re-test using the
latest CVS HEAD, as there had been some recent fixes. Curt reported back: no change.
A bunch of people built PHP from scratch to test it, and reported mixed
results.

Wez Furlong admitted to some confusion, saying that his ‘gready’ fixes shouldn’t
affect that function at all, but he was also too busy with work to look into it
deeply at that point. Late that evening he noticed a two-line change that hadn’t
been merged from the 4.3 branch, and added it to PHP 5 HEAD. Problem solved.

Short version: Mystery bug is now gone.


FIX: alloca() revisited

Ilia Alshanetsky snuck an alloca() replacement into both versions of
the Zend Engine following two similar bug reports about crashes on particularly long
PHP scripts across all current versions. War broke out between the
alloca() and emalloc() camps, with Thies Arntzen
(particularly) arguing strongly against the performance decrease and Ilia
(particularly) arguing equally strongly against instability, and nobody saying
anything that hadn’t been said already in earlier discussions on the subject. The
thread ended when Wez committed a strange workaround simply in order to avoid having
to take part in the war.

Short version: Really, really final alloca() replacement.


TLK: Test roll

Andi made a test roll of PHP 5.0.0, and asked everyone to download and test it -
just as midnight reached Europe. Edin Kadribasic announced his win32 version almost
as soon as Europe woke up.

Lorenzo Alberton downloaded the win32 snapshot, and noticed that the PEAR
packages there were outdated. Edin and the PEAR guys sorted this out between them
before the release, with Edin saying rather pointedly that it was the PEAR QA team’s
responsibility to ensure that the bundled package versions were kept up to date
throughout.

Next up was Sebastian Bergmann, who rolls his own, announcing that php
–m
caused a crash under Windows. Stefan Esser, who was using the snapshot
version, wrote in to say that he couldn’t reproduce this on XP. Nuno Lopes, testing
on cygwin, sent in a backtrace of the segfault he was experiencing. Less helpfully,
it clearly wasn’t produced by php -m. Romain Bourdon threw in another
red herring; php –m worked, but complained. However it was obvious from
his error messages that his modules were from the wrong PHP build, and Derick
Rethans brusquely pointed this out. Romain tracked this down to a php.ini in his
system path pointing to the wrong directory, and replied – having deleted it – that
everything now worked fine. Hmm.

By this time it was morning in America, and Andi mailed the list to say that he
also couldn’t reproduce the php –m crash. It was beginning to look as
though Sebastian’s problem was peculiar to Sebastian’s machine, until Rob Richards
wrote in to say that he was getting that crash too. He also included a stack
trace.

Derrell Lipman saw Rob’s stack trace, and within 20 minutes had produced a
careful analysis implicating the call
zend_hash_destroy(php_get_stream_filters_hash());

Not bad, for someone who doesn’t know PHP internals. Wez, who wrote a fair chunk
of them, went directly to streams.c and added ‘_global‘ to the end of
that call; Rob immediately rebuilt his copy of CVS HEAD and confirmed that it fixed
the problem. “King Wez!” wrote Andi.

Short version: Welcome on board, Derrell.


FIX: threaded bcmath

Someone named Chris brought attention to the fact that there was a serious bug
outstanding in the bundled bcmath extension, causing PHP on threaded SAPIs to crash
when bcmath functions were passed 0, 1 or 2. Robert Janeczek confirmed the
issue, and added that it made certain of the PEAR packages (i.e. Benchmark) unusable
on Windows systems. Sara Golemon fixed the problem by bringing the extension’s
initialization and shutdown processes into the 21st century.

Short version: ext/bcmath should work cross-platform now.


NEW: PHP 5.0.0

After many vicissitudes, Andi Gutmans, as PHP 5.0 Release Master, officially
announced the release of PHP 5.0.0 on July 13th.

Short version: Made it!


NEW: PHP 4.3.8

Ilia Alshanetsky, as PHP 4.3 Release Master, maintained his tradition of
releasing to the same schedule as PHP 5. PHP 4.3.8 is chiefly a security
release.

Short version: PHP 4 users across all platforms are strongly advised to upgrade.


FIX: HTTP_AUTH

Alex Pagnoni wrote in to say that he felt it was pretty urgent to fix "http://bugs.php.net/bug.php?id=29132">#29132 before 5.0.1 was released.

Stefan’s commit message for the one line fix said it all:

Security Fix broken! Destroyed Basic auth. Blame: me

4.3.x not affected

Short version: Expect an early 5.0.1, and no future PHP releases dated the 13th.


TLK: Commit policy for HEAD?

Christian Stocker wrote to the list asking whether he was allowed to add new
functionality to PHP 5 now, and if so, where? Derick pointed out that 5_0 had not
yet been branched. A shocked Wez asked for this to be done immediately. Andrey
Hristov urged a little caution, pointing out that there was likely to be a surge of
bug reports following the 5.0.0 release and that all the minor fixes generated
through this expected wave would need to be merged to at least two CVS branches,
possibly three, making them relatively difficult to keep track of. Andi agreed with
Andrey’s approach ‘for a few days’ for that reason, but added he didn’t really mind
which way it went. Marcus Börger disagreed that there should be an interval at all,
and sent an angry response. (It has to be said that the team have been very patient
in waiting to commit their new ideas.) Andi, who also is part of that team and also
has new work to commit, explained that he’d only wanted an opinion poll on the
matter, and promptly created the new branch, this being some 48 hours after release.

Short version: CVS HEAD is now 5_1. All fixes to be merged to the 5_0 branch.


NEW: Load-order dependencies

Having waited several weeks for someone (anyone) to respond to his pleas for BSDI
testing for this patch, Wez finally decided to go ahead and commit it regardless. It
allows the build system to recognize an extension’s dependencies and load them
correctly, so that (for example) a configuration that includes, say, simplexml,
would attempt to build in libxml support, which in turn could be made to
automatically request iconv support. This means that (to continue with the example)
it shouldn’t take much internal work to separate iconv support from the libxml build
mechanism, allowing the iconv extension to be configured independently in the future.

Short version: The PHP 5.1 build system just became a little more flexible.


NEW: TRUE, FALSE, NULL

Marcus changed the implementation of TRUE, FALSE, and
NULL from constants to keywords in 5.1-dev. This led to some
discussion, mainly springing from Sterling Hughes, who hadn’t spotted the change
sitting in the 5.1 TODO file. Andi explained that this was the first of several
planned opcode optimizations – reserved words don’t make the same internal calls
that constants make. Sterling pointed out that it wasn’t back compatible – anyone
using a user-created function named true(), for example, would have
broken code following this change. He added that it was possible to make this kind
of optimization happen from the outside, and said that he would create a patch for
the apc extension that would achieve this behaviour for anyone who explicitly wanted
it. If Sterling does so and it all works cleanly, the current change is likely to be
reverted. However, we haven’t seen his code yet.

Short version: It’s okay, nobody else understands this stuff either.


NEW: exslt support on win32

Rob Richards committed a patch enabling exslt
support on Windows, in both the PHP 5 branches. He also requested
an update to the existing libxml and libxslt libraries, saying that he had been
testing them for some time across all current versions of PHP without finding any
problems. This hasn’t been done at the time of writing.

Short version: exslt support is already here, and a library upgrade is
on its way.


PAT: gd namespace collisions

Joe Orton sent in a patch that resolves an issue with namespace pollution when
PHP is built with bundled GD and then run alongside other Apache modules that have
the GD library bundled, causing random segfaults. His patch against PHP 4.3/GD
2.0.23, plus instructions for generating the symbol list that goes with it, is in
the PAT directory.

Everything else submitted this week was reviewed and committed.

Short version: Don’t try to run Perl::GD alongside PHP as an Apache
module just yet.

Comments are closed.