thermofisherlsms / RawFileReader

Other
46 stars 18 forks source link

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

Open chhh opened 2 years ago

chhh commented 2 years ago

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 commented 2 years ago

Dmitry,

I haven’t tried the latest version of MacOS, but I know in the past that I haven’t had an issues in reading a RAW file on MacOS. Let me give it a try and get back to you. It may not be right away.

Jim

From: Dmitry Avtonomov @.> Sent: Wednesday, April 27, 2022 1:28 AM To: thermofisherlsms/RawFileReader @.> Cc: Subscribed @.***> Subject: [thermofisherlsms/RawFileReader] Reader 5.0.0.71 doesn't work on MacOS (is fine on Win and Linux) (Issue #2)

CAUTION: This email originated from outside of Thermo Fisher Scientific. If you believe it to be suspicious, report using the Report Phish button in Outlook or send to @.***

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-notificationshttps://urldefense.proofpoint.com/v2/url?u=https-3A__docs.microsoft.com_en-2Dus_dotnet_framework_app-2Ddomains_how-2Dto-2Dreceive-2Dfirst-2Dchance-2Dexception-2Dnotifications&d=DwMCaQ&c=q6k2DsTcEGCcCb_WtVSz6hhIl8hvYssy7sH8ZwfbbKU&r=1W0yYkGl-IRzjDS5xSAn50se4hwvRVAdrlUA7-lc4w0&m=kncXSojhfjpHbDOmv7b8HbHksWsIzC9J_d0Bvtys_AfOcg4GL01IAVieGkiHTEZC&s=jK6HDenZpse3QnnKj-TAGMg4i65qmbkWg-_R-d8XQmk&e=):

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?

— Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_thermofisherlsms_RawFileReader_issues_2&d=DwMCaQ&c=q6k2DsTcEGCcCb_WtVSz6hhIl8hvYssy7sH8ZwfbbKU&r=1W0yYkGl-IRzjDS5xSAn50se4hwvRVAdrlUA7-lc4w0&m=kncXSojhfjpHbDOmv7b8HbHksWsIzC9J_d0Bvtys_AfOcg4GL01IAVieGkiHTEZC&s=WUu9mSYzQv0ZCwfAkX0PtYVlYH_tiBqlnLyG8t3U8uY&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AENV5LKHNCEZ7AXWPZW2H2DVHD3A3ANCNFSM5UOKEEOA&d=DwMCaQ&c=q6k2DsTcEGCcCb_WtVSz6hhIl8hvYssy7sH8ZwfbbKU&r=1W0yYkGl-IRzjDS5xSAn50se4hwvRVAdrlUA7-lc4w0&m=kncXSojhfjpHbDOmv7b8HbHksWsIzC9J_d0Bvtys_AfOcg4GL01IAVieGkiHTEZC&s=hWhdwdcD-_k3hUPkoVoMqqjaKkukjBPQCokzGna5HOQ&e=. You are receiving this because you are subscribed to this thread.Message ID: @.***>

chhh commented 2 years ago

Thank you Jim!

On Wed, Apr 27, 2022 at 8:42 AM jshofstahl @.***> wrote:

Dmitry,

I haven’t tried the latest version of MacOS, but I know in the past that I haven’t had an issues in reading a RAW file on MacOS. Let me give it a try and get back to you. It may not be right away.

Jim

From: Dmitry Avtonomov @.> Sent: Wednesday, April 27, 2022 1:28 AM To: thermofisherlsms/RawFileReader @.> Cc: Subscribed @.***> Subject: [thermofisherlsms/RawFileReader] Reader 5.0.0.71 doesn't work on MacOS (is fine on Win and Linux) (Issue #2)

CAUTION: This email originated from outside of Thermo Fisher Scientific. If you believe it to be suspicious, report using the Report Phish button in Outlook or send to @.***

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 < https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.microsoft.com_en-2Dus_dotnet_framework_app-2Ddomains_how-2Dto-2Dreceive-2Dfirst-2Dchance-2Dexception-2Dnotifications&d=DwMCaQ&c=q6k2DsTcEGCcCb_WtVSz6hhIl8hvYssy7sH8ZwfbbKU&r=1W0yYkGl-IRzjDS5xSAn50se4hwvRVAdrlUA7-lc4w0&m=kncXSojhfjpHbDOmv7b8HbHksWsIzC9J_d0Bvtys_AfOcg4GL01IAVieGkiHTEZC&s=jK6HDenZpse3QnnKj-TAGMg4i65qmbkWg-_R-d8XQmk&e=>):

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?

— Reply to this email directly, view it on GitHub< https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_thermofisherlsms_RawFileReader_issues_2&d=DwMCaQ&c=q6k2DsTcEGCcCb_WtVSz6hhIl8hvYssy7sH8ZwfbbKU&r=1W0yYkGl-IRzjDS5xSAn50se4hwvRVAdrlUA7-lc4w0&m=kncXSojhfjpHbDOmv7b8HbHksWsIzC9J_d0Bvtys_AfOcg4GL01IAVieGkiHTEZC&s=WUu9mSYzQv0ZCwfAkX0PtYVlYH_tiBqlnLyG8t3U8uY&e=>, or unsubscribe< https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AENV5LKHNCEZ7AXWPZW2H2DVHD3A3ANCNFSM5UOKEEOA&d=DwMCaQ&c=q6k2DsTcEGCcCb_WtVSz6hhIl8hvYssy7sH8ZwfbbKU&r=1W0yYkGl-IRzjDS5xSAn50se4hwvRVAdrlUA7-lc4w0&m=kncXSojhfjpHbDOmv7b8HbHksWsIzC9J_d0Bvtys_AfOcg4GL01IAVieGkiHTEZC&s=hWhdwdcD-_k3hUPkoVoMqqjaKkukjBPQCokzGna5HOQ&e=>.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/thermofisherlsms/RawFileReader/issues/2#issuecomment-1111157772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2K7RWCYGLO7CRBCIKMLLVHFN5XANCNFSM5UOKEEOA . You are receiving this because you authored the thread.Message ID: @.***>