pbxt does not compile on 64 bit windows

Bug #345524 reported by wlad
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
High
Oleksandr "Sanja" Byelkin
PBXT
Fix Committed
High
Paul McCullagh

Bug Description

PBXT does not compile on 64 bit windows due to use of inline assembly (64 bit Visual C++ compiler does not support inline assembly)
Suggestion : use win32 atomics (InterlockedAdd etc) instead of assembly

Related branches

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Thanks for the bug report.

As far as I know, the win32 atomics do not support 1 and 2 bytes values. This is the reason for not using them before. But they may be the only option for 64 windows.

Changed in pbxt:
status: New → Confirmed
Changed in pbxt:
importance: Undecided → Low
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

PBXT now compiles without atomic operations, if you define XT_NO_ATOMICS in xt_config.h.

I have not tested this because we currently have no plans to support 64-bit windows.

So this is a request to Vladislav, and everyone else:

Please give us feedback on how important a 64-bit windows version is to you, and we will reconsider our plans for this platform.

In the meantime I am going to set the status to "Won't Fix".

Thanks,

Paul

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

I am setting this bug to "Won't Fix" because we currently have no plans to support 46-bit Windows.

As I mentioned before, this is a request to Vladislav, and everyone else:

Please give us feedback on how important a 64-bit windows version is to you, and we will reconsider our plans for this platform.

Thanks!

Paul

Changed in pbxt:
status: Confirmed → Won't Fix
Revision history for this message
Vladislav Vaintroub (vvaintroub) wrote :

Windows 64 bit is very important (specifically x64), now 4 years after the first x64 release.
Seriously, I would not consider a DBMS product that does not have possibility to address more than 4GB RAM a solid one (I do not plan to become a Linux convert too:)

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

This bug will be fixed if required by MariaDB.

Please provide feedback on the priority. Access to a 64-bit Windows system would also help us :)

Revision history for this message
Oleksandr "Sanja" Byelkin (sanja-byelkin) wrote :

Sorry, but it is vmware inside our intranet, so access is quite problematic

Changed in maria:
importance: Undecided → High
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

I have change the priority of this bug because a fix is required for MariaDB.

Changed in pbxt:
assignee: nobody → Paul McCullagh (paul-mccullagh)
importance: Low → High
status: Won't Fix → In Progress
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Sanja,

What compiler flag can I used to detect compilation on 64-bit Windows?

Revision history for this message
Hakan Küçükyılmaz (hakan-askmonty) wrote :

from include/config-win.h

if defined(_WIN64) || defined(WIN64)

Revision history for this message
Vladislav Vaintroub (vvaintroub) wrote :

_WIN64 is 64 bit, as documented as predefined macro (first google hit for "microsoft compiler predefined macros" brings
http://msdn.microsoft.com/en-us/library/b0084kay(VS.80).aspx )

WIN64 is not defined.

64bit Windows exists for 2 hardware architectures: AMD64 (aka x86_64 aka x64, commonly used) and Itanium (aka IA64, relatively seldom, MySQL is not ported for it).

_M_X64 is defined on x64
_M_IA64 is defined on Itanium

Changed in maria:
assignee: nobody → Oleksandr "Sanja" Byelkin (sanja-byelkin)
status: New → In Progress
tags: added: windows
tags: added: compile
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

A fix for this bug has been pushed to PBXT 1.0.09f. 64-bit Windows should now compile and run. However, atomic op based locking has not been implemented.

Changed in pbxt:
status: In Progress → Fix Committed
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Oleksandr and Hakan,

I have pushed a fix for this bug to: lp:~paul-mccullagh/maria/maria-pbxt-rc3

Could you please confirm that this version compiles and runs on 64-bit Windows.

I would like to confirm that this problem is fixed before I propose PBXT RC3 for merging.

Thanks!

Paul

Revision history for this message
Oleksandr "Sanja" Byelkin (sanja-byelkin) wrote :
Download full text (4.6 KiB)

Hi!
Here is what comopiler found:
------ Build started: Project: pbxt, Configuration: Debug x64 ------
Compiling...
ha_pbxt.cc
.\src\ha_pbxt.cc(1079) : warning C4267: 'argument' : conversion from 'size_t' to 'uint', possible loss of data
.\src\ha_pbxt.cc(3857) : warning C4267: '=' : conversion from 'size_t' to 'ulong', possible loss of data
.\src\ha_pbxt.cc(5550) : warning C4267: 'argument' : conversion from 'size_t' to 'uint32', possible loss of data
.\src\ha_pbxt.cc(5827) : error C2121: '#' : invalid character : possibly the result of a macro expansion
.\src\ha_pbxt.cc(5827) : error C2065: 'ifdef' : undeclared identifier
.\src\ha_pbxt.cc(5827) : error C2143: syntax error : missing '}' before 'constant'
.\src\ha_pbxt.cc(5827) : error C3852: '<unnamed-type-mysql_sysvar_support_xa>::def_val' having type 'const char': aggregate initialization could not initialize this member
        const members cannot be default initialized unless their type has a user defined default constructor
.\src\ha_pbxt.cc(5827) : error C2512: '<unnamed-type-mysql_sysvar_support_xa>::<unnamed-type-mysql_sysvar_support_xa>' : no appropriate default constructor available
.\src\ha_pbxt.cc(5827) : error C2078: too many initializers
.\src\ha_pbxt.cc(5827) : error C2143: syntax error : missing ';' before 'constant'
.\src\ha_pbxt.cc(5827) : error C2059: syntax error : 'constant'
.\src\ha_pbxt.cc(5827) : error C2143: syntax error : missing ';' before '}'
.\src\ha_pbxt.cc(5827) : error C2059: syntax error : '}'
.\src\ha_pbxt.cc(5853) : fatal error C1020: unexpected #endif
Build log was saved at "file://e:\maria\bzr\maria-pbxtrc3-test\storage\pbxt\pbxt.dir\Debug\BuildLog.htm"
pbxt - 11 error(s), 3 warning(s)
------ Build started: Project: mysqlserver, Configuration: Debug x64 ------
Compiling...
ha_innodb.cc
..\storage\xtradb\handler\ha_innodb.cc(64) : warning C4005: 'MYSQL_SERVER' : macro redefinition
        command-line arguments : see previous definition of 'MYSQL_SERVER'
..\storage\xtradb\handler\ha_innodb.cc(4178) : warning C4244: 'argument' : conversion from 'ulint' to 'uint', possible loss of data
..\storage\xtradb\handler\ha_innodb.cc(4179) : warning C4244: 'argument' : conversion from 'ulint' to 'uint', possible loss of data
..\storage\xtradb\handler\ha_innodb.cc(4912) : warning C4244: '=' : conversion from 'ulint' to 'int', possible loss of data
..\storage\xtradb\handler\ha_innodb.cc(6854) : warning C4244: '=' : conversion from 'ulint' to 'int', possible loss of data
..\storage\xtradb\handler\ha_innodb.cc(8444) : warning C4267: '=' : conversion from 'size_t' to 'uint', possible loss of data
..\storage\xtradb\handler\ha_innodb.cc(8446) : warning C4267: '=' : conversion from 'size_t' to 'uint', possible loss of data
..\storage\xtradb\handler\ha_innodb.cc(10134) : error C2440: 'initializing' : cannot convert from 'ulint *' to 'unsigned long *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ha_pbxt.cc
..\storage\pbxt\src\ha_pbxt.cc(1079) : warning C4267: 'argument' : conversion from 'size_t' to 'uint', possible loss of data
..\storage\pbxt\src\ha_pbxt.cc(3857) : warnin...

Read more...

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Oleksandr,

Thanks for the compile run.

I have fixed the warnings (pushed to maria-pbxt-rc3), but this error is strange:

.\src\ha_pbxt.cc(5827) : error C2121: '#' : invalid character : possibly the result of a macro expansion

On line 5827 we have:

 NULL, NULL, FALSE);

So this is a special problem which I cannot diagnose remotely (unless I am missing something!).

Is there any way I can get onto the machine to have a look?

Please let me know in a private e-mail if this is possible.

Thanks,

Paul

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Oleksandr,

Ignore my last comment. Vlad has just pointed out the problem to me. The Windows compiler does not handle #ifdef in macros.

I will push a fix shortly...

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Oleksandr,

The problems in ha_pbxt.cc should be fixed now.

Please try...

Revision history for this message
Oleksandr "Sanja" Byelkin (sanja-byelkin) wrote :

Hi!

Yes it fixed the problems. Thank you!

Revision history for this message
Colin Charles (ccharles) wrote :

According to http://primebase.org/download/ChangeLog, this is fixed in 1.0.09f RC3 - 2009-11-30, and MariaDB-5.1.42 uses 1.0.09g so this bug is complete.

Atomic operations are the only thing that you don't do on 64-bit windows now

Changed in maria:
status: In Progress → Fix Committed
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers