Subject: pkg/25473: Postgresql-7.3.2 fails to load languages on netbsd-1.6/cobalt
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bservies@pacang.com>
List: pkgsrc-bugs
Date: 05/05/2004 09:24:50
>Number:         25473
>Category:       pkg
>Synopsis:       Postgresql-7.3.2 fails to load languages on netbsd-1.6/cobalt
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 05 16:25:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Byron Servies
>Release:        NetBSD 1.6.2
>Organization:
	Self
>Environment:
System: NetBSD piglet.central 1.6.2 NetBSD 1.6.2 (BYRON) #1: Mon Mar 1 21:23:26 PST 2004 root@piglet.central:/usr/src/sys/arch/cobalt/compile/BYRON cobalt
Architecture: mipsel
Machine: cobalt
>Description:
	After building postgresql-7.3.2 from pkgsrc I attempted to add
	the plpgsql scripting language to the database using the command:

	$ createlang plpgsql template1
	ERROR:  Load of file /usr/pkg/lib/postgresql/plpgsql.so failed: dlopen (/usr/pkg/lib/postgresql/plpgsql.so) not supported
	createlang: language installation failed

	Investigating this problem, I found that the dynaloader.c file (which
	abstracts dlopen, etc., calls) contained blocks of "if defined(__mips__)"
	that print the 'not supported' error and return a fault instead of
	calling dlopen.

>How-To-Repeat:
	Build postgresql and attempt to load the language as shown above.
	Note that I am running a kernel with the following settings for
	semaphores so that postgres will start:
	options       SEMMNI=2000     # number of semaphore identifiers
	options       SEMMNS=12000    # number of semaphores in system
	options       SEMUME=2000     # max number of undo entries per process
	options       SEMMNU=6000     # number of undo structures in system
>Fix:
	I replaced these with "ifndef HAVE_DLOPEN" and rebuilt.  The database
	now loads languages and passes nearly all the provided regression
	tests (which would not run before because they required the plpgsql
	language).
>Release-Note:
>Audit-Trail:
>Unformatted: