Justtechjobs.com Find a programming school near you






Online Campus Both


php4-beta | 199912

Re: [PHP4BETA] TSRM problems... UMBRs everywhere:-(( From: Thies C. Arntzen (thies <email protected>)
Date: 12/23/99

On Thu, 23 Dec 1999 zeev <email protected> wrote:

> On Thu, 23 Dec 1999, Thies C. Arntzen wrote:
>
> > On Thu, 23 Dec 1999 zeev <email protected> wrote:
> >
> > > On Thu, 23 Dec 1999, Thies C. Arntzen wrote:
> > >
> > > > hi,
> > > >
> > > > just did some purifying of the aolserver-module - but my point should also
> > > > apply to the Win32 ISAPI stuff.
> > > >
> > > > a lot of _ctor function do *NOT* initialize all TS-Globals correct. just
> > > > compare struct _zend_compiler_globals (Zend/zend_globals.h) and see which
> > > > of those values get initialized in compiler_globals_ctor().
> > > >
> > > > i've enclosed a patch that clear's all TLS memory before calling the
> > > > ctor.
> > >
> > > I'm not following - TSRM isn't supposed to initialize the memory it
> > > initializes. If you need any initialization, it's done in the
> > > constructor, and if it isn't, it's a constructor bug.
> > >
> > > Are you referring to something else?
> >
> > no -
> > than i found a bug (maybe even a few)...
> >
> > compiler_globals_ctor only initializes:
> >
> > compiler_globals->function_table
> > compiler_globals->class_table
> >
> > purify says that eg: CG(extended_info) is uninted when calling
> > phpinfo() in ZTS mode.
>
> Well, CG(extended_info) is indeed not initialized in many places. I'm
> pretty sure you haven't found a generic bug in TSRM or PHP, but perhaps a
> long list of uninitialized variables when using TS PHP.

i agree 100% -

>
> > these kind of UMBRs are extremely hard to find! - in non-ZTS mode all the
> > globals are usually zeroed when the executable loads.
>
> That's true, but purify doesn't fall for that; If there's no explicit
> initialization, it finds a UMR. It's just that some initializations are
> specific to the non-thread-safe version of PHP, and are done in a
> different way for the TS version (using constructors).

remember - global variables are usually zeroed when the program loads:

#include <stdio.h>
int not_reported;
main()
{
    int reported;
    printf("%d\n",not_reported);
    printf("%d\n",reported);
}

purify will not report not_reported 'cause the crt *will* initialize it to
zero!

>
> > i promise you that you will notice an improvement of stability when using
> > my patch on Win32 - even though i think we *SHOULD* not use (my patch) but
> > instead fix all the _ctor() functions.
>
> Well, as a rule we never put in patches that 'magically' increase
> stability (I also don't experience instability on Win32 at all, we do
> almost all of the development on Win32 TS). The list of uninitialized
> variables would be better than the patch :)

agreed again. but what would be your strategy to find those problems? we
could initialize all memory in DEBUG-node with 0xff to make debugging
easier and to increase chances that we'll see some instability when those
things happen. (to then pinpoint the bugs).

anyway, i'll do some purifying soon and i'll fix the stuff my tests cover.

tc
 

>
> Zeev
>
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
> For additional commands, e-mail: php4beta-help <email protected>
> To contact the list administrators, e-mail: php4beta-admin <email protected>
>
>

Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany

-- 
PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
For additional commands, e-mail: php4beta-help <email protected>
To contact the list administrators, e-mail: php4beta-admin <email protected>