Skip site navigation (1) Skip section navigation (2)

MemoryContextAlloc: invalid request size 1934906735

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: MemoryContextAlloc: invalid request size 1934906735
Date: 2002-08-26 22:04:04
Message-ID: 20020826220404.E569F1C4E@druid.net (view raw or flat)
Thread:
Lists: pgsql-hackers
I have been getting the subject message ever since upgrading to 7.2.1.  I 
tried 7.2.2 with the same thing.  It seems to be related to my chkpass type 
(see contrib) as it only happens on tables with that type.  I tried it on a 
new database with a very simple table and still see it.  After compiling 
chkpass.c and running the SQL to create the type create a table with one 
field with chkpass type.  Add a number of rows, I did 24, then vacuum it.  
You get something similar to the above.  Sometimes you get "Memory exhausted 
in AllocSetAlloc(929654141)" instead and once in a while there is no error.

Given table x with field c as chkpass run "UPDATE x SET c = ':a';" on it.  
This never fails.  Now try UPDATE x SET c = 'a';" and let chkpass crypt the 
value.  This usually fails with one of the above messages.  The number is 
constant until you run the UPDATE again.

Somehow the value of the password string is polluting the size storage.  I 
know this because every time this happens, the first 2nd, 3rd and 4th bytes 
(after adjusting for endianness) of the integer are the 6th, 7th and 8th 
characters of the encrypted password.

I have another type which is built like this except that it is an indexable 
type and that doesn't seem to have any problem.  It is constructed the same 
way otherwise.  The palloc calls appear to be correct.  Can anyone see why 
this would suddenly be a problem?

-- 
D'Arcy J.M. Cain <darcy(at){druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.

Responses

pgsql-hackers by date

Next:From: Nigel J. AndrewsDate: 2002-08-26 22:58:00
Subject: Re: [HACKERS] TODO Done. Superuser backend slot reservations
Previous:From: Bruce MomjianDate: 2002-08-26 22:03:06
Subject: Re: Default privileges for new databases (was Re: Can't import

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group