Tom Lane wrote:
> Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
>> as for len it seems to be 0:
>
>> #0 varbit_out (fcinfo=0x88c75000) at varbit.c:549
>> s = (VarBit *) 0x88c75000
>> result = 0x84d33128 ""
>> r = 0x84d33128 ""
>> sp = (bits8 *) 0x88c75000 <Address 0x88c75000 out of bounds>
>> x = 0 '\0'
>> i = 0
>> k = 0
>> len = 0
>
> Hmm ... s and sp really shouldn't be equal, nor equal to fcinfo, but
> it's likely that the compiler optimized them into the same register.
> We need to confirm what actually got passed as the argument. Could you
> go to frame 1 and see what is in its local fcinfo var, in particular see
> what args[0] is? I'm betting it's 0x88c75000 minus 8 ... if so, look at
> what is in those last 8 bytes. If that's int32 8 followed by int32 0,
> then indeed we have a zero-length bitstring at the end of memory.
with a bit of help from alvaro:
(gdb) frame 1
#1 0x1c217930 in FunctionCall1 (flinfo=0x1, arg1=2294763520) at fmgr.c:1195
1195 result = FunctionCallInvoke(&fcinfo);
(gdb) info args
flinfo = (FmgrInfo *) 0x1
arg1 = 2294763520
(gdb) info locals
fcinfo = {flinfo = 0x84d33028, context = 0x0, resultinfo = 0x0, isnull = 0 '\0', nargs = 1, arg = {2294763512, 16,
2377208416,1, 2343471056, 2343471056, 4294967295, 2342861632, 0, 0, 3485276712, 470248306, 11, 1, 4294967295, 257,
2294762772,6, 2294762772,
227882802, 197, 0, 0, 20480, 3703223788, 4098, 4294967295, 0, 1, 0, 3485276792, 471883625, 470050980, 1560,
227725220,764289000, 3703223788,
2228453376, 3485276872, 3485276864, 2234862596, 2263890620, 3485277048, 471889873, 2234862596, 2263890620, 1560,
3485277024,5, 533, 533, 0, 0,
3485276904, 4294967295, 2228432896, 2263890588, 483, 4031427043, 9314280, 0,
262142, 0, 471661208, 184, 65538, 0, 2137853048, 0, 1560, 0 <repeats 21 times>, 2228433032, 2228433044, 1565,
3485277048,471950646, 1565, 0, 0, 0}, argnull =
"\000\001\000\000\000\000\000\000\030\006\000\000\2100?204\000\000\000\000\003\000\000\000\230\033??220L5\205\000\004\000\000???\033??220L5\205\b\000\000\000X\022?213?\033??216?\"\034\220L5\205\b\000\000\000\002\000\000\000&@\022\034
\000\000\000X\022?213??210?D\005\034??210"}
result = 2228432924
(gdb) x/16x 0x88c75000 - 8
0x88c74ff8: 0x00000020 0x00000000 Cannot access memory at
address 0x88c75000
is that what you are interested in ?
Stefan