Thread

  1. Out of memory

    Ivan Boscaino <iboscaino@mbigroup.it> — 2003-07-08T09:47:50Z

    Hi,
    I'm not sure if you know this problem.
    
    Create an empty function with 26 parameters:
    
    create function test (INTEGER,TEXT,TEXT,TEXT,CHAR(16),CHAR(11),
    BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,
    BOOLEAN,BOOLEAN,BOOLEAN,CHAR(2),TEXT,TEXT,TEXT,TEXT,
    CHAR(5),TEXT,TEXT,TEXT,TEXT,TEXT )
    returns integer as '
    declare
    begin
      return 0;
    end;' language 'plpgsql';
    
    
    Call it mistyping the boolean parameters:
    
    select test 
    (1,'a','a','a','a','a',1,1,1,1,1,1,1,1,1,'a','a','a','a','a','a','a','a','a','a','a');
    
    Then the system crashes.
    
    In /var/log/messages I found:
    
    [...]
    Jul  8 11:21:58 host1 kernel: Out of Memory: Killed process 20586 
    (postmaster).
    [...]
    
    OS: RH7.3 and RH7.2
    PG: 7.3.2 and 7.3.3
    
    
    
    
  2. Re: Out of memory

    Stephan Szabo <sszabo@megazone23.bigpanda.com> — 2003-07-10T04:45:57Z

    On Tue, 8 Jul 2003, Ivan Boscaino wrote:
    
    > Hi,
    > I'm not sure if you know this problem.
    >
    > Create an empty function with 26 parameters:
    >
    > create function test (INTEGER,TEXT,TEXT,TEXT,CHAR(16),CHAR(11),
    > BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,
    > BOOLEAN,BOOLEAN,BOOLEAN,CHAR(2),TEXT,TEXT,TEXT,TEXT,
    > CHAR(5),TEXT,TEXT,TEXT,TEXT,TEXT )
    > returns integer as '
    > declare
    > begin
    >   return 0;
    > end;' language 'plpgsql';
    >
    >
    > Call it mistyping the boolean parameters:
    >
    > select test
    > (1,'a','a','a','a','a',1,1,1,1,1,1,1,1,1,'a','a','a','a','a','a','a','a','a','a','a');
    >
    > Then the system crashes.
    
    I believe this is fixed in 7.4 (or at least your example does not crash in
    7.4)
    
    
    
  3. Re: Out of memory

    Joe Conway <mail@joeconway.com> — 2003-07-10T07:29:04Z

    Stephan Szabo wrote:
    > I believe this is fixed in 7.4 (or at least your example does not crash in
    > 7.4)
    > 
    
    Yeah, this came up a few weeks ago and Tom fixed it in 7.4devel and 
    REL7_3_STABLE. See (sorry, I doubt this will probably wrap):
    http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/parser/parse_func.c.diff?r1=1.139.2.1&r2=1.139.2.2&f=c
    
    Joe
    
    
    
  4. Re: Out of memory

    Tom Lane <tgl@sss.pgh.pa.us> — 2003-07-10T15:20:48Z

    Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
    > I believe this is fixed in 7.4 (or at least your example does not crash in
    > 7.4)
    
    Yeah, this was just noticed and fixed a few weeks ago.  I'm not aware
    that there is any "crash" involved though, the query just fails in
    existing releases.
    
    			regards, tom lane