Thread: Re: UUIDs generated using ossp-uuid on windows not unique

Re: UUIDs generated using ossp-uuid on windows not unique

From
MUHAMMAD ASIF
Date:
>On Tue, Jun 17, 2008 at 11:17 AM, Hiroshi Saito
><z-saito(at)guitar(dot)ocn(dot)ne(dot)jp> wrote:
>> Hi.
>>
>> Please this.
>> http://winpg.jp/~saito/pg_work/OSSP_win32/msvc/
>
>Ahh, a makefile - that makes things somewhat clearer :-)
>
>Thanks - I've updated the build machine so future releases will
>include this fix.
>
>--
>Dave Page
>EnterpriseDB UK: http://www.enterprisedb.com

It seems that link http://winpg.jp/~saito/pg_work/OSSP_win32/msvc/ is no longer available. I am working on uuid-ossp
contribmodule, I want to share my findings with you.Thanks. 
I have downloaded uuid-1.6.2.tar.gz from http://www.ossp.org/pkg/lib/uuid/ . It successfully built with MinGW gcc and
madelibuuid.a, I renamed it to uuid.lib to build uuid-ossp contrib module with visual studio 2005. uuid-ossp give the
followinglinker error with VC2005 i.e. 
  
    Linking...
    Creating library Release\uuid-ossp\uuid-ossp.lib and object Release\uuid-ossp\uuid-ossp.exp
    uuid.lib(uuid_time.o) : error LNK2019: unresolved external symbol ___divdi3 referenced in function
_uuid_time_gettimeofday
    uuid.lib(uuid_time.o) : error LNK2019: unresolved external symbol ___moddi3 referenced in function
_uuid_time_gettimeofday
    uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___umoddi3 referenced in function _fmtint
    uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___udivdi3 referenced in function _fmtint
    .\Release\uuid-ossp\uuid-ossp.dll : fatal error LNK1120: 4 unresolved externals

MinGW libgcc.a contains these symbols and these routines are not implemented in c ( its assembly code to make it fast )
soI extracted _divdi3.o _moddi3.o _umoddi3.o _udivdi3.o (we can add these additional files to uuid.lib to make build
easy)from libgcc.a and link it with uuid-ossp contrib. I have tested generated uuid-ossp contrib it gives the following
resultsthat seems fine i.e. 

    edb=# select uuid_generate_v4();
               uuid_generate_v4
    --------------------------------------
     20ff31ce-77a8-4db6-ac7f-3b55380e46ac
    (1 row)
  
  
    edb=#
    edb=# select uuid_generate_v4()
    edb-# ;
               uuid_generate_v4
    --------------------------------------
     e58c46d5-7161-47ec-8006-f905c6b66a1f
    (1 row)

Any thoughts on this ?.

Best Regards,
Asif Naeem
EnterpriseDB Pakistan: http://www.enterprisedb.com

_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969

Re: UUIDs generated using ossp-uuid on windows not unique

From
Tom Lane
Date:
MUHAMMAD ASIF <anaeem.it@hotmail.com> writes:
> I have downloaded uuid-1.6.2.tar.gz from http://www.ossp.org/pkg/lib/uuid/ . It successfully built with MinGW gcc and
madelibuuid.a, I renamed it to uuid.lib to build uuid-ossp contrib module with visual studio 2005. uuid-ossp give the
followinglinker error with VC2005 i.e.
 
> �� 
> ��� Linking...
> ��� Creating library Release\uuid-ossp\uuid-ossp.lib and object Release\uuid-ossp\uuid-ossp.exp
> ��� uuid.lib(uuid_time.o) : error LNK2019: unresolved external symbol ___divdi3 referenced in function
_uuid_time_gettimeofday
> ��� uuid.lib(uuid_time.o) : error LNK2019: unresolved external symbol ___moddi3 referenced in function
_uuid_time_gettimeofday
> ��� uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___umoddi3 referenced in function _fmtint
> ��� uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___udivdi3 referenced in function _fmtint
> ��� .\Release\uuid-ossp\uuid-ossp.dll : fatal error LNK1120: 4 unresolved externals

Generally, gcc is supposed to arrange for -lgcc to be included
automatically in links if it's needed.  I have seen failures like this
before on other platforms, and it generally had something to do with
using gcc followed by a non-gnu linker; which indeed seems to describe
what you did here.  I would suggest adding -lgcc to your VC project;
or maybe where it actually went missing was in your build of libuuid.

> MinGW libgcc.a contains these symbols and these routines are not
> implemented in c ( its assembly code to make it fast ) so I extracted
> _divdi3.o _moddi3.o _umoddi3.o _udivdi3.o (we can add these additional
> files to uuid.lib to make build easy) from libgcc.a and link it with
> uuid-ossp contrib.

This seems entirely inappropriate; it makes unwarranted assumptions
about which parts of libgcc are needed, and we couldn't ship any such
thing anyhow for license reasons.
        regards, tom lane


Re: UUIDs generated using ossp-uuid on windows not unique

From
"Hiroshi Saito"
Date:
Hi MUHAMMAD-san.

Sorry late reaction...
unfortunately, My machine crashed and was not revitalized.:-(
However, There is a thing of now a few.
http://winpg.jp/~saito/pg_work/OSSP_win32/msvc/

I have a comment from Ralf S. Engelschall.
==
Sorry for being late with the release of OSSP uuid 2.0.0.
Yes, it will be released the next days and will contain the
Win32 support I already prepared a few months ago.
==
It seems that however, he is very busy. ...

Regards,
Hiroshi Saito

----- Original Message ----- 
From: "MUHAMMAD ASIF" <anaeem.it@hotmail.com>

>On Tue, Jun 17, 2008 at 11:17 AM, Hiroshi Saito
><z-saito(at)guitar(dot)ocn(dot)ne(dot)jp> wrote:
>> Hi.
>>
>> Please this.
>> http://winpg.jp/~saito/pg_work/OSSP_win32/msvc/
>
>Ahh, a makefile - that makes things somewhat clearer :-)
>
>Thanks - I've updated the build machine so future releases will
>include this fix.
>
>--
>Dave Page
>EnterpriseDB UK: http://www.enterprisedb.com

It seems that link http://winpg.jp/~saito/pg_work/OSSP_win32/msvc/ is no longer available. I 
am working on uuid-ossp contrib module, I want to share my findings with you.Thanks.
I have downloaded uuid-1.6.2.tar.gz from http://www.ossp.org/pkg/lib/uuid/ . It successfully 
built with MinGW gcc and made libuuid.a, I renamed it to uuid.lib to build uuid-ossp contrib 
module with visual studio 2005. uuid-ossp give the following linker error with VC2005 i.e.

Linking...
Creating library Release\uuid-ossp\uuid-ossp.lib and object Release\uuid-ossp\uuid-ossp.exp
uuid.lib(uuid_time.o) : error LNK2019: unresolved external symbol ___divdi3 referenced in 
function _uuid_time_gettimeofday
uuid.lib(uuid_time.o) : error LNK2019: unresolved external symbol ___moddi3 referenced in 
function _uuid_time_gettimeofday
uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___umoddi3 referenced in 
function _fmtint
uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___udivdi3 referenced in 
function _fmtint
.\Release\uuid-ossp\uuid-ossp.dll : fatal error LNK1120: 4 unresolved externals

MinGW libgcc.a contains these symbols and these routines are not implemented in c ( its 
assembly code to make it fast ) so I extracted _divdi3.o _moddi3.o _umoddi3.o _udivdi3.o (we 
can add these additional files to uuid.lib to make build easy) from libgcc.a and link it 
with uuid-ossp contrib. I have tested generated uuid-ossp contrib it gives the following 
results that seems fine i.e.

edb=# select uuid_generate_v4();
uuid_generate_v4
--------------------------------------
20ff31ce-77a8-4db6-ac7f-3b55380e46ac
(1 row)


edb=#
edb=# select uuid_generate_v4()
edb-# ;
uuid_generate_v4
--------------------------------------
e58c46d5-7161-47ec-8006-f905c6b66a1f
(1 row)

Any thoughts on this ?.

Best Regards,
Asif Naeem
EnterpriseDB Pakistan: http://www.enterprisedb.com


_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969= 



Re: UUIDs generated using ossp-uuid on windows not unique

From
MUHAMMAD ASIF
Date:
<br /> <br /> > To: anaeem.it@hotmail.com<br />> CC: dpage@postgresql.org; z-saito@guitar.ocn.ne.jp;
pgsql-hackers@postgresql.org<br/>> Subject: Re: [HACKERS] UUIDs generated using ossp-uuid on windows not unique <br
/>>Date: Tue, 30 Mar 2010 10:01:50 -0400<br />> From: tgl@sss.pgh.pa.us<br />> <br />> MUHAMMAD ASIF
<anaeem.it@hotmail.com>writes:<br />> > I have downloaded uuid-1.6.2.tar.gz from
http://www.ossp.org/pkg/lib/uuid/. It successfully built with MinGW gcc and made libuuid.a, I renamed it to uuid.lib to
builduuid-ossp contrib module with visual studio 2005. uuid-ossp give the following linker error with VC2005 i.e.<br
/>>>    <br />> >     Linking...<br />> >     Creating library Release\uuid-ossp\uuid-ossp.lib and
objectRelease\uuid-ossp\uuid-ossp.exp<br />> >     uuid.lib(uuid_time.o) : error LNK2019: unresolved external
symbol___divdi3 referenced in function _uuid_time_gettimeofday<br />> >     uuid.lib(uuid_time.o) : error
LNK2019:unresolved external symbol ___moddi3 referenced in function _uuid_time_gettimeofday<br />> >    
uuid.lib(uuid_str.o): error LNK2019: unresolved external symbol ___umoddi3 referenced in function _fmtint<br />>
>    uuid.lib(uuid_str.o) : error LNK2019: unresolved external symbol ___udivdi3 referenced in function _fmtint<br
/>>>     .\Release\uuid-ossp\uuid-ossp.dll : fatal error LNK1120: 4 unresolved externals<br />> <br />>
Generally,gcc is supposed to arrange for -lgcc to be included<br />> automatically in links if it's needed. I have
seenfailures like this<br />> before on other platforms, and it generally had something to do with<br />> using
gccfollowed by a non-gnu linker; which indeed seems to describe<br />> what you did here. I would suggest adding
-lgccto your VC project;<br />> or maybe where it actually went missing was in your build of libuuid.<br />> <br
/><br/><p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">you are right its not good idea to generate binary
withnon compatible tools that may lead to unexpected results and could make debugging worse.<br />> > MinGW
libgcc.acontains these symbols and these routines are not<br />> > implemented in c ( its assembly code to make
itfast ) so I extracted<br />> > _divdi3.o _moddi3.o _umoddi3.o _udivdi3.o (we can add these additional<br />>
>files to uuid.lib to make build easy) from libgcc.a and link it with<br />> > uuid-ossp contrib.<br />>
<br/>> This seems entirely inappropriate; it makes unwarranted assumptions<br />> about which parts of libgcc are
needed,and we couldn't ship any such<br />> thing anyhow for license reasons.<br />> <br />> regards, tom
lane<br/><br /><p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">I dont know much about licencing , I was
assumingthat if we can create application with gcc then we can use parts of gcc according to our will too.  that was a
wrongassumption, thank you for details :).<p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><br />Best
Regards,<pstyle="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">Asif Naeem<p style="MARGIN: 0in; FONT-FAMILY:
Calibri;FONT-SIZE: 11pt"> <br /><hr />Hotmail: Trusted email with Microsoft’s powerful SPAM protection. <a
href="https://signup.live.com/signup.aspx?id=60969"target="_new">Sign up now.</a> 

Re: UUIDs generated using ossp-uuid on windows not unique

From
MUHAMMAD ASIF
Date:
 <br /> > From: z-saito@guitar.ocn.ne.jp<br />> To: anaeem.it@hotmail.com; dpage@postgresql.org<br />> CC:
pgsql-hackers@postgresql.org<br/>> Subject: Re: UUIDs generated using ossp-uuid on windows not unique<br />>
Date:Wed, 31 Mar 2010 01:52:50 +0900<br />> <br />> Hi MUHAMMAD-san.<br />> <br />> Sorry late
reaction...<br/>> unfortunately, My machine crashed and was not revitalized.:-(<br />> However, There is a thing
ofnow a few.<br />> http://winpg.jp/~saito/pg_work/OSSP_win32/msvc/<br />> <br />> I have a comment from Ralf
S.Engelschall.<br />> ==<br />> Sorry for being late with the release of OSSP uuid 2.0.0.<br />> Yes, it will
bereleased the next days and will contain the<br />> Win32 support I already prepared a few months ago.<br />>
==<br/>> It seems that however, he is very busy. ...<br />> <br />> Regards,<br />> Hiroshi Saito<br />>
<br/> Thank you Sir for sharing msvc build. I dont need to use MinGW generated libraries with VisualC project anymore
:).That is nice news that OSSP UUID 2.0.0 will support VisualC. thanks.<br />  <br /> Best Regards,<br /> Asif Naeem<br
/> <br /><br /><hr />Hotmail: Trusted email with powerful SPAM protection. <a
href="https://signup.live.com/signup.aspx?id=60969"target="_new">Sign up now.</a>