[Mono-devel-list] All TDS-Clients hang on Solaris 8

Stefan Mecke news.mecke at buchert-wf.de
Mon Mar 8 02:53:18 EST 2004


Hi all!

(New text below) My original message:
>> I successfully compiled Mono 0.30 and the libraries on Solaris 8 and
>> Linux. To access the databases we use I copied and compiled the
>> System.Data samples from the documentation.
>> 
>> The point is: They all work on Linux, but everything that uses TDS
>> (Sybase, MS-SQL and TdsClient) hangs on Solaris. That meens: the program
>> does nothing. When pressing CTRL-C after a while, I get:
> 

Daniel Morgan wrote:
> What archietecture?  sparc, x86?
Well - I forgot to mention: It's Sparc.

> If the arch. is sparc, could it be an endianess problem sending/receiving
> data?

Now I've finally tracked down the problem and it's indeed an endianness 
problem - but with a larger scope.
The Mono.Data.SqlClient and Mono.Data.SybaseClient make heavy use of the 
System.BitConverter-Class to encode the Protocols.

The current implementation of System.BitConverter always returns the 
native endianness of the platform it runs on - that means little-endian 
on x86 and big-endian on Sparc (and AFAIK Power-PC).

Sybase and SQL-Server need little-endian. So communication fails.

The quick and dirty solution for me was to hack the BitConverter-Class 
to return always little-endian, that means to swap the byte order on Sparc.

But the question arises: What is the correct behaviour of BitConverter 
on big-endian? I found nothing in the documentation, only the hint that 
BitConverter is also supported on .NET Compact Framework, which also 
runs on big-endian platforms (xScale?)

Conclusion: If BitConverter is correct, the DataProviders need to be 
fixed (mostly TdsComm.cs) otherwise BitConverter.

Regards
Stefan Mecke







More information about the Mono-devel-list mailing list