[postgis-users] PostGIS, 64 bit Solaris, Invalide memory alloc message using force_collection
Erik Persson
edpersson at qwest.net
Mon Jan 30 12:52:36 PST 2006
Hi all,
I am wondering if anyone has experience running PostGIS on a 64 bit
version of Solaris running on the Sparc architecture. The error
described below occurred when compiled as 64 bit. A quick test on a
32 bit Sparc machine indicates that the problem does not exist there.
I recently installed postgis on a solaris machine and a mapserver
query to postgis that has been working fine on OS X and linux
suddenly failed with an 'invalid memory alloc' error. I have reduced
the error down to a the force_collection function. I have down-reved
to PostgreSQL 8.1.1 and postgis 1.1.0 and experience the same problem.
If I make a simple table with a single point column force collection
works fine. If I add a second row I get a huge amount of output
(with the memory alloc error appearing sporadically), about 45MB of
data for a 2 points of dim 2 in a single column in a table with two
rows! I have done the test with POINTS of dim 2 and 3 with similar
results. The requested memory size appears to be the same, but at
the moment I can't confirm that %100.
If I use the LIMIT directive, I seem to get the error regardless of
the number of rows, but given the sporadic nature of the problem with
two rows of data in the table I can't be 100% of the
reproducibility. If I select a single row using an id column it
works fine.
As you can see below, it is a 64 bit architecture compiled as 64
bit. All the relevant versions and system information should be
contained below.
Any suggestions? Known bugs? Known problems on 64 bit architectures,
particularly Solaris? I am happy to instrument code, try patches,
or do other debugging.
Thanks,
Erik
Example of failure:
pod=# select force_collection(the_point) from foo;
ERROR: invalid memory alloc request size 1073741824
Demonstration that data is valid:
pod=# select astext(the_point) from foo;
astext
--------------------------
POINT(-90 45)
POINT(-149.1323 61.5982)
(2 rows)
Test data used:
pod=# select * from foo;
id | the_point
| the_point3
----+--------------------------------------------
+------------------------------------------------------------
2 | 0000000001C0568000000000004046800000000000 |
0080000001C05680000000000040468000000000000000000000000000
1 | 0000000001C062A43BCD35A858404ECC91D14E3BCD |
0080000001C062A43BCD35A858404ECC91D14E3BCD0000000000000000
(2 rows)
pod=# select version();
version
------------------------------------------------------------------------
---
PostgreSQL 8.1.1 on sparc-sun-solaris2.9, compiled by GCC gcc (GCC)
3.4.3
(1 row)
pod=# select postgis_full_version();
postgis_full_version
------------------------------------------------------------------------
----------
POSTGIS="1.1.1" GEOS="2.2.1-CAPI-1.0.1" PROJ="Rel. 4.4.9, 29 Oct
2004" USE_STATS
(1 row)
bash-2.05$ ldd liblwgeom.so
libgeos_c.so.1 => /usr/local/geos/lib/libgeos_c.so.1
libproj.so.0 => /usr/local/proj4/lib/libproj.so.0
libgcc_s.so.1 => /usr/local/gcc/lib/sparcv9/
libgcc_s.so.1
libgeos.so.2 => /usr/local/geos/lib/libgeos.so.2
libstdc++.so.6 => /usr/local/gcc-3.4.3-v9/lib/sparcv9/
libstdc++.so.6
libm.so.1 => /usr/lib/64/libm.so.1
libc.so.1 => /usr/lib/64/libc.so.1
libdl.so.1 => /usr/lib/64/libdl.so.1
/usr/platform/SUNW,Sun-Fire-V240/lib/sparcv9/libc_psr.so.1
bash-2.05$ cat /etc/release
Solaris 9 9/05 s9s_u8wos_05 SPARC
bash-2.05$ uname -a
SunOS machine 5.9 Generic_118558-11 sun4u sparc SUNW,Sun-Fire-V240
gcc (GCC) 3.4.3
More information about the postgis-users
mailing list