lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shad Storhaug (JIRA)" <>
Subject [jira] [Commented] (LUCENENET-593) NullReferenceException in Linux
Date Thu, 10 Aug 2017 18:48:00 GMT


Shad Storhaug commented on LUCENENET-593:

Thanks for the report.

Wow, you indeed must be the first person on Linux that has tested this.

To answer your question, the OS_ARCH constant is only used for diagnostic information in Lucene.Net.
However, in Lucene this string was also used to set the JRE_IS_64BIT boolean constant. We
have done this incorrectly. We should be basing the memory allocation on the underlying OS,
not on the .NET platform architecture.

That doesn't help your case, though. The issue is that `RuntimeInformation.OSArchitecture`
is returning `null`. I suspect this is because we haven't referenced the [System.Runtime.InteropServices.RuntimeInformation](
NuGet package, which doesn't seem to be a required dependency on Windows, but may be required
on Linux. Please try installing this package into your application and let us know if that
solves the issue. If not, this is probably a bug with that API that we need to escalate to

Either way, please leave this issue open, as the above mentioned related bug still needs to
be fixed.

> NullReferenceException in Linux
> -------------------------------
>                 Key: LUCENENET-593
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net Core
>    Affects Versions: Lucene.Net 4.8.0, Lucene.Net 5.0 PCL
>         Environment: Linux (ubuntu 64 bit, maybe all linux variants)
>            Reporter: Warren Falk
> A NullReferenceException on any attempt to query in Linux (ubuntu x64 in my tests)
> I was able to track this down to the following line in Constants.cs
>         {{public static readonly string OS_ARCH = GetEnvironmentVariable("PROCESSOR_ARCHITECTURE",
> Sure enough, PROCESSOR_ARCHITECTURE is not set by default in ubuntu server x64 and when
I set it, there is no failure.
> I would fix this, but I'm not sure what this value is used for, so I am not sure what
the appropriate behavior should be.  Should we try to find the correct architecture here?
 And what is the correct string, "amd64", "x64", "x86_64"?  Or do we really just want to know
the value of that if it is actually not set, should we leave it blank?  The issue is that
the InfoWriter can't write a null, but it could write an empty string.
> I'll submit a pull request if anyone can tell me what correct behavior should be.

This message was sent by Atlassian JIRA

View raw message