Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader 5.0.0.71 doesn't work on MacOS (is fine on Win and Linux) #2

Open
chhh opened this issue Apr 27, 2022 · 2 comments
Open

Reader 5.0.0.71 doesn't work on MacOS (is fine on Win and Linux) #2

chhh opened this issue Apr 27, 2022 · 2 comments

Comments

@chhh
Copy link

chhh commented Apr 27, 2022

Using .NetStandard 2.0 nuget packages version 5.0.0.71 from this repo I can't read RAW files on MacOS.

Try creating a reader and getting any information. The file error information reported by the reader is not informative (code 2).
So I installed a FirstChanceException handler (https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-receive-first-chance-exception-notifications):

AppDomain.CurrentDomain.FirstChanceException += (_, e) => {
        Console.WriteLine($"FirstChanceException event #{Interlocked.Increment(ref _firstChanceCount)}" +
                          $"\tType: {e.Exception.GetType().Name}\n" +
                          $"\tSource: {e.Exception.Source}\n" +
                          $"\tMessage: {e.Exception.Message}");
      };

And the output is:

FirstChanceException event #1  Type: PlatformNotSupportedException
    Source: System.IO.MemoryMappedFiles
    Message: Named maps are not supported.
FirstChanceException event #2  Type: NullReferenceException
    Source: ThermoFisher.CommonCore.RawFileReader
    Message: Object reference not set to an instance of an object.
FirstChanceException event #3  Type: TargetInvocationException
    Source: System.Private.CoreLib
    Message: Exception has been thrown by the target of an invocation.
FirstChanceException event #4  Type: NUnitException
    Source: nunit.framework
    Message: Rethrown

So looks like there's some issue with memory mapped files. But it all works fine on Linux. I guess, should be working on MacOS as well.

The stacktrace does show that it's somewhere in RawFileLoader's constructor. I didn't understand what the error was about at first, and then read that named memory mapped files are a windows-only feature. However, at the same time, the reader works fine on Linux. Can it be that this constructor has some Windows-specific code path that is erroneously being taken on Mac, but some other code path is taken when running on Linux?

@jshofstahl
Copy link
Collaborator

jshofstahl commented Apr 27, 2022 via email

@chhh
Copy link
Author

chhh commented Apr 27, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants