Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'libproc': The specified module could not be found.
See original GitHub issueSteps to reproduce
Install dotnet core Update openssl with homebrew and update symlinks as per instructions: cd /usr/lib/ ln -sf /usr/local/Cellar/openssl/1.0.2k/lib/libcrypto.1.0.0.dylib libcrypto.1.0.0.dylib ln -sf /usr/local/Cellar/openssl/1.0.2k/lib/libssl.1.0.0.dylib libssl.1.0.0.dylib dotnet new console --language c#
Running new works however when it tries to restore I get this error: Failed to create prime the NuGet cache. restore failed with: 134
Unhandled Exception: System.DllNotFoundException: Unable to load DLL ‘libproc’: The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Interop.libproc.proc_pidpath(Int32 pid, Byte* buffer, UInt32 bufferSize) at Interop.libproc.proc_pidpath(Int32 pid) at System.Diagnostics.Process.ResolvePath(String filename) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Microsoft.DotNet.Cli.ForwardingApp.Execute() at Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingApp.Execute() at Microsoft.DotNet.Tools.Restore.RestoreCommand.<>c__DisplayClass0_0.<Run>b__0() at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args) at Microsoft.DotNet.Tools.Restore.RestoreCommand.Run(String[] args) at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient) at Microsoft.DotNet.Cli.Program.Main(String[] args) Abort trap: 6
Expected behavior
Actual behavior
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.1)
Product Information: Version: 1.0.1 Commit SHA-1 hash: 005db40cd1
Runtime Environment: OS Name: Mac OS X OS Version: 10.11 OS Platform: Darwin RID: osx.10.11-x64 Base Path: /usr/local/share/dotnet/sdk/1.0.
openssl version -a OpenSSL 1.0.2h 3 May 2016 (Library: OpenSSL 1.0.2k 26 Jan 2017) built on: reproducible build, date unspecified platform: darwin64-x86_64-cc options: bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: clang -I. -I… -I…/include -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM OPENSSLDIR: “/usr/local/etc/openssl”
Issue Analytics
- State:
- Created 6 years ago
- Comments:25 (13 by maintainers)
Top GitHub Comments
I the same issue as @tarurar and wasn’t really in a position to unset DYLD_FALLBACK_LIBRARY_PATH. Instead, I appended the directory where libproc lives to the fallback path, like this
export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/usr/lib/
I did not investigate why this was necessary, which I would probably do if I was going to make it a permanent part of my environment (which I’m not, I’m just over here working a support ticket for a dotnet customer of ours) so caveat emptor.
CoreFX has been depending on libproc from the very beginning of its port to OSX. The library name is defined here: https://github.com/dotnet/corefx/blob/master/src/Common/src/Interop/OSX/Interop.Libraries.cs And the pinvokes here: https://github.com/dotnet/corefx/blob/master/src/Common/src/Interop/OSX/Interop.libproc.cs
So, I think there can be several possible issues:
@Ox5f3759df could you please check if the following file exists?
/usr/lib/libproc.dylib
If it does, could you please run the following command and dump the result here?otool -L /usr/lib/libproc.dylib
Could you also run the following commands and dump their output here? I expect all of the env vars to be empty, if they are not, it might be causing the problem.
echo $LD_LIBRARY_PATH
echo $DYLD_LIBRARY_PATH
echo $DYLD_FALLBACK_LIBRARY_PATH
echo $DYLD_FRAMEWORK_PATH
echo $DYLD_FALLBACK_FRAMEWORK_PATH