pg.ddx.io pgsql-ports@postgresql.org mailing list archivehelp / color / mirror / Atom feed
AIX Permission weirdness 2+ messages / 2 participants [nested] [flat]
* AIX Permission weirdness @ 2005-11-01 17:14 Chris Browne <cbbrowne@acm.org> 0 siblings, 1 reply; 2+ messages in thread From: Chris Browne @ 2005-11-01 17:14 UTC (permalink / raw) To: pgsql-ports In the interests of helping others that might run into this, and so that if we ever Google for this, we may find it... :-) We recently ran into fairly weird regressions on AIX. Shared libraries wouldn't load, which assortedly meant that: - plpgsql couldn't be loaded - Slony-I stored functions couldn't work - regression tests wouldn't work The typical result: -bash-3.00$ /opt/dbs/pgsql748-afilias-AIX53-2005-10-19/bin/createlang plpgsql template1 ERROR: could not load library "/opt/dbs/pgsql748-afilias-AIX53-2005-10-19/lib/plpgsql.so": A memory address is not in the address space for the process. createlang: language installation failed: ERROR: could not load library "/opt/dbs/pgsql748-afilias-AIX53-2005-10-19/lib/plpgsql.so": A memory address is not in the address space for the process. The evident problem is actually on the permissions... After modifying plpgsql.so to have "777" permissions (which was doubtless more open than necessary, but hey, it took 2 seconds to think of it :-)), the library loaded in fine. It is very worthwhile to have this note around because we did a lot of searching around as to possible issues with dlopen() which didn't report anything even vaguely suggestive that permissions were not set permissively enough... -- "cbbrowne","@","acm.org" http://cbbrowne.com/info/linuxxian.html "MSDOS didn't get as bad as it is overnight -- it took over ten years of careful development." -- <dmeggins@aix1.uottawa.ca> ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: AIX Permission weirdness @ 2005-12-02 18:29 Seneca Cunningham <scunning@ca.afilias.info> parent: Chris Browne <cbbrowne@acm.org> 0 siblings, 0 replies; 2+ messages in thread From: Seneca Cunningham @ 2005-12-02 18:29 UTC (permalink / raw) To: Chris Browne <cbbrowne@acm.org>; +Cc: pgsql-ports Chris Browne wrote: > We recently ran into fairly weird regressions on AIX. Shared > libraries wouldn't load, which assortedly meant that: > - plpgsql couldn't be loaded > - Slony-I stored functions couldn't work > - regression tests wouldn't work > > The typical result: > > -bash-3.00$ /opt/dbs/pgsql748-afilias-AIX53-2005-10-19/bin/createlang plpgsql template1 > ERROR: could not load library "/opt/dbs/pgsql748-afilias-AIX53-2005-10-19/lib/plpgsql.so": A memory address is not in the address space for the process. > createlang: language installation failed: ERROR: could not load library "/opt/dbs/pgsql748-afilias-AIX53-2005-10-19/lib/plpgsql.so": A memory address is not in the address space for the process. > > The evident problem is actually on the permissions... The cause of the problem ended up being the default 32-bit memory model on AIX. The quick workarounds are chmoding all the libs to 755 and building postgres with the linker flag "-bmaxdata:0x40000000". > After modifying plpgsql.so to have "777" permissions (which was > doubtless more open than necessary, but hey, it took 2 seconds to > think of it :-)), the library loaded in fine. The 777 mode let plpgsql.so load because when the other-read bit is set, the dlopened library is loaded into the shared library text segment. When the bit is unset and the library isn't already in shared memory, dlopen tries to load the library into private memory. The default model only allows for part of a single 256M segment to be the user heap and it is too full to allow plpgsql.so to be dlopened into it. The previously mentioned option "-bmaxdata:0x40000000" causes the heap to be moved out of the process private segment and is instead allocated four segments (1G) of memory, reducing the amount of memory available to the process as shared memory to 1.75G. The first digit of the maxdata arg can be changed to a maximum of 8, and is the number of segments allocated to the heap at the expense of segments for shared memory. References: "Developing and Porting C and C++ Applications on AIX" Section 2.6: Dynamic loading (book page 82, pdf page 108) Section 2.9: Shared libraries in a development environment (book page 99, pdf page 125) Section 3.2: The 32-bit user process model (book page 109, pdf page 135) http://www.redbooks.ibm.com/redbooks/pdfs/sg245674.pdf http://www.redbooks.ibm.com/abstracts/sg245674.html?Open "Large Program Support" http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/lrg_prg_sup... -- Seneca Cunningham scunning@ca.afilias.info ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-12-02 18:29 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2005-11-01 17:14 AIX Permission weirdness Chris Browne <cbbrowne@acm.org> 2005-12-02 18:29 ` Seneca Cunningham <scunning@ca.afilias.info>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox