Re: ERROR: invalid memory alloc request size <a_big_number_here>

From: Matteo Beccati <php(at)beccati(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ERROR: invalid memory alloc request size <a_big_number_here>
Date: 2005-10-27 14:02:48
Message-ID: 4360DE08.6020300@beccati.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> Go up a few levels to GetMultiXactIdMembers and type "info locals", see
> if we can get the values of some of the variables there. Also, if you
> can turn the debugging down to -O0, that will make the results in gdb
> much more reliable.
>
> It's clear at least that "length" is negative, but what about the other
> variables...

I already recompiled all with -O0 to be sure that I was able to have a
backtrace. This is the full bt:

#2 0x0827b5cf in MemoryContextAlloc (context=0x856bcc8,
size=4278026492) at mcxt.c:505
__func__ = "MemoryContextAlloc"
#3 0x080b6a16 in GetMultiXactIdMembers (multi=320306, xids=0xbfbfaba4)
at multixact.c:935
pageno = 156
prev_pageno = 156
entryno = 819
slotno = 2
offptr = (MultiXactOffset *) 0x286536ac
offset = 4235201
length = -4235201
i = 138425096
nextMXact = 320308
tmpMXact = 320307
nextOffset = 4235265
ptr = (TransactionId *) 0xbfbfab78

> Do you use a lot of subtransactions, function, savepoints, anything
> like that?

I just removed a subtransaction that I put in a function that was used
to capture the deadlock errors. That subtransaction was actually useless
because I removed the FOR UPDATE clause that was causing the deadlock,
but the alloc error is still there. I'll try to search through the code
to find some other subtransactions.

Best regards
--
Matteo Beccati
http://phpadsnew.com
http://phppgads.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matteo Beccati 2005-10-27 14:05:21 Re: ERROR: invalid memory alloc request size <a_big_number_here>
Previous Message Alvaro Herrera 2005-10-27 14:00:37 Re: ERROR: invalid memory alloc request size <a_big_number_here>