Re: [PATCHES] mcxt.c

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] mcxt.c
Date: 2003-09-09 13:40:27
Message-ID: 3F5DD84B.3090005@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


The particular assertion that was proposed doesn't strike me as terribly
useful - It should be checked at the point of call rather than inside
pstrdup, I should have thought.

Of course, that would make for lots of code bloat ... cases like this
are when gdb is your friend.

cheers

andrew

Tom Lane wrote:

>Greg Stark <gsstark(at)mit(dot)edu> writes:
>
>
>>Neil Conway <neilc(at)samurai(dot)com> writes:
>>
>>
>>>I think the percentage of deployments that enable assertions (which
>>>causes a runtime performance hit) but NOT debugging info (which does
>>>not) is pretty small.
>>>
>>>
>
>
>
>>How big a penalty is it? If it's small, or if it could be made small by making
>>a few assertions require an extra extra-assertions option, then perhaps it
>>would make more sense to ship with it enabled?
>>
>>
>
>We generally don't recommend enabling assertions in production
>installations, because it's not clear that there is any net gain in
>stability from doing so. Per the manual:
>
> --enable-cassert
>
> Enables assertion checks in the server, which test for many
> "can't happen" conditions. This is invaluable for code
> development purposes, but the tests slow things down a
> little. Also, having the tests turned on won't necessarily
> enhance the stability of your server! The assertion checks are
> not categorized for severity, and so what might be a relatively
> harmless bug will still lead to server restarts if it triggers
> an assertion failure. Currently, this option is not
> recommended for production use, but you should have it on for
> development work or when running a beta version.
>
>Obviously this does not apply to cases where the assert is testing
>for something that will cause a core dump anyway, like an improperly
>NULL pointer. But there are many, many asserts for things that are
>probably not serious bugs (at worst they might deserve a FATAL exit,
>rather than a system-wide PANIC).
>
>Peter E. has speculated about improving the Assert facility to allow
>categorization along this line, but I dunno when it will happen.
>
>As far as your original question goes, I find that
>MEMORY_CONTEXT_CHECKING and CLOBBER_FREED_MEMORY are quite expensive,
>and presently --enable-cassert turns these on. But of course we could
>decouple that if we were going to encourage people to run with asserts
>enabled in production. I don't think asserts are hugely expensive
>otherwise (though that might change if we sprinkle them as liberally
>as Gaetano's proposal implies...)
>
> regards, tom lane
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-09-09 14:01:25 Re: Maximum table size
Previous Message scott.marlowe 2003-09-09 13:27:21 Re: Maximum table size

Browse pgsql-patches by date

  From Date Subject
Next Message Gaetano Mendola 2003-09-09 14:53:06 Re: [PATCHES] mcxt.c
Previous Message Manfred Koizar 2003-09-09 11:13:45 Re: Minor lmgr code cleanup