Connection to Firebird throws NullReferenceException on mono
------------------------------------------------------------

                 Key: DNET-716
                 URL: http://tracker.firebirdsql.org/browse/DNET-716
             Project: .NET Data provider
          Issue Type: Bug
          Components: ADO.NET Provider
    Affects Versions: 5.6.0.0
         Environment: kubuntu 16.04 x64 + mono 4.6.1 + FirebirdSQL ADO.NET 
driver 5.6.0.0
            Reporter: Anton Kasyanov
            Assignee: Jiri Cincura


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 
https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/commit/7e1e4a1e1eb362c2c96a141a51952b23c9970f79

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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to