I find one bug exist in generating error message for ANALYZE when the message size is large.
In analyzeStmt(), there is a variable called failNames. It is initialized in caller's memory context, but it repallocs memory in relation context, and it is freed in statement context. This is bug of wrongly using memory context. when the relation and statement context are dropped at then end of function analyzeStmt(), pat of its content will be flushed with 0. This explain why another block's header was randomly wiped out in the bug.