We were just analyzing some more OProfile and ltrace data against
Postgres 8.2Beta1 and we noticed a number of calls as follows:

strlen("postgres: tpc tpc"...)    = 58
memset(0xbffff6b2, '\000', 2344)                 = 0xbffff6b2

We have tracked this down to the following code in the set_ps_display ()

        int         buflen;

        /* pad unused memory */
        buflen = strlen(ps_buffer);
        MemSet(ps_buffer + buflen, PS_PADDING, ps_buffer_size - buflen);
#endif   /* PS_USE_CLOBBER_ARGV */

If set_ps_display () moves to use the strlcpy () function call, this
code might be redundant. Even if the StrNCpy () call is kept, this code
may still be redundant as StrNCpy () will zero fill the ps_buffer.

A MemSet () call on the ps_buffer has to be added to the init_ps_display
() function, if this code is removed to clear the buffer before use.


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to