[Mono-bugs] [Bug 53972][Nor] Changed - Mono.Data.Tds not Endian safe

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri May 20 19:15:03 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer at users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=53972

--- shadow/53972	2004-05-10 16:02:50.000000000 -0400
+++ shadow/53972.tmp.19622	2005-05-20 19:15:03.000000000 -0400
@@ -0,0 +1,112 @@
+Bug#: 53972
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Solaris 8
+OS Details: 
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
+Priority: Normal
+Component: Sys.Data
+AssignedTo: rodrigo at novell.com                            
+ReportedBy: news.mecke at buchert-wf.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono.Data.Tds not Endian safe
+
+Description of Problem:
+Trying to execute a program that uses TDS (either SqlClient, SybaseClient
+or TdsClient on Solaris) leads to a hang. When pressing CTRL-C, you get an
+error message. It works fine on windows an Linux (same source, same assambly).
+
+Steps to reproduce the problem:
+1. Copy any of the sources for the Data-Providers, modify
+hostname/Database), compile, execute.
+2. Start on Solaris: mint TestTDS.exe
+
+Actual Results:
+1. Nothing (hangs)
+2. (after pressing CTRL-C):
+Unhandled Exception: System.NullReferenceException: Quit
+#0: 0x00000            in System.Net.Sockets.Socket::Receive_internal
+([14/0xe] [O:74a6f0] [0] [8] [0] )
+#1: 0x00054 call       in System.Net.Sockets.Socket::Receive ([O:74a6f0]
+[0] [8] [0] )
+#2: 0x00059 callvirt   in System.Net.Sockets.NetworkStream::Read
+([O:74a6f0] [0] [8] )
+#3: 0x00018 callvirt   in Mono.Data.Tds.Protocol.TdsComm::GetPhysicalPacket ()
+#4: 0x00059 callvirt   in Mono.Data.Tds.Protocol.TdsComm::GetBytes ([12544]
+[0] )
+#5: 0x0005a callvirt   in Mono.Data.Tds.Protocol.TdsComm::GetString
+([12544] [0] )
+#6: 0x00019 callvirt   in Mono.Data.Tds.Protocol.TdsComm::GetString ([12544] )
+#7: 0x0008e callvirt   in Mono.Data.Tds.Protocol.Tds::ProcessMessage ([171] )
+#8: 0x00286 callvirt   in Mono.Data.Tds.Protocol.Tds::ProcessSubPacket ()
+#9: 0x0001d callvirt   in Mono.Data.Tds.Protocol.Tds::NextResult ()
+#10: 0x00006 callvirt   in Mono.Data.Tds.Protocol.Tds::SkipToEnd ()
+#11: 0x00461 callvirt   in Mono.Data.Tds.Protocol.Tds42::Connect ([O:55ee0] )
+#12: 0x00145 callvirt   in Mono.Data.TdsClient.TdsConnection::Open ()
+#13: 0x0000e callvirt   in .Test::Main ([O:4b860] )
+
+
+Unhandled Exception: System.NullReferenceException: Quit
+#0: 0x00000            in System.Net.Sockets.Socket::Receive_internal
+([14/0xe] [O:74a6f0] [0] [8] [0] )
+#1: 0x00054 call       in System.Net.Sockets.Socket::Receive ([O:74a6f0]
+[0] [8] [0] )
+#2: 0x00059 callvirt   in System.Net.Sockets.NetworkStream::Read
+([O:74a6f0] [0] [8] )
+#3: 0x00018 callvirt   in Mono.Data.Tds.Protocol.TdsComm::GetPhysicalPacket ()
+#4: 0x00059 callvirt   in Mono.Data.Tds.Protocol.TdsComm::GetBytes ([12544]
+[0] )
+#5: 0x0005a callvirt   in Mono.Data.Tds.Protocol.TdsComm::GetString
+([12544] [0] )
+#6: 0x00019 callvirt   in Mono.Data.Tds.Protocol.TdsComm::GetString ([12544] )
+#7: 0x0008e callvirt   in Mono.Data.Tds.Protocol.Tds::ProcessMessage ([171] )
+#8: 0x00286 callvirt   in Mono.Data.Tds.Protocol.Tds::ProcessSubPacket ()
+#9: 0x0001d callvirt   in Mono.Data.Tds.Protocol.Tds::NextResult ()
+#10: 0x00006 callvirt   in Mono.Data.Tds.Protocol.Tds::SkipToEnd ()
+#11: 0x00461 callvirt   in Mono.Data.Tds.Protocol.Tds42::Connect ([O:55ee0] )
+#12: 0x00145 callvirt   in Mono.Data.TdsClient.TdsConnection::Open ()
+#13: 0x0000e callvirt   in .Test::Main ([O:4b860] )
+
+
+Expected Results:
+The contents of the table.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+Seems to be Solaris specific, since same assembly runs fine on windows on
+linux. Additionally, the postgres- and mysql-providers work fine on solaris.
+
+------- Additional Comments From andy at shambolic.net  2004-05-10 16:02 -------
+Can confirm that this problem also exists on Mac OS X - a simple program that attempts 
+to open a SqlConnection to an MS-SQL 2000 database hangs forever (using the JIT, fails 
+after about 10 seconds with a SIGILL; with mint, never returns). The same compiled 
+program runs fine on linux.
+
+In a posting to mono-devel-list, Stefan Mecke, who originated this bugzilla entry, 
+confirmed that the issue was related to the use of System.BitConverter in TdsComm.cs and 
+possibly elsewhere:
+
+http://lists.ximian.com/archives/public/mono-devel-list/2004-March/004410.html
+
+Apparently BitConverter uses platform-endianness, whereas the TDS protocol requires 
+little-endian byte encoding on all platforms.
+
+
+------- Additional Comments From bmaurer at users.sf.net  2005-05-20 19:15 -------
+2004-08-14 Geoff Norton <gnorton at customerdna.com>
+
+	* TdsComm.cs: 
+          Tds70.cs: 
+                Make Tds70 work on Big Endian machines.
+		BitConverter uses unsafe and returns things in host order; we need to 
+		swap some values to put them back into the approrpiate order for the
+wire.
+
+Should have fixed this bug. 


More information about the mono-bugs mailing list