Search Postgresql Archives

Re: pg_upgrade: out of memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Carrington, Matthew (Produban)" <Matthew.Carrington@xxxxxxxxxxxxxx> writes:
> pg_dump: reading user-defined aggregate functions

> Breakpoint 1, exit_horribly (modulename=0x0, fmt=0x10006a590 "out of memory\n")
>     at dumputils.c:1314
> 1314    dumputils.c: A file or directory in the path name does not exist..
> (gdb) bt
> #0  exit_horribly (modulename=0x0, fmt=0x10006a590 "out of memory\n") at dumputils.c:1314
> #1  0x000000010003247c in pg_malloc (size=0) at dumpmem.c:47
> #2  0x0000000100008f54 in getAggregates (fout=0x11000bad0, numAggs=0xffffffffffff73c)
>     at pg_dump.c:3614

Oh!  Given your previous comment about there not being any user-defined
aggregates, I see what the problem is.  AIX must be one of the platforms
where malloc(0) is defined to return NULL rather than a pointer to a
zero-size block.  pg_malloc is not coping with that.

A quick fix would be

pg_malloc(size_t size)
{
	void	   *tmp;

	tmp = malloc(size);
-	if (!tmp)
+	if (!tmp && size)
	{
		psql_error("out of memory\n");
		exit(EXIT_FAILURE);
	}

but I'm not sure if that's the best answer overall.  Will take it up in
-hackers.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux