Issue Details (XML | Word | Printable)

Key: DNET-716
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Anton Kasyanov
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
.NET Data provider

Connection to Firebird throws NullReferenceException on mono

Created: 11/Nov/16 09:12 AM   Updated: 15/Nov/16 06:58 AM
Component/s: ADO.NET Provider
Affects Version/s:
Fix Version/s:

Environment: kubuntu 16.04 x64 + mono 4.6.1 + FirebirdSQL ADO.NET driver

 Description  « Hide
An attempt to connect to the Firebird databse results in an NullReferenceException with the following stacktrace:

  at System.Text.Encoding.GetBytes (System.String s) [0x00015] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
  at FirebirdSql.Data.Client.Managed.GdsConnection.UserIdentificationData () [0x00141] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.Client.Managed.GdsConnection.Identify (System.String database) [0x00044] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateManagedDatabase (FirebirdSql.Data.FirebirdClient.FbConnectionString options) [0x00042] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateDatabase (FirebirdSql.Data.FirebirdClient.FbConnectionString options) [0x00010] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect () [0x0001e] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager+Pool.CreateNewConnection (FirebirdSql.Data.FirebirdClient.FbConnectionString connectionString) [0x00006] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager+Pool.CreateNewConnectionIfPossibleImpl (FirebirdSql.Data.FirebirdClient.FbConnectionString connectionString) [0x00020] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager+Pool.GetConnection (FirebirdSql.Data.FirebirdClient.FbConnection owner) [0x00024] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Get (FirebirdSql.Data.FirebirdClient.FbConnectionString connectionString, FirebirdSql.Data.FirebirdClient.FbConnection owner) [0x00035] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnection.Open () [0x00086] in <1c49352b896a4a9dba73865ddab7b59e>:0

The exception is thrown at the line

private byte[] UserIdentificationData()
  var user = Encoding.UTF8.GetBytes(Environment.GetEnvironmentVariable("USERNAME"));

of the class FirebirdSql.Data.Client.Managed.GdsConnection

Earlier this method used Environment.UserName in this line, however this was changed by the commit

The USERNAME environment variable is not set in linux bu default. Setting it hides the issue and can be considered as a workaround.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jiri Cincura made changes - 13/Nov/16 01:18 PM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Jiri Cincura made changes - 15/Nov/16 06:58 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Fix Version/s vNext [ 10790 ]
Resolution Fixed [ 1 ]