Обсуждение: uuids on freebsd

Поиск
Список
Период
Сортировка

uuids on freebsd

От
Andrew Gierth
Дата:
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)


Re: uuids on freebsd

От
Peter Eisentraut
Дата:
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.?


Re: uuids on freebsd

От
Andrew Gierth
Дата:
>>>>> "Peter" == Peter Eisentraut <peter_e@gmx.net> writes:
> Andrew Gierth wrote:>> Has anyone ever managed to get uuid generation working on FreeBSD?>> There seems to be no way
tobuild contrib/uuid-ossp successfully,>> and no apparent agreement anywhere as to whether this is problem>> with pg or
withthe 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)


Re: uuids on freebsd

От
Andrew Gierth
Дата:
>>>>> "Andrew" == Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
Andrew> I get a segfault too if I force misc/ossp-uuid to build withAndrew> -fPIC:[...]Andrew> I can try this on
anotherbox with a debug-enabled pg buildAndrew> 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)


Re: uuids on freebsd

От
David Lee Lambert
Дата:
On Dec 17, 2:30 pm, Andrew Gierth <and...@tao11.riddles.org.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


Re: uuids on freebsd

От
David Fetter
Дата:
On Wed, Dec 24, 2008 at 10:08:01AM -0800, David Lee Lambert wrote:
> On Dec 17, 2:30 pm, Andrew Gierth <and...@tao11.riddles.org.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@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

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