Jeremy Drake <pgsql@jdrake.com> writes:
> On Fri, 22 Dec 2006, Tom Lane wrote:
>> Jeremy Drake <pgsql@jdrake.com> writes:
>>> As seen, I needed to add an include dir for configure to pass. However,
>>> make check fails now with the backend crashing. This can be seen in the
>>> buildfarm results for mongoose.
>>
>> Can you provide a stack trace for that crash?
> #0 0xb7c4dc85 in memcpy () from /lib/tls/libc.so.6
> #1 0x08190f59 in appendBinaryStringInfo (str=0xbfd87f90,
> data=0x841ffc0 "qux", datalen=138543040) at stringinfo.c:192
> #2 0x0828377f in map_sql_identifier_to_xml_name (ident=0x841ffc0 "qux",
> fully_escaped=0 '\0') at xml.c:933
> #3 0x0811ce83 in transformXmlExpr (pstate=0x84202b8, x=0x8420034)
> at parse_expr.c:1426
> #4 0x0811ac91 in transformExpr (pstate=0x84202b8, expr=0x8420034)
> at parse_expr.c:238
Ah-hah, I've sussed it. sqlchar_to_unicode() calls the
mb2wchar_with_len converters, which are defined to return a *null
terminated* pg_wchar string. So even if you only ask for the conversion
of a single character, you need a 2-pg_wchar array to hold the result,
and that wasn't being allocated. So the code was clobbering a word of
stack space that evidently is critical on some machines and not others.
Fix committed, please see if it works for you now.
regards, tom lane