Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

endian oddity in cluster glue

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


P at draigBrady

Sep 5, 2011, 8:02 AM

Post #1 of 4 (300 views)
Permalink
endian oddity in cluster glue

I was looking at extricating some logic from cluster-glue-libs
and noticed strangeness wrt the endianess checking.
CONFIG_BIG_ENDIAN is defined on my x86 machine, which is
due to configure.ac referencing a non existent byteorder_test.c

To fix this I would suggest the following patch.
However, I'm wary that this may introduce compatibility
issues with generated md5 sums which is the only code
that inspects the above defines. If we stick with BIG_ENDIAN
always then there will be interoperability issues between
x86 and ppc hosts for example (which may not be an issue)?

cheers,
Pádraig.

diff -r 177de02442d5 configure.ac
--- a/configure.ac Wed Aug 17 18:00:09 2011 +0200
+++ b/configure.ac Mon Sep 05 15:49:12 2011 +0100
@@ -466,11 +466,7 @@
[AC_MSG_RESULT(fail); AC_DEFINE(GETPID_INCONSISTENT, 1 , [pid inconsistent])],)
LIBS=$ac_save_LIBS

-dnl check byte order
-AC_MSG_CHECKING(for byteorder)
-AC_TRY_RUN(`cat $srcdir/config/byteorder_test.c`,
-[AC_MSG_RESULT(little-endian); AC_DEFINE(CONFIG_LITTLE_ENDIAN, 1, [little-endian])],
-[AC_MSG_RESULT(big-endian); AC_DEFINE(CONFIG_BIG_ENDIAN, 1, [big-endian])],)
+AC_C_BIGENDIAN([AC_DEFINE(CONFIG_BIG_ENDIAN, 1, [big])], [AC_DEFINE(CONFIG_LITTLE_ENDIAN, 1, [little])])
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


alanr at unix

Sep 6, 2011, 8:14 AM

Post #2 of 4 (286 views)
Permalink
Re: endian oddity in cluster glue [In reply to]

On 09/05/2011 09:02 AM, Pádraig Brady wrote:
> I was looking at extricating some logic from cluster-glue-libs
> and noticed strangeness wrt the endianess checking.
> CONFIG_BIG_ENDIAN is defined on my x86 machine, which is
> due to configure.ac referencing a non existent byteorder_test.c
>
> To fix this I would suggest the following patch.
> However, I'm wary that this may introduce compatibility
> issues with generated md5 sums which is the only code
> that inspects the above defines. If we stick with BIG_ENDIAN
> always then there will be interoperability issues between
> x86 and ppc hosts for example (which may not be an issue)?
>
> cheers,
> Pádraig.

Strange as it seems, there are some mixed PPC and x86 clusters out there...

--
Alan Robertson<alanr [at] unix>

"Openness is the foundation and preservative of friendship... Let me claim from you at all times your undisguised opinions." - William Wilberforce
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


msoffen at iso-ne

Sep 6, 2011, 8:25 AM

Post #3 of 4 (280 views)
Permalink
Re: endian oddity in cluster glue [In reply to]

Well.. There is some reasoning for this extreme mixing of hardware. If there is an OS bug that could take out, say Linux, it isn't likely that the same exploit would work on a totally different hardware architecture.


Matthew Soffen
Lead Computer Scientist
ISO New England - http://www.iso-ne.com/



-----Original Message-----
From: linux-ha-dev-bounces [at] lists [mailto:linux-ha-dev-bounces [at] lists] On Behalf Of Alan Robertson
Sent: Tuesday, September 06, 2011 11:15 AM
To: High-Availability Linux Development List
Subject: Re: [Linux-ha-dev] endian oddity in cluster glue

On 09/05/2011 09:02 AM, Pádraig Brady wrote:
> I was looking at extricating some logic from cluster-glue-libs
> and noticed strangeness wrt the endianess checking.
> CONFIG_BIG_ENDIAN is defined on my x86 machine, which is
> due to configure.ac referencing a non existent byteorder_test.c
>
> To fix this I would suggest the following patch.
> However, I'm wary that this may introduce compatibility
> issues with generated md5 sums which is the only code
> that inspects the above defines. If we stick with BIG_ENDIAN
> always then there will be interoperability issues between
> x86 and ppc hosts for example (which may not be an issue)?
>
> cheers,
> Pádraig.

Strange as it seems, there are some mixed PPC and x86 clusters out there...

--
Alan Robertson<alanr [at] unix>

"Openness is the foundation and preservative of friendship... Let me claim from you at all times your undisguised opinions." - William Wilberforce
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


P at draigBrady

Sep 16, 2011, 9:04 AM

Post #4 of 4 (272 views)
Permalink
Re: endian oddity in cluster glue [In reply to]

On 09/05/2011 04:02 PM, Pádraig Brady wrote:
> I was looking at extricating some logic from cluster-glue-libs
> and noticed strangeness wrt the endianess checking.
> CONFIG_BIG_ENDIAN is defined on my x86 machine, which is
> due to configure.ac referencing a non existent byteorder_test.c
>
> To fix this I would suggest the following patch.
> However, I'm wary that this may introduce compatibility
> issues with generated md5 sums which is the only code
> that inspects the above defines. If we stick with BIG_ENDIAN
> always then there will be interoperability issues between
> x86 and ppc hosts for example (which may not be an issue)?

Actually the code invoked to swap on little endian machines
turns out to be an expensive NOOP. Hence the patch (which
I'm sending separately from hg), is valid and just a cleanup
and on little endian machines a performance improvement.
There should be no functional difference.

cheers,
Pádraig.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.