Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-05-24 Thread Robert Haas
On Mon, May 23, 2011 at 1:12 AM, Noah Misch n...@leadboat.com wrote: On Tue, Apr 26, 2011 at 11:51:35PM -0400, Noah Misch wrote: On Tue, Apr 26, 2011 at 07:23:12PM -0400, Tom Lane wrote: [input functions aren't the only problematic source of uninitialized datum bytes] We've run into other

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-05-24 Thread Noah Misch
On Tue, May 24, 2011 at 02:05:33PM -0400, Robert Haas wrote: On Mon, May 23, 2011 at 1:12 AM, Noah Misch n...@leadboat.com wrote: On Tue, Apr 26, 2011 at 11:51:35PM -0400, Noah Misch wrote: On Tue, Apr 26, 2011 at 07:23:12PM -0400, Tom Lane wrote: [input functions aren't the only

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-05-24 Thread Robert Haas
On Tue, May 24, 2011 at 2:11 PM, Noah Misch n...@leadboat.com wrote: OK, I can't see what's broken.  Help? QTN2QT() allocates memory for a TSQuery using palloc().  TSQuery contains an array of QueryItem, which contains three bytes of padding between its first and second members.  Those

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-05-24 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Tue, May 24, 2011 at 2:11 PM, Noah Misch n...@leadboat.com wrote: QTN2QT() allocates memory for a TSQuery using palloc().  TSQuery contains an array of QueryItem, which contains three bytes of padding between its first and second members.  Those

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-05-24 Thread Robert Haas
On Tue, May 24, 2011 at 2:18 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, May 24, 2011 at 2:11 PM, Noah Misch n...@leadboat.com wrote: QTN2QT() allocates memory for a TSQuery using palloc().  TSQuery contains an array of QueryItem, which contains

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-05-24 Thread Tom Lane
Noah Misch n...@leadboat.com writes: Adding a memory definedness check to printtup() turned up one more culprit: tsquery_and. Patch applied, thanks. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-05-24 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Excellent. Are you going to look at MauMau's patch for bug #6011 also? No. I don't do Windows, so I can't test it. (On general principles, I don't think that hacking write_eventlog the way he did is appropriate; such a function should write the log,

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-05-22 Thread Noah Misch
On Tue, Apr 26, 2011 at 11:51:35PM -0400, Noah Misch wrote: On Tue, Apr 26, 2011 at 07:23:12PM -0400, Tom Lane wrote: [input functions aren't the only problematic source of uninitialized datum bytes] We've run into other manifestations of this issue before. Awhile ago I made a push to

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-04-27 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: On Wed, Apr 27, 2011 at 12:23 AM, Tom Lane t...@sss.pgh.pa.us wrote: Any ideas about better answers? Here's a crazy idea. We could use string equality of the out function's representation instead. If an output function doesn't consistently output the same

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-04-27 Thread Tom Lane
Noah Misch n...@leadboat.com writes: On Tue, Apr 26, 2011 at 07:23:12PM -0400, Tom Lane wrote: [input functions aren't the only problematic source of uninitialized datum bytes] FWIW, when I was running the test suite under valgrind, these were the functions that left uninitialized bytes in

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-04-26 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Any ideas about better answers? Seems like you covered it - anything other than memcmp() is going to require a lot of brainz and have lots of sharp edges. But this example shows that we'd really have to enforce the rule of no ill-defined

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-04-26 Thread Greg Stark
On Wed, Apr 27, 2011 at 12:23 AM, Tom Lane t...@sss.pgh.pa.us wrote: Any ideas about better answers? Here's a crazy idea. We could use string equality of the out function's representation instead. If an output function doesn't consistently output the same data for things that are equal or

Re: [HACKERS] Alignment padding bytes in arrays vs the planner

2011-04-26 Thread Noah Misch
On Tue, Apr 26, 2011 at 07:23:12PM -0400, Tom Lane wrote: [input functions aren't the only problematic source of uninitialized datum bytes] We've run into other manifestations of this issue before. Awhile ago I made a push to ensure that datatype input functions didn't leave any ill-defined