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

Unable to load shared library 'MonoPosixHelper' or one of its dependencies #223

Closed
JonDouglas opened this issue Mar 14, 2023 · 22 comments · Fixed by #346
Closed

Unable to load shared library 'MonoPosixHelper' or one of its dependencies #223

JonDouglas opened this issue Mar 14, 2023 · 22 comments · Fixed by #346
Assignees
Labels
z-aa-triaged (Deprecated label) This issue has been triaged by AA z-bug (Deprecated label) Something isn't working z-P1 (Deprecated label) Priority 1 on bugs

Comments

@JonDouglas
Copy link
Member

I'm unable to use the sbom-tool on macOS Ventura 13.2.1 as the tool immediately fails with the latest version of 0.3.3 with the following message:

Encountered error while running ManifestTool generation workflow. Error: Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMonoPosixHelper, 0x0001): tried: 'libMonoPosixHelper' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache), 'libMonoPosixHelper' (no such file), '/usr/local/lib/libMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache)

Might be related to #114 and #123

@edgarrs edgarrs added z-bug (Deprecated label) Something isn't working z-P1 (Deprecated label) Priority 1 on bugs z-aa-triaged (Deprecated label) This issue has been triaged by AA labels Mar 14, 2023
@sebasgomez238
Copy link
Collaborator

sebasgomez238 commented Mar 17, 2023

Hi @JonDouglas, could you describe how you are attempting to use the tool as well as the version of the tool? I was unable to reproduce the issue on an Intel Mac also running macOS Ventura 13.2.1.

@JonDouglas
Copy link
Member Author

JonDouglas commented Mar 20, 2023

Here's some more details. Might be ARM/m1 related.

Apple M1 Max
macOS 13.2.1

Reproduction:

  1. dotnet tool install --global Microsoft.Sbom.DotNetTool
  2. sbom-tool generate -b <drop path> -bc <build components path> -pn <package name> -pv <package version> -ps <package supplier> -nsb <namespace uri base>
  3. Encountered error while running ManifestTool generation workflow. Error: Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMonoPosixHelper, 0x0001): tried: 'libMonoPosixHelper' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache), 'libMonoPosixHelper' (no such file), '/usr/local/lib/libMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache)

@benjaminkuehn
Copy link

Same problem on my machine.

Apple M2 Pro
macOS 13.2.1

@edgarrs edgarrs added z-P2 (Deprecated label) Priority 2 and removed z-P1 (Deprecated label) Priority 1 on bugs labels May 1, 2023
@ochimo
Copy link

ochimo commented Jun 15, 2023

Same issue Apple M1 Pro / macOS 13.4. Happy to help diagnose / test fix if helpful.

@Hackmodford
Copy link

Same issue Apple M1 Max / macOS 13.4.1

@sebasgomez238
Copy link
Collaborator

Hello @Hackmodford what method are you using to download the tool? I was able to run the tool on an M1/macOS 13.4.1 by using the following commands:

curl -Lo sbom-tool https:/microsoft/sbom-tool/releases/latest/download/sbom-tool-osx-x64
chmod +x sbom-tool

Could you try this as a workaround and provide us with how you are currently trying to install the tool. Thanks.

@Hackmodford
Copy link

I was using the global dotnet tool version. I am getting farther with the file you provided.

@shawnfunke
Copy link
Contributor

@sebasgomez238 this error occurs if the incorrect runtime was specified during the build process. This issue only affects ARM based Macs.

dotnet publish src/Microsoft.Sbom.Tool/Microsoft.Sbom.Tool.csproj --configuration Release --output bin --runtime osx-arm64 -p:SelfContained=true -p:OFFICIAL_BUILD=true -p:MinVerVersionOverride=1.1.8 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false

If the above command is used to build the CLI it will result in the error below. I've set the DYLD_PRINT_LIBRARIES environment variable to 1 for the output below.

...
dyld[38737]: <AEA11273-BFDB-37A4-8244-9D973CCF15D9> /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
dyld[38737]: <E2CBFE03-3A04-37F9-99D3-E96E5D8D5666> /usr/lib/libTLE.dylib
Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMonoPosixHelper, 0x0001): tried: 'libMonoPosixHelper' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache), 'libMonoPosixHelper' (no such file), '/usr/local/lib/libMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache)

If instead of the runtime being set to osx-arm64 its set as osx-x64 the CLI will output the expected result as seen below.

...
dyld[38880]: <B6D439B3-A94A-37D9-A777-F474BD3A8E01> /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
dyld[38880]: <6AAC47E0-B8C6-3221-A11A-727025280815> /usr/lib/libTLE.dylib
dyld[38880]: <FA974211-6F09-333A-A45D-17DF6609F47B> /Users/shawnfunke/.net/Microsoft.Sbom.Tool/sY7iBK+dyxsgLMO6tdAQ+lC9Bvag8jg=/libMonoPosixHelper.dylib
[INFO] Log file: /private/tmp/GovCompDisc_Log_20230720201043702.log 
[INFO] Run correlation id: 495a6034-b732-4e3a-bc41-107f3a43a659 

...

The issue here is that the Mono.Posix.NETStandard 1 NuGet package that is being used here does only include a osx runtime, no specific ARM runtime exist. This results in the dynamic library not being included in the final executable even if IncludeNativeLibrariesForSelfExtract is set to true whenever the runtime is set to ARM during the build process.

shawnfunke@shawnfunke-mbp:~/.nuget/packages/mono.posix.netstandard/1.0.0$ tree
.
├── lib
│   └── net40
│       └── Mono.Posix.NETStandard.dll
├── mono.posix.netstandard.1.0.0.nupkg
├── mono.posix.netstandard.1.0.0.nupkg.sha512
├── mono.posix.netstandard.nuspec
├── ref
│   ├── net40
│   │   └── Mono.Posix.NETStandard.dll
│   └── netstandard2.0
│       └── Mono.Posix.NETStandard.dll
└── runtimes
    ├── linux-arm
    │   ├── lib
    │   │   └── netstandard2.0
    │   │       └── Mono.Posix.NETStandard.dll
    │   └── native
    │       └── libMonoPosixHelper.so
    ├── linux-arm64
    │   ├── lib
    │   │   └── netstandard2.0
    │   │       └── Mono.Posix.NETStandard.dll
    │   └── native
    │       └── libMonoPosixHelper.so
    ├── linux-armel
    │   ├── lib
    │   │   └── netstandard2.0
    │   │       └── Mono.Posix.NETStandard.dll
    │   └── native
    │       └── libMonoPosixHelper.so
    ├── linux-x64
    │   ├── lib
    │   │   └── netstandard2.0
    │   │       └── Mono.Posix.NETStandard.dll
    │   └── native
    │       └── libMonoPosixHelper.so
    ├── linux-x86
    │   ├── lib
    │   │   └── netstandard2.0
    │   │       └── Mono.Posix.NETStandard.dll
    │   └── native
    │       └── libMonoPosixHelper.so
    ├── osx
    │   ├── lib
    │   │   └── netstandard2.0
    │   │       └── Mono.Posix.NETStandard.dll
    │   └── native
    │       └── libMonoPosixHelper.dylib
    ├── win-x64
    │   ├── lib
    │   │   └── netstandard2.0
    │   │       └── Mono.Posix.NETStandard.dll
    │   └── native
    │       ├── MonoPosixHelper.dll
    │       └── libMonoPosixHelper.dll
    └── win-x86
        ├── lib
        │   └── netstandard2.0
        │       └── Mono.Posix.NETStandard.dll
        └── native
            ├── MonoPosixHelper.dll
            └── libMonoPosixHelper.dll

39 directories, 24 files

Footnotes

  1. https://nuget.info/packages/Mono.Posix.NETStandard/1.0.0

@ryanbrandenburg
Copy link
Contributor

@sebasgomez238 we think you've been working on this, is there an update?

@edgarrs edgarrs added z-P1 (Deprecated label) Priority 1 on bugs and removed z-P2 (Deprecated label) Priority 2 labels Aug 28, 2023
@sebasgomez238
Copy link
Collaborator

sebasgomez238 commented Aug 30, 2023

@shawnfunke Thank you for the details! We have a branch that has a fix for this if you're willing to try it out. https:/microsoft/sbom-tool/tree/users/segomez/mono-posix-update

@shawnfunke
Copy link
Contributor

@sebasgomez238 that doesn't seem to work. I've compiled it locally and ran the following command:

./bin/Microsoft.Sbom.Tool generate -b ~/tmp/sbom-tool/ -bc ~/tmp/sbom-tool/ -pn TestProject -pv 1.2.3 -ps ASD -nsb http://null.shawnfunke.dev

This is the output from the command execution:

dyld[4982]: <C9D90EF5-4C5E-39FC-9787-932452A299BE> /Users/shawnfunke/tmp/sbom-tool/bin/Microsoft.Sbom.Tool
dyld[4982]: <5EBBC515-34F1-3A95-B963-69052AF36396> /usr/lib/libz.1.dylib
dyld[4982]: <422AACAD-6E3A-37DB-B088-17F56C545FEC> /usr/lib/libSystem.B.dylib
dyld[4982]: <FC36C110-DC4A-3131-8694-2F23E42BDA80> /usr/lib/system/libcache.dylib
dyld[4982]: <2B973778-B3AC-334C-839A-235B1B0310D8> /usr/lib/system/libcommonCrypto.dylib
dyld[4982]: <C15B1BD0-04BE-3A79-86A9-B2F3E4375878> /usr/lib/system/libcompiler_rt.dylib
dyld[4982]: <4D867984-354A-3147-95D1-4C5C0886D1AE> /usr/lib/system/libcopyfile.dylib
dyld[4982]: <4CEC1F69-3585-308B-884B-D293CEA660FA> /usr/lib/system/libcorecrypto.dylib
dyld[4982]: <9897030F-75D3-374B-8787-322D3D72E096> /usr/lib/system/libdispatch.dylib
dyld[4982]: <4B488059-5F44-3C73-9034-DAC2DEAB7D58> /usr/lib/system/libdyld.dylib
dyld[4982]: <AF5DEDE2-18F4-3C11-989D-3F394CD35FB3> /usr/lib/system/libkeymgr.dylib
dyld[4982]: <8341733F-3C14-3040-B3AD-BBD7FC557D7F> /usr/lib/system/libmacho.dylib
dyld[4982]: <568CA6AD-EAA9-3E05-B2C4-FD5AA99F375E> /usr/lib/system/libquarantine.dylib
dyld[4982]: <E91D9D9C-6063-3B1C-B76E-B0973E69E756> /usr/lib/system/libremovefile.dylib
dyld[4982]: <E04D9AFA-2C87-3C00-93DA-62B13E95610D> /usr/lib/system/libsystem_asl.dylib
dyld[4982]: <73A49FC5-CB95-397D-93AB-C8C9E651E576> /usr/lib/system/libsystem_blocks.dylib
dyld[4982]: <949943E2-52CB-3C95-AB08-7ED984333D03> /usr/lib/system/libsystem_c.dylib
dyld[4982]: <CFE1A849-2EFF-3041-9A76-7A70956A8A6D> /usr/lib/system/libsystem_collections.dylib
dyld[4982]: <2891A23A-0407-3CB6-B7DB-BDBEF413C7D7> /usr/lib/system/libsystem_configuration.dylib
dyld[4982]: <7ED744CD-3E25-36BB-8D77-7AD77644305D> /usr/lib/system/libsystem_containermanager.dylib
dyld[4982]: <96E327DE-3682-31E0-A3DD-571AD65EFFA6> /usr/lib/system/libsystem_coreservices.dylib
dyld[4982]: <0773E300-1B02-3757-A2CB-6A0B299B67D2> /usr/lib/system/libsystem_darwin.dylib
dyld[4982]: <BE8BAFA6-2637-30E2-8FBB-86DF629D8A8D> /usr/lib/system/libsystem_dnssd.dylib
dyld[4982]: <805E12B0-434D-3E9D-AA51-77EE512E608A> /usr/lib/system/libsystem_featureflags.dylib
dyld[4982]: <4CC3E383-C548-3975-B464-49E2EE7DCF4E> /usr/lib/system/libsystem_info.dylib
dyld[4982]: <006DC4B0-E134-3158-9966-A2BEE15B4F79> /usr/lib/system/libsystem_m.dylib
dyld[4982]: <8F26F714-85AE-355E-AFCB-3530B09C76CD> /usr/lib/system/libsystem_malloc.dylib
dyld[4982]: <23DF1A08-7C44-374A-90C9-F75405167766> /usr/lib/system/libsystem_networkextension.dylib
dyld[4982]: <7A0712AA-B031-3AF7-9FC3-FA63C2ED25FE> /usr/lib/system/libsystem_notify.dylib
dyld[4982]: <DFD92A1A-4E4F-3EFA-AF01-578B51F0104F> /usr/lib/system/libsystem_sandbox.dylib
dyld[4982]: <8C1FC817-62DF-396F-AD44-26DFC1442157> /usr/lib/system/libsystem_secinit.dylib
dyld[4982]: <08C5FE2A-B0BF-3AB6-BB42-460C18917D33> /usr/lib/system/libsystem_kernel.dylib
dyld[4982]: <6D458354-3C39-3F35-A3BB-D01A78817B4A> /usr/lib/system/libsystem_platform.dylib
dyld[4982]: <1F30FB9A-BDF9-32DB-A709-8417666A7E45> /usr/lib/system/libsystem_pthread.dylib
dyld[4982]: <6EEAA167-2E3C-3036-B16E-975FED44A5CE> /usr/lib/system/libsystem_symptoms.dylib
dyld[4982]: <AA2DCC11-35D9-3E5B-8421-D3B4CBA0E2D9> /usr/lib/system/libsystem_trace.dylib
dyld[4982]: <F10C5B1C-4B40-3DDE-8AC3-38B4E01A674F> /usr/lib/system/libunwind.dylib
dyld[4982]: <33177E90-9BB2-36C5-9B60-21CBCA32BB70> /usr/lib/system/libxpc.dylib
dyld[4982]: <3E0CEEEE-F6BF-3497-80DA-116F0269AAD2> /usr/lib/libc++abi.dylib
dyld[4982]: <AC12887C-D698-3627-B9D1-D2E5055A5DA4> /usr/lib/libobjc.A.dylib
dyld[4982]: <AF6B228E-26B1-32B8-82EF-B4D72EB8E79C> /usr/lib/liboah.dylib
dyld[4982]: <3EE92404-8FC3-374B-A598-D5C9A8CD64B5> /usr/lib/libc++.1.dylib
dyld[4982]: <6AB7DE6C-D6F2-313F-B979-F96F684341A1> /System/Library/Frameworks/GSS.framework/Versions/A/GSS
dyld[4982]: <7DFA0A17-89F8-3AA2-B6FD-D71A7E298F09> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
dyld[4982]: <2622A2B4-37E2-3BFB-A91F-C79BDF1495DA> /System/Library/Frameworks/Security.framework/Versions/A/Security
dyld[4982]: <6D0505F5-4AD9-3EB6-811D-3B4FD0F5C012> /usr/lib/libheimdal-asn1.dylib
dyld[4982]: <5C1387BE-F621-3B9F-80B0-A4DBE5105AA9> /usr/lib/libbsm.0.dylib
dyld[4982]: <7FEBF85A-A97C-313F-A98C-C94A73BE8507> /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal
dyld[4982]: <B3B2DF49-2DB8-370E-84AE-E0A2704515B8> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
dyld[4982]: <0570B00B-22EC-36CB-9BC9-F86BB593BDA7> /usr/lib/libresolv.9.dylib
dyld[4982]: <B6AED381-9244-3BA3-B244-77680D7F5A30> /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth
dyld[4982]: <FA55F3FC-6302-3383-BCC6-13EF051EE6CB> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
dyld[4982]: <B7799CB6-0A3C-3C8B-A185-8CEC55845B14> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
dyld[4982]: <BC2A7B8D-DE9B-3443-A21B-0CAD3689DF51> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
dyld[4982]: <362586D1-9A48-3B1B-B098-9CBB8ADC0FA8> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
dyld[4982]: <92088B07-833C-330D-8E1E-E1B0A8217DE8> /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo
dyld[4982]: <D1AB9FD5-6B3E-3025-AF17-CB8A40C54A62> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
dyld[4982]: <F2DF3A7B-3871-3052-81EC-BDCEDB502D1B> /usr/lib/libnetwork.dylib
dyld[4982]: <A1A2B55B-8ADD-326A-A8C9-40DED4BA6BF2> /System/Library/Frameworks/Network.framework/Versions/A/Network
dyld[4982]: <F289AD4D-3F3C-3AE5-BD7A-DFD224453619> /usr/lib/libMobileGestalt.dylib
dyld[4982]: <889A499A-6A4F-3804-92B4-9D806054F8C7> /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal
dyld[4982]: <1845898B-734F-315E-AA03-FF6034A79981> /usr/lib/libfakelink.dylib
dyld[4982]: <7D846992-22FF-32B3-BE32-BF9903A6DF35> /usr/lib/libicucore.A.dylib
dyld[4982]: <0AEFBBD5-7793-3B81-9C16-83DEA2DAD792> /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking
dyld[4982]: <0EDC954F-A7F7-3D93-8C75-F833C55C9B89> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
dyld[4982]: <7587DA15-06B8-3AEF-AE9A-AEC49EBBBDFD> /usr/lib/libDiagnosticMessagesClient.dylib
dyld[4982]: <132EE891-3808-3C62-BC19-91137868B089> /usr/lib/libenergytrace.dylib
dyld[4982]: <D2F21443-8FB7-34D8-B016-0E0B64D50CA3> /usr/lib/system/libkxld.dylib
dyld[4982]: <5AE47921-0539-3C89-A6A8-23176AD35D4D> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
dyld[4982]: <FD4A27D9-7D61-3D96-A414-DB5FA636EA7F> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
dyld[4982]: <FDA95237-C42C-3456-8216-AB26FCE698BD> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
dyld[4982]: <3E0B870E-47EF-3A46-A105-46B7BBBFA7B7> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
dyld[4982]: <8C460ADC-CC59-3BC2-A6FA-394A0F77E857> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
dyld[4982]: <BC971350-CD29-38FE-9033-F2744EA7A10A> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
dyld[4982]: <BD8EAA93-D86D-3AE8-A69B-E3C3527796AE> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
dyld[4982]: <9611D0E3-FD30-38C9-B893-A4539474EED5> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
dyld[4982]: <C205523D-2076-32C6-8444-4848B842A3F9> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
dyld[4982]: <624BC805-F6DA-3801-BED7-99B6028D1239> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
dyld[4982]: <8640719A-4960-3199-9196-8362D91A7232> /usr/lib/libapple_nghttp2.dylib
dyld[4982]: <5754E62B-CF46-3C47-BC13-DC231CA7F86B> /usr/lib/libcompression.dylib
dyld[4982]: <AB447288-47E6-30D9-BD4C-BDFDAE0CBBC3> /usr/lib/libsqlite3.dylib
dyld[4982]: <E6521834-62F1-3924-BF84-006DB4C28BDE> /usr/lib/libCoreEntitlements.dylib
dyld[4982]: <BBB41F0F-B01A-3B37-8A5D-43E2E8991A7B> /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity
dyld[4982]: <48480564-95D3-37E4-BBF4-1AC1B7A11B87> /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer
dyld[4982]: <C96A8B8C-9E93-38AA-A8C4-9FE4C1C128E0> /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression
dyld[4982]: <B492A3B5-8E2F-3551-BD5B-210B92CF21AE> /usr/lib/libcoretls.dylib
dyld[4982]: <CC8A3BF4-8C6B-3B01-A846-1D6457445FC1> /usr/lib/libcoretls_cfhelpers.dylib
dyld[4982]: <4B68892F-69C8-384F-9897-9CE5324F14B7> /usr/lib/libpam.2.dylib
dyld[4982]: <B5D4130F-DEC5-3513-B49B-6BB955E0A3C2> /usr/lib/libxar.1.dylib
dyld[4982]: <14E87224-A2EC-3EB7-A50B-3AF5B3E95065> /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout
dyld[4982]: <F29CFA16-8302-3E33-9736-6EE64DD91621> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
dyld[4982]: <C01705A8-1881-3BB7-A4D6-1047798F8953> /usr/lib/libarchive.2.dylib
dyld[4982]: <069467BD-8AE2-3BA1-B5D6-ABDB7B997984> /usr/lib/libxml2.2.dylib
dyld[4982]: <80A68E29-8D43-3595-9FAA-C9AF01A78BB7> /usr/lib/liblangid.dylib
dyld[4982]: <0F389E92-DFE7-3C9E-AEBB-25E3DE1121E4> /System/Library/Frameworks/Combine.framework/Versions/A/Combine
dyld[4982]: <EAA43988-4F04-3D39-A0A6-D597E46E966E> /usr/lib/swift/libswiftCore.dylib
dyld[4982]: <438D919F-9F7F-3BBC-952B-FAD3D15DC66C> /usr/lib/swift/libswiftCoreFoundation.dylib
dyld[4982]: <5D4E0720-2B70-3BB5-9139-6C8D4FDCEC62> /usr/lib/swift/libswiftDarwin.dylib
dyld[4982]: <4FEA4590-37C1-3402-A6FD-119D1711B4A0> /usr/lib/swift/libswiftDispatch.dylib
dyld[4982]: <ADAFDC6D-A675-3085-9B04-56943D1B0244> /usr/lib/swift/libswiftIOKit.dylib
dyld[4982]: <CE244C89-E91C-3C73-AA3E-088E6BD7A0EE> /usr/lib/swift/libswiftObjectiveC.dylib
dyld[4982]: <6524B4AF-DB60-392D-AEB6-2BA78E4B8DD1> /usr/lib/swift/libswiftXPC.dylib
dyld[4982]: <6B78AE7C-22CC-3DAE-B8A6-BF669887AFC8> /usr/lib/swift/libswift_Concurrency.dylib
dyld[4982]: <9FE0FA0D-AED0-32DB-BFF3-481B63C4B55B> /usr/lib/swift/libswift_StringProcessing.dylib
dyld[4982]: <711B9F1B-858B-395E-BF59-E1CF6D12E0DF> /usr/lib/swift/libswiftos.dylib
dyld[4982]: <74E42B0E-3EA5-3864-8EFB-11AFAC20E184> /usr/lib/liblzma.5.dylib
dyld[4982]: <2DBE0C23-1373-3769-AB54-44D397AAED41> /usr/lib/libbz2.1.0.dylib
dyld[4982]: <A8F077FB-C4EE-309B-BCC5-C736B6E28CB2> /usr/lib/libiconv.2.dylib
dyld[4982]: <CCC1A1F5-AA69-321E-9F97-071E0E1B313A> /usr/lib/libcharset.1.dylib
dyld[4982]: <2332C078-B124-3C91-92F1-D73DFF3E42D0> /usr/lib/swift/libswift_RegexParser.dylib
dyld[4982]: <3D52B5F5-2ED4-357B-BC37-D8A5378CCC86> /usr/lib/libpcap.A.dylib
dyld[4982]: <51BA882F-9DE5-318E-BE42-D318C1C97F58> /usr/lib/libdns_services.dylib
dyld[4982]: <F43FF015-68B0-3E6C-A7FF-C97AD26A3A5E> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer
dyld[4982]: <4DBFF118-2F34-3D15-9F72-40E0CE6BD61C> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
dyld[4982]: <6E7A1BD5-9990-3AB9-A089-1C845F05368F> /usr/lib/libCheckFix.dylib
dyld[4982]: <BDA49463-8F35-3CCC-8787-BD9136568F71> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
dyld[4982]: <9BF09EAD-8702-3C50-88A6-EE71F624D01E> /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP
dyld[4982]: <77BF2282-3EC3-3428-A17B-D6D08DD2719E> /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities
dyld[4982]: <94CC129B-26C2-341C-A526-731414806B32> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
dyld[4982]: <3AA7F20C-39F6-3464-A39D-6D4F31912648> /usr/lib/libmecab.dylib
dyld[4982]: <A28ABEC8-A407-3051-B9AD-C4B83B0909B4> /usr/lib/libCRFSuite.dylib
dyld[4982]: <8B5DB566-700A-3C88-B2F5-8AD9A0B0F6A5> /usr/lib/libgermantok.dylib
dyld[4982]: <07C3412C-DB5A-333E-B8C5-D64B49946C5C> /usr/lib/libThaiTokenizer.dylib
dyld[4982]: <B2962482-2D49-3947-B3A3-93FC62A9BB98> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
dyld[4982]: <DF988085-1F50-331A-87EB-80CF090CF6C5> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
dyld[4982]: <653BA435-6DBE-3053-9F1B-F2E75D369287> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
dyld[4982]: <2510980C-9187-3F36-87C1-0B51357B0CCB> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
dyld[4982]: <F52B5A07-42CF-3F27-B04D-211CE7497372> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
dyld[4982]: <2C6D4F7F-EA89-32E4-A233-1B0137C117C9> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
dyld[4982]: <C3955BE0-96D1-34D4-BA54-88154F161299> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
dyld[4982]: <971D6042-D3AE-3C64-A28E-DDCC9F108B62> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
dyld[4982]: <A7E971A8-1A2E-3DB0-B265-BE26BA175364> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib
dyld[4982]: <6CDE1C9E-2011-3249-81F8-7C818A9596EE> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib
dyld[4982]: <B3BB7EAE-1F89-39A1-A336-0FC1F4FB1BFB> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib
dyld[4982]: <24C3A01B-FEB6-3D0C-9FAE-3F0F41375732> /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL
dyld[4982]: <895EF845-4A8D-3DB7-9648-7ACA5FE5416D> /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS
dyld[4982]: <EA558870-4515-3935-B339-7C0A1E7EB0DE> /usr/lib/libutil.dylib
dyld[4982]: <4143C186-6733-3F40-B065-BE3EFEAD6EB4> /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary
dyld[4982]: <27E367D3-F428-3A7F-A738-9018DA8F606C> /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore
dyld[4982]: <F9F09038-AD50-3635-8047-D996676CEFD1> /usr/lib/libapp_launch_measurement.dylib
dyld[4982]: <48DCE46B-489D-3469-993C-E7B3418E1C9A> /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity
dyld[4982]: <A8DF5186-026E-3FDF-BF7F-AA555205F0B2> /usr/lib/libmis.dylib
dyld[4982]: <2786F9FB-DFC9-3079-9C13-83A849DCEE09> /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices
dyld[4982]: <BEAFD107-DEA0-3D13-A3D2-555C5AE70D79> /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper
dyld[4982]: <97E2F1F6-15EA-3D70-B8BC-C1020DF0940F> /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics
dyld[4982]: <CE210D90-F0EC-3D94-91DD-B6D92ED061ED> /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce
dyld[4982]: <58FAB170-6549-394E-A6C0-2238BEB251AE> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
dyld[4982]: <B4E9A1D2-6C8F-36EF-BF39-3ABF597F7001> /usr/lib/libxslt.1.dylib
dyld[4982]: <B5619052-F184-3D8A-A00E-867E6C30D31C> /usr/lib/libcmph.dylib
dyld[4982]: <C649AE86-3848-3E15-9D2E-2CB5B1E7F2CA> /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji
dyld[4982]: <9F124708-4E4A-366B-A048-D7F7543A510C> /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData
dyld[4982]: <AACE1B21-2CB3-3CE2-BD60-7900F5BFD951> /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon
dyld[4982]: <8331CA52-A12E-371A-B0BC-86DD08C1DC8E> /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
dyld[4982]: <8DBE9EC2-12A9-38B5-AE24-8B484DF0E605> /usr/lib/libTLE.dylib
Unable to load one or more of the requested types.
Could not load type 'Mono.Posix.Syscall' from assembly 'Mono.Posix, Version=7.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' because the method 'exit' has no implementation (no RVA).

@shawnfunke
Copy link
Contributor

@sebasgomez238 I've replaced the package Mono.Posix with Mono.Unix directly, that seems to fix the issue, see the output below:

PS: You've used tabs instead of spaces in the Directory.Packages.props file.

##[information]Log file: "/var/folders/xw/cd3plhm906bgtypr02x4k0m40000gn/T/GovCompDisc_Log_20230831211220440_6418.log"
##[information]Run correlation id: e33ec177-b7d4-4707-b357-dff7561a2063
##[information]Finding components...
##[information]
##[information]_______________________________________________________________________________________________________________________________________
##[information]|Component Detector Id         |Detection Time                |# Components Found            |# Explicitly Referenced                 |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|CocoaPods                     |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Go                            |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Gradle                        |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Ivy (Beta)                    |0.076 seconds                 |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Linux                         |0.0044 seconds                |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|MvnCli                        |0.076 seconds                 |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Npm                           |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|NpmLockfile3 (Beta)           |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|NpmWithRoots                  |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|NuGet                         |0.1 seconds                   |8                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|NuGetPackagesConfig           |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|NuGetProjectCentric           |0.23 seconds                  |100                           |25                                      |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Pip                           |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Pnpm                          |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Poetry (Beta)                 |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Ruby                          |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|RustCrateDetector             |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|SPDX22SBOM                    |0.11 seconds                  |1                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Vcpkg (Beta)                  |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Yarn                          |0.1 seconds                   |0                             |0                                       |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]|Total                         |0.24 seconds                  |109                           |25                                      |
##[information]|______________________________|______________________________|______________________________|________________________________________|
##[information]
##[information]Detection time: 0.2425711 seconds.
##[information]Scan Manifest file: "/var/folders/xw/cd3plhm906bgtypr02x4k0m40000gn/T/ScanManifest_20230831211220358.json"

@sebasgomez238
Copy link
Collaborator

sebasgomez238 commented Sep 18, 2023

Reopening this issue. This change will be reverted in the latest release as it is causing issues when running the tool in a container. We will re-evaluate and implement a different solution. Docs have been updated as well to reflect this.

@sebasgomez238 sebasgomez238 reopened this Sep 18, 2023
@sebasgomez238
Copy link
Collaborator

@shawnfunke tagging you for awareness. It is also worth noting that since this issue had been resolved we also updated the sdk to dotnet 7.0.400 so it is possible the tool will still be compatible for this scenario.

@shawnfunke
Copy link
Contributor

@sebasgomez238 that is odd, what kind of issues? Note that reverting this will break the package - such as the Homebrew Formulae - downstream.

@sebasgomez238
Copy link
Collaborator

@shawnfunke "Unable to load shared library 'Mono.Unix' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library libMono.Unix: No such file or directory" When running on an alpine docker image. It seems like it is currently not supported by the Mono.Unix library so we will be reverting back to Mono.Posix.NETStandard until we find a solution.

@shawnfunke
Copy link
Contributor

@sebasgomez238 what if the dependency is set using conditions based on the current operating system? That should then fix the issue for both of these use-cases.

@chenrui333
Copy link

@sebasgomez238 what if the dependency is set using conditions based on the current operating system? That should then fix the issue for both of these use-cases.

I feel the same, it has broke the arm builds for the last two releases.

@edgarrs
Copy link
Contributor

edgarrs commented Oct 2, 2023

We are planning to move to .NET 8 and that will fix this issue

@sebasgomez238
Copy link
Collaborator

@chenrui333 @shawnfunke v1.8.0 was released yesterday. We are now targeting .NET 6 and 8. The net8.0 runtime fixes the issue for arm builds. Feel free to try it out and let me know if you encounter any issues. I will update the docs and close this issue after that. Keep in mind that the version of .NET required to build our tool is 8.0.100-rc.2.23502.2.

@shawnfunke
Copy link
Contributor

@sebasgomez238 that does not seem to work on my end if compiled with the specified .NET 8 release candidate:

shawnfunke@shawnfunke-lmu25:~/sbom-tool$ ~/tmp/dotnet/dotnet publish src/Microsoft.Sbom.Tool/Microsoft.Sbom.Tool.csproj --configuration Release --output bin --runtime osx-arm64 --framework net8.0 -p:SelfContained=true -p:OFFICIAL_BUILD=true -p:MinVerVersionOverride=1.8.0 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false
MSBuild version 17.8.0+6cdef4241 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Microsoft.Sbom.Contracts -> /Users/shawnfunke/sbom-tool/src/Microsoft.Sbom.Contracts/bin/Release/net8.0/Microsoft.Sbom.Contracts.dll
  Microsoft.Sbom.Adapters -> /Users/shawnfunke/sbom-tool/src/Microsoft.Sbom.Adapters/bin/Release/net8.0/Microsoft.Sbom.Adapters.dll
  Microsoft.Sbom.Extensions -> /Users/shawnfunke/sbom-tool/src/Microsoft.Sbom.Extensions/bin/Release/net8.0/Microsoft.Sbom.Extensions.dll
  Microsoft.Sbom.Common -> /Users/shawnfunke/sbom-tool/src/Microsoft.Sbom.Common/bin/Release/net8.0/Microsoft.Sbom.Common.dll
  Microsoft.Sbom.Parsers.Spdx22SbomParser -> /Users/shawnfunke/sbom-tool/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/bin/Release/net8.0/Microsoft.Sbom.Parsers.Spdx22SbomParser.dll
  Microsoft.Sbom.Api -> /Users/shawnfunke/sbom-tool/src/Microsoft.Sbom.Api/bin/Release/net8.0/Microsoft.Sbom.Api.dll
  Microsoft.Sbom.Extensions.DependencyInjection -> /Users/shawnfunke/sbom-tool/src/Microsoft.Sbom.Extensions.DependencyInjection/bin/Release/net8.0/Microsoft.Sbom.Extensions.DependencyInjection.dll
  Microsoft.Sbom.Tool -> /Users/shawnfunke/sbom-tool/src/Microsoft.Sbom.Tool/bin/Release/net8.0/osx-arm64/Microsoft.Sbom.Tool.dll
  Microsoft.Sbom.Tool -> /Users/shawnfunke/sbom-tool/bin/
shawnfunke@shawnfunke-lmu25:~/sbom-tool$ ./bin/Microsoft.Sbom.Tool generate -b ~/tmp/sbom-tool/ -bc ~/tmp/sbom-tool/ -pn TestProject -pv 1.2.3 -ps ASD -nsb http://null.shawnfunke.dev
Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMonoPosixHelper, 0x0001): tried: 'libMonoPosixHelper' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache), 'libMonoPosixHelper' (no such file), '/usr/local/lib/libMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache)

@shawnfunke
Copy link
Contributor

@sebasgomez238, actually I take that back, it does work. There were some problems that caused it to fail for me.

The --framework parameter is set to net8.0 did not satisfy the Condition="'$(TargetFramework)' == 'net6.0'" condition for me, thus it uses the previous code and attempts to load the POSIX helper. I do not know why that happened tho, once I set -p:TargetFramework=net8.0 it worked and cannot reproduce the original issue.

Also a note, not directly related to this - the install documentation here for MacOS is incorrect whenever .NET is already installed through other means. Instead of export PATH=$PATH:~/YOUR_DIR one needs to use export PATH=~/YOUR_DIR:$PATH otherwise the order is incorrect and the currently installed version is favoured instead.

shawnfunke@shawnfunke-lmu25:~/sbom-tool$ dotnet publish src/Microsoft.Sbom.Tool/Microsoft.Sbom.Tool.csproj --configuration Release --output bin --runtime osx-arm64 -p:TargetFramework=net8.0 -p:SelfContained=true -p:OFFICIAL_BUILD=true -p:MinVerVersionOverride=1.8.0 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false
shawnfunke@shawnfunke-lmu25:~/sbom-tool$ ./bin/Microsoft.Sbom.Tool generate -b ~/tmp/sbom-tool/ -bc ~/tmp/sbom-tool/ -pn TestProject -pv 1.2.3 -ps ASD -nsb http://null.shawnfunke.dev
##[information]Log file: "/var/folders/xw/cd3plhm906bgtypr02x4k0m40000gn/T/GovCompDisc_Log_20231017202106559_99118.log"
##[information]Run correlation id: d0fc4ad6-a648-4d76-99a6-267ccf839559
##[information]Finding components...
[...]
##[information]Detection time: 0.058364 seconds.
##[information]Scan Manifest file: "/var/folders/xw/cd3plhm906bgtypr02x4k0m40000gn/T/ScanManifest_20231017202106500.json"
##[warning]There were no packages detected during the generation workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
z-aa-triaged (Deprecated label) This issue has been triaged by AA z-bug (Deprecated label) Something isn't working z-P1 (Deprecated label) Priority 1 on bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.