Re: uuids on freebsd

Lists: pgsql-hackers
From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: uuids on freebsd
Date: 2008-12-17 19:30:20
Message-ID: 87wsdy7g6r.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Has anyone ever managed to get uuid generation working on FreeBSD?
There seems to be no way to build contrib/uuid-ossp successfully,
and no apparent agreement anywhere as to whether this is problem
with pg or with the misc/ossp-uuid port.

(I tried this, without success, a couple of weeks back in response to
a question on IRC. The only solution I could come up with was to knock
off a quick uuid-freebsd module that uses the base system uuid
functions rather than the ossp ones. I could put this on pgfoundry if
there isn't likely to be a real fix in the near future.)

--
Andrew (irc:RhodiumToad)


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: uuids on freebsd
Date: 2008-12-18 10:17:42
Message-ID: 494A2346.6070206@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Gierth wrote:
> Has anyone ever managed to get uuid generation working on FreeBSD?
> There seems to be no way to build contrib/uuid-ossp successfully,
> and no apparent agreement anywhere as to whether this is problem
> with pg or with the misc/ossp-uuid port.

So what's the problem? Error messages etc.?


From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: uuids on freebsd
Date: 2008-12-18 12:59:18
Message-ID: 877i5x7i6x.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>>>>> "Peter" == Peter Eisentraut <peter_e(at)gmx(dot)net> writes:

> Andrew Gierth wrote:
>> Has anyone ever managed to get uuid generation working on FreeBSD?
>> There seems to be no way to build contrib/uuid-ossp successfully,
>> and no apparent agreement anywhere as to whether this is problem
>> with pg or with the misc/ossp-uuid port.

Peter> So what's the problem? Error messages etc.?

On my system (7.1-pre on amd64), it refuses to link (presumably due to
the misc/ossp-uuid port building the .a without -fPIC). The guy whose
report on IRC caused me to look into it had a very similar system, but
in his case the module did link, but segfaulted the backend if called.

I get a segfault too if I force misc/ossp-uuid to build with -fPIC:

test=# select uuid_generate_v1();
server closed the connection unexpectedly

(gdb) where
#0 0x000000087d404fb5 in uuid_export () from /usr/local/lib/postgresql/uuid-ossp.so
#1 0x000000087d40598a in uuid_make () from /usr/local/lib/postgresql/uuid-ossp.so
#2 0x000000087d4031d8 in uuid_nil () from /usr/local/lib/postgresql/uuid-ossp.so
#3 0x0000000000556cf9 in ExecMakeFunctionResult ()

I can try this on another box with a debug-enabled pg build later.

--
Andrew (irc:RhodiumToad)


From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: uuids on freebsd
Date: 2008-12-18 15:02:03
Message-ID: 87ocz95xxw.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>>>>> "Andrew" == Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:

Andrew> I get a segfault too if I force misc/ossp-uuid to build with
Andrew> -fPIC:
[...]
Andrew> I can try this on another box with a debug-enabled pg build
Andrew> later.

The problem, unsurprisingly, is that the call to uuid_create in
contrib/uuid-ossp.c ends up resolving to the libc function rather than
to the ossp libuuid.a one. Since the functions do completely different
things, hilarity ensues.

It can apparently be made to work by jumping through enough flaming
hoops: you have to build misc/ossp-uuid with CFLAGS=-fPIC, and then
build contrib/uuid-ossp with LDFLAGS_SL=-Wl,-Bsymbolic (but I think
this would break again if misc/ossp-uuid ever installed a .so rather
than just the .a). So I don't think this is a realistic fix.

--
Andrew (irc:RhodiumToad)


From: David Lee Lambert <davidl(at)lmert(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: uuids on freebsd
Date: 2008-12-24 18:08:01
Message-ID: 45ee757a-89b6-4e61-ab3b-97b605f4f7ff@f13g2000yqj.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Dec 17, 2:30 pm, Andrew Gierth <and(dot)(dot)(dot)(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
> Has anyone ever managed to get uuid generation working on FreeBSD? [...]
>
> ([...] The only solution I could come up with was to knock
> off a quick uuid-freebsd module that uses the base system uuid
> functions rather than the ossp ones. I could put this on pgfoundry if
> there isn't likely to be a real fix in the near future.)

+1 for putting it on pgFoundry.

I managed to hack the old contrib/uuid so it would use the functions
from Linux e2fs uuid on 8.0/8.1/8.2. I might have time soon to see if
I can get that to work on 8.3.

--
DLL


From: David Fetter <david(at)fetter(dot)org>
To: David Lee Lambert <davidl(at)lmert(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: uuids on freebsd
Date: 2008-12-26 02:23:33
Message-ID: 20081226022333.GB4185@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Dec 24, 2008 at 10:08:01AM -0800, David Lee Lambert wrote:
> On Dec 17, 2:30 pm, Andrew Gierth <and(dot)(dot)(dot)(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
> > Has anyone ever managed to get uuid generation working on FreeBSD? [...]
> >
> > ([...] The only solution I could come up with was to knock
> > off a quick uuid-freebsd module that uses the base system uuid
> > functions rather than the ossp ones. I could put this on pgfoundry if
> > there isn't likely to be a real fix in the near future.)
>
> +1 for putting it on pgFoundry.

It's now on pgfoundry :)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate