tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <>
Subject Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp13_worker.c
Date Thu, 11 Nov 2004 07:34:03 GMT
Costin Manolache wrote:
> Mladen Turk wrote:
>> David Rees wrote:
>>> Are you sure it's a good idea to wait until it crashes rather than 
>>> fail in a controlled method?  How much overhead is there to check 
>>> aw->name for NULL?  Can't be much...
>> Yes I am.
>> Look, if the system can not alloc 1000 bytes of memory what's
>> the purpose to continue?
>> Mt.
> Are you joking :-) ?

No :).

It would make sense if we expect that malloc call might fail due
the fact that we are trying to alloc potentially large memory and
then fall back.

If we can not alloc couple of bytes from the system, then the
entire system is unstable.
Just look at httpd or apr sources. There's almost no checks for
malloc success on small objects. They are presumed to return valid
memory block.

> At least do an printf and exit(), coredump is never good  (some systems 
> don't collect the core - so the user will have no idea what just 
> happened ).

Well, IMO it would fail long before our module is called.
Also on first write to NULL every system will give the user a pretty
good warning thought :).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message