Closed
Description
I'm trying to run nunit tests in Tests.dll against PacketDotNet.dll (which uses SharpPcap.dll). It's SharpPcap.dll that uses dllmap to map from wpcap to libpcap on Linux (and I guess Mac, I'm new to Mac and haven't tried).
On Linux this used to work great but something changes and it stopped working. From the debug output it looks like the SharpPcap.dll.config file isn't being honored.
Steps to Reproduce
- Clone https://github.com/chmorgan/packetnet/tree/net_test_2
- Build project
- cd Test/bin/Release
- mono /usr/lib/mono/4.5/nunit-console.exe Test.dll
- Failure to find wpcap (should be mapped to libpcap.so by SharpPcap.dll.config file)
Directory content
$ ls
icmpv6.dat nunit.framework.dll PacketDotNet.pdb SharpPcap.dll.config Test.dll Test.pdb
log4net.dll PacketDotNet.dll SharpPcap.dll SharpPcap.xml Test.dll.mdb TestResult.xml
Current Behavior
$ ls /usr/lib64/libpcap*
/usr/lib64/libpcap.so.1 /usr/lib64/libpcap.so.1.8.1
ldconfig showing that pcap is found:
$ ldconfig -v |grep pcap
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Path `/usr/lib' given more than once
ldconfig: Path `/usr/lib64' given more than once
ldconfig: Can't stat /usr/libx32: No such file or directory
libpcap.so.1 -> libpcap.so.1.8.1
ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
SharpPcap.dll.config:
<configuration>
<dllmap dll="wpcap" target="libpcap.so.1" />
</configuration>
Mono version:
$ mono --version
Mono JIT compiler version 5.10.0.140 (tarball Sat Feb 24 14:02:40 UTC 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
Console output with debugging enabled:
...
.Mono: DllImport attempting to load: 'wpcap'.
Mono: DllImport error loading library '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap': '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap.so': '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/lib/libwpcap': '/usr/lib/libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/lib/libwpcap.so': '/usr/lib/libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap': 'libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap.so': 'libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'wpcap': 'wpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap': '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap.so': '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/lib/libwpcap': '/usr/lib/libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/lib/libwpcap.so': '/usr/lib/libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap': 'libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap.so': 'libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap': 'libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport unable to load library 'libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport attempting to load: 'wpcap'.
Mono: DllImport error loading library '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap': '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap.so': '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/lib/libwpcap': '/usr/lib/libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/lib/libwpcap.so': '/usr/lib/libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap': 'libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap.so': 'libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'wpcap': 'wpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap': '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap.so': '/tmp/nunit20/ShadowCopyCache/8987_636548417038525610/Tests/assembly/shadow/1d20b042/551adf96_483a6fd4_00000001/libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/lib/libwpcap': '/usr/lib/libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/lib/libwpcap.so': '/usr/lib/libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap': 'libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap.so': 'libwpcap.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library 'libwpcap': 'libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport unable to load library 'libwpcap: cannot open shared object file: No such file or directory'.
Mono: DllImport attempting to load: '__Internal'.
Mono: DllImport loaded library '(null)'.
Mono: DllImport searching in: '__Internal' ('(null)').
Mono: Searching for 'SetDllDirectory'.
Mono: Probing 'SetDllDirectory'.
Mono: Could not find 'SetDllDirectory' due to 'mono: undefined symbol: SetDllDirectory'.
Mono: Probing 'SetDllDirectory'.
Mono: Could not find 'SetDllDirectory' due to 'mono: undefined symbol: SetDllDirectory'.
Mono: Probing 'SetDllDirectoryA'.
Mono: Could not find 'SetDllDirectoryA' due to 'mono: undefined symbol: SetDllDirectoryA'.
Mono: Probing 'SetDllDirectoryA'.
Mono: Could not find 'SetDllDirectoryA' due to 'mono: undefined symbol: SetDllDirectoryA'.
F.F.F.F.F..F.Loading the sample capture file