dotnet failing to resolve symbol linkages on RedHat/Centos8.
Description
.NET Core C# MyApp.cs source compiled by VS2019 into DLL, moved to RedHat/Centos8 under Virtual Box, run via "dotnet MyApp.dll" declares System.DllNotFoundException, traced via LD_DEBUG to six "symbol lookup error" that seem to be caused by dotnet failing to load dotnet libraries properly.
Configuration
- Which version of .NET is the code running on? -- .NET Core 3.1.11
- What OS and version, and what distro if applicable? -- Centos8 4.18.0-240.22.1.el8_3.x86_64
- What is the architecture (x64, x86, ARM, ARM64)? -- x64
- Do you know whether it is specific to that configuration? -- do not know
- If you're using Blazor, which web browser(s) do you see this issue in? -- not browser related
Regression?
First implementation attempt, no prior history.
Other information
C# application refers to DllImport of customer libplmwtss-c [dot-so file] and function FACE_TSS_Base_Initialize. Upon "dotnet MyApp.dll" System.DllNotFoundException reported. LD_DEBUG=all indicates no problem locating and loading libplmwtss-c.so. See: https://1drv.ms/t/s!ArFHTzWIP6DTgxUc6AAm3wOPgW9L?e=fHv5oZ Numerous other dot-so files are loaded, ultimately complaining of six "symbol lookup error". (1) u_strlen (2) GlobalizationNative_CompareStringW (3) GlobalizationNative_GetDefaultLocaleNameW (4) GlobalizationNative_GetLocaleNameW (5) GlobalizationNative_GetLocaleInfoStringW (6) protobuf_c_empty_string A search of all system dot-so files using "readelf -a" reveals no dot-so file contains "u_strlen" but several contain "u_strlen_60". A search of all system dot-so files reveals no dot-so file contains any of the GlobalizationNative_xxx symbols. However, the following Globalization_Native_xxx symbols were found: (1) GlobalizationNative_LastI (2) GlobalizationNative_Chang (3) GlobalizationNative_IsNor A search of all system dot-so files reveals one with decorated C++ "protobuf_c_empty_string@@LIBPROTOBUF_C_1". A C language program, compiled native with gnu, accessing libplmwtss-c.so, has no problem resolving all links and executes without problem. Are these "symbol lookup error" the fault of dotnet?
Tagging subscribers to this area: @tarekgh, @safern See info in area-owners.md if you want to be subscribed.
Issue Details
Description
.NET Core C# MyApp.cs source compiled by VS2019 into DLL, moved to RedHat/Centos8 under Virtual Box, run via "dotnet MyApp.dll" declares System.DllNotFoundException, traced via LD_DEBUG to six "symbol lookup error" that seem to be caused by dotnet failing to load dotnet libraries properly.
Configuration
- Which version of .NET is the code running on? -- .NET Core 3.1.11
- What OS and version, and what distro if applicable? -- Centos8 4.18.0-240.22.1.el8_3.x86_64
- What is the architecture (x64, x86, ARM, ARM64)? -- x64
- Do you know whether it is specific to that configuration? -- do not know
- If you're using Blazor, which web browser(s) do you see this issue in? -- not browser related
Regression?
First implementation attempt, no prior history.
Other information
C# application refers to DllImport of customer libplmwtss-c [dot-so file] and function FACE_TSS_Base_Initialize. Upon "dotnet MyApp.dll" System.DllNotFoundException reported. LD_DEBUG=all indicates no problem locating and loading libplmwtss-c.so. See: https://1drv.ms/t/s!ArFHTzWIP6DTgxUc6AAm3wOPgW9L?e=fHv5oZ Numerous other dot-so files are loaded, ultimately complaining of six "symbol lookup error". (1) u_strlen (2) GlobalizationNative_CompareStringW (3) GlobalizationNative_GetDefaultLocaleNameW (4) GlobalizationNative_GetLocaleNameW (5) GlobalizationNative_GetLocaleInfoStringW (6) protobuf_c_empty_string A search of all system dot-so files using "readelf -a" reveals no dot-so file contains "u_strlen" but several contain "u_strlen_60". A search of all system dot-so files reveals no dot-so file contains any of the GlobalizationNative_xxx symbols. However, the following Globalization_Native_xxx symbols were found: (1) GlobalizationNative_LastI (2) GlobalizationNative_Chang (3) GlobalizationNative_IsNor A search of all system dot-so files reveals one with decorated C++ "protobuf_c_empty_string@@LIBPROTOBUF_C_1". A C language program, compiled native with gnu, accessing libplmwtss-c.so, has no problem resolving all links and executes without problem. Are these "symbol lookup error" the fault of dotnet?
| Author: | FrankNatoli |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
Looks like this might be an issue with using the system's libicu? Is this expected behavior?
cc: @omajid @tmds @janvorli
There is something weird. I've checked out sources for the coreclr repo at v3.1.11 and the System.Globalization.Native sources don't reference e.g. the GlobalizationNative_CompareStringW at all. @FrankNatoli the 3.1.11 is not the recent version, can you please try to use the latest one instead to see if it fixes the issue? 3.1.15 was released few days ago.
@JanVorli: must ask you for "yum" syntax to upgrade 3.1.111 to 3.1.115. "sudo yum install dotnet-sdk-3.1" reports: "Package dotnet-sdk-3.1-3.1.111-1.el8_3.x86_64 is already installed" I see .NET Core 3.1.115 listed at: https://dotnet.microsoft.com/download/dotnet/3.1 But I can't find instructions to upgrade 3.1.111 to 3.1.115. Thanks.
(This is the same issue as https://stackoverflow.com/q/67433905/3561275, right?)
Is there any way to reproduce this with .NET without using the non-public/confidential/proprietary ibplmwtss-c.so file?
3.1.115 isn't available in CentOS 8 (or RHEL 8 for that matter) yet. It's been held up due to an unfortunate set of reasons. ETA is next week (unless something else goes wrong). If you want to install this, I suggest removing the distro packages (sudo dnf remove 'dotnet*' 'aspnet*' 'netstandard*') and then
- Use either Microsoft packages (
sudo dnf install https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpmand then see https://github.com/dotnet/docs/pull/24206/files#diff-3b7bec86bd90e2795a80fb34691da621aab873a0202c6c53ed03439b3ca3e412R84-R94)
OR
- Use https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
Yes, Frank Detrez and Frank Natoli are the same. I now see Andrei Petrut on StackOverflow has posted a rather detailed solution to the same errors. However, his solution appears to be Debian specific, and I'm working with Centos8. I'll give your suggestions a try, thanks.
I think @omajid is correct. The actual failure from the logs is
System.DllNotFoundException: Unable to load shared library 'libplmwtss-c' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibplmwtss-c: cannot open shared object file: No such file or directory
at HelloWorld.Program.FACE_TSS_Base_Initialize(FACE_TSS_Base& PL_BASE_TSI, FACE_string& config, Int32& retCode)
at HelloWorld.Program.Main(String[] args) in C:\Users\fnatoli\CSharp\HelloWorld\HelloWorld\Program.cs:line 68
libplmwtss-c couldn't be found and it looks it is missing from the system. I am going to change title of this issue as it is not reflecting the actual problem.
Tagging subscribers to this area: @vitek-karas, @agocke, @coffeeflux, @vsadov See info in area-owners.md if you want to be subscribed.
Issue Details
Description
.NET Core C# MyApp.cs source compiled by VS2019 into DLL, moved to RedHat/Centos8 under Virtual Box, run via "dotnet MyApp.dll" declares System.DllNotFoundException, traced via LD_DEBUG to six "symbol lookup error" that seem to be caused by dotnet failing to load dotnet libraries properly.
Configuration
- Which version of .NET is the code running on? -- .NET Core 3.1.11
- What OS and version, and what distro if applicable? -- Centos8 4.18.0-240.22.1.el8_3.x86_64
- What is the architecture (x64, x86, ARM, ARM64)? -- x64
- Do you know whether it is specific to that configuration? -- do not know
- If you're using Blazor, which web browser(s) do you see this issue in? -- not browser related
Regression?
First implementation attempt, no prior history.
Other information
C# application refers to DllImport of customer libplmwtss-c [dot-so file] and function FACE_TSS_Base_Initialize. Upon "dotnet MyApp.dll" System.DllNotFoundException reported. LD_DEBUG=all indicates no problem locating and loading libplmwtss-c.so. See: https://1drv.ms/t/s!ArFHTzWIP6DTgxUc6AAm3wOPgW9L?e=fHv5oZ Numerous other dot-so files are loaded, ultimately complaining of six "symbol lookup error". (1) u_strlen (2) GlobalizationNative_CompareStringW (3) GlobalizationNative_GetDefaultLocaleNameW (4) GlobalizationNative_GetLocaleNameW (5) GlobalizationNative_GetLocaleInfoStringW (6) protobuf_c_empty_string A search of all system dot-so files using "readelf -a" reveals no dot-so file contains "u_strlen" but several contain "u_strlen_60". A search of all system dot-so files reveals no dot-so file contains any of the GlobalizationNative_xxx symbols. However, the following Globalization_Native_xxx symbols were found: (1) GlobalizationNative_LastI (2) GlobalizationNative_Chang (3) GlobalizationNative_IsNor A search of all system dot-so files reveals one with decorated C++ "protobuf_c_empty_string@@LIBPROTOBUF_C_1". A C language program, compiled native with gnu, accessing libplmwtss-c.so, has no problem resolving all links and executes without problem. Are these "symbol lookup error" the fault of dotnet?
| Author: | FrankNatoli |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
@tarekgh: unless I am seriously mistaken, omajid did not suggest libplmwtss-c.so is "missing". In fact, if you check the LD_DEBUG output, see link in my original post, you will see:
file=/usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libplmwtss-c.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0] 3139: 3139: file=/home/fnatoli/CSharp/HelloWorld/libplmwtss-c.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0] 3139: 3139: file=libplmwtss-c.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0] 3139: find library=libplmwtss-c.so [0]; searching 3139: search path=tls/x86_64/x86_64:tls/x86_64:tls/x86_64:tls:x86_64/x86_64:x86_64:x86_64: (LD_LIBRARY_PATH) 3139: trying file=tls/x86_64/x86_64/libplmwtss-c.so 3139: trying file=tls/x86_64/libplmwtss-c.so 3139: trying file=tls/x86_64/libplmwtss-c.so 3139: trying file=tls/libplmwtss-c.so 3139: trying file=x86_64/x86_64/libplmwtss-c.so 3139: trying file=x86_64/libplmwtss-c.so 3139: trying file=x86_64/libplmwtss-c.so 3139: trying file=libplmwtss-c.so 3139: search path=/usr/lib64/tls:/usr/lib64 (system search path) 3139: trying file=/usr/lib64/tls/libplmwtss-c.so 3139: trying file=/usr/lib64/libplmwtss-c.so 3139: 3139: file=libplmwtss-c.so [0]; generating link map 3139: dynamic: 0x00007f947d2c8bf8 base: 0x00007f947d099000 size: 0x00000000002485e0 3139: entry: 0x00007f947d0b1440 phdr: 0x00007f947d099040 phnum: 7
Which I believe conclusively indicates that libplmwtss-c.so was found and loaded. dotnet generates System.DllNotFoundException if ANY dll needed by the initial dll cannot be found, or if ANY symbol is unresolved, see list of symbols, most of which are unambiguously Microsoft .NET Core related. Please restore the original title of the issue.
@FrankNatoli the failure is clear about libplmwtss-c and not about System.Globalization.Native.so. If the failure was about System.Globalization.Native.so the process will instead fail fast and terminate with that.
When seeing
file=/usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libplmwtss-c.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0]
It doesn't mean this is already loaded and resolved all dependencies. If you look at other loaded libraries as example, you'll find something like:
file=/usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/System.Globalization.Native.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0]
and then later you'll see after fixing all binding something like:
opening file=/usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/System.Globalization.Native.so [0]; direct_opencount=1
this is not happening with libplmwtss-c.
Could you check if /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libplmwtss-c.so exist in the VM you are using?
If you want to restore the original title, please go ahead and do it but this will not help with this issue, I guess.
@tarekgh: permit me to present three series of C# sources, one a trivial "hello world", which on CentOS8 dotnet works perfectly, another a revised "hello world" that attempts to call one function in libplmwtss-c.so, that fails with System.DllNotFoundException, and yet another revised "hello world" that attempts to call the same function but in non-existent libplmwtss-cx.so, that fails with the identical System.DllNotFoundException. But, as you will see, the LD_DEBUG=all output for the second and third are very, very different. Here is the trivial source: ` using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
That executes without problem using "dotnet HelloWorld.dll".
Here is the revised source that references one function in liblmwtss-c.so:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld { [StructLayout(LayoutKind.Explicit, Pack = 1, CharSet = CharSet.Ansi)] public unsafe struct FACE_TSS_Base_ops { [FieldOffset(0)] public UInt64 ctor; [FieldOffset(4)] public UInt64 dtor; [FieldOffset(8)] public UInt64 Initialize; [FieldOffset(12)] public UInt64 Create_Connection; [FieldOffset(16)] public UInt64 Destroy_Connection; [FieldOffset(20)] public UInt64 Unregister_Callback; }
[StructLayout(LayoutKind.Explicit, Pack = 1, CharSet = CharSet.Ansi)]
public unsafe struct FACE_TSS_Base
{
[FieldOffset(0)] public FACE_TSS_Base_ops ops;
[FieldOffset(48)] public UInt64 data;
}
[StructLayout(LayoutKind.Explicit, Pack = 1, CharSet = CharSet.Ansi)]
public unsafe struct FACE_string
{
[FieldOffset(0)] public UInt32 isManaged;
[FieldOffset(8)] public UInt64 length;
[FieldOffset(16)] public UInt64 capacity;
[FieldOffset(24)] public UInt64 bound;
[FieldOffset(32)] public IntPtr buffer;
}
class Program
{
[DllImport("libplmwtss-c", CallingConvention = CallingConvention.Cdecl)]
public static extern void FACE_TSS_Base_Initialize(ref FACE_TSS_Base PL_BASE_TSI, ref FACE_string config, ref int retCode);
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
string path = "/opt/pl-middleware/tss/TSSConnections.json";
byte[] pathBytes = Encoding.ASCII.GetBytes(path);
FACE_TSS_Base PL_BASE_TSI = new FACE_TSS_Base();
PL_BASE_TSI.ops.ctor = 0;
PL_BASE_TSI.ops.dtor = 0;
PL_BASE_TSI.ops.Initialize = 0;
PL_BASE_TSI.ops.Create_Connection = 0;
PL_BASE_TSI.ops.Destroy_Connection = 0;
PL_BASE_TSI.ops.Unregister_Callback = 0;
FACE_string config;
config.isManaged = 1;
config.length = 0;
config.capacity = 0;
config.bound = 0;
config.buffer = Marshal.AllocHGlobal(pathBytes.Length);
Marshal.Copy(pathBytes, 0, config.buffer, pathBytes.Length);
int retCode = -1;
FACE_TSS_Base_Initialize(ref PL_BASE_TSI, ref config, ref retCode);
Console.WriteLine(string.Format("FACE_TSS_Base_Initialize retCode={0} Initialize={1} data={2}", retCode, PL_BASE_TSI.ops.Initialize.ToString("X16"), PL_BASE_TSI.data.ToString("X16")));
}
}
}
That fails with System.DllNotFoundException.
Here is the relevant extract from LD_DEBUG=all output:
3757: file=/usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libplmwtss-c.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0]
3757:
3757: file=/home/fnatoli/CSharp/HelloWorld/libplmwtss-c.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0]
3757:
3757: file=libplmwtss-c.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0]
3757: find library=libplmwtss-c.so [0]; searching
3757: search path=tls/x86_64/x86_64:tls/x86_64:tls/x86_64:tls:x86_64/x86_64:x86_64:x86_64: (LD_LIBRARY_PATH)
3757: trying file=tls/x86_64/x86_64/libplmwtss-c.so
3757: trying file=tls/x86_64/libplmwtss-c.so
3757: trying file=tls/x86_64/libplmwtss-c.so
3757: trying file=tls/libplmwtss-c.so
3757: trying file=x86_64/x86_64/libplmwtss-c.so
3757: trying file=x86_64/libplmwtss-c.so
3757: trying file=x86_64/libplmwtss-c.so
3757: trying file=libplmwtss-c.so
3757: search path=/usr/lib64/tls:/usr/lib64 (system search path)
3757: trying file=/usr/lib64/tls/libplmwtss-c.so
3757: trying file=/usr/lib64/libplmwtss-c.so
3757:
3757: file=libplmwtss-c.so [0]; generating link map
3757: dynamic: 0x00007f077a43abf8 base: 0x00007f077a20b000 size: 0x00000000002485e0
3757: entry: 0x00007f077a223440 phdr: 0x00007f077a20b040 phnum: 7
Note the file is found in /usr/lib64 and a link map is generated.
Here is the revised source referencing a truly non-existent libplmwtss-cx.so:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld { [StructLayout(LayoutKind.Explicit, Pack = 1, CharSet = CharSet.Ansi)] public unsafe struct FACE_TSS_Base_ops { [FieldOffset(0)] public UInt64 ctor; [FieldOffset(4)] public UInt64 dtor; [FieldOffset(8)] public UInt64 Initialize; [FieldOffset(12)] public UInt64 Create_Connection; [FieldOffset(16)] public UInt64 Destroy_Connection; [FieldOffset(20)] public UInt64 Unregister_Callback; }
[StructLayout(LayoutKind.Explicit, Pack = 1, CharSet = CharSet.Ansi)]
public unsafe struct FACE_TSS_Base
{
[FieldOffset(0)] public FACE_TSS_Base_ops ops;
[FieldOffset(48)] public UInt64 data;
}
[StructLayout(LayoutKind.Explicit, Pack = 1, CharSet = CharSet.Ansi)]
public unsafe struct FACE_string
{
[FieldOffset(0)] public UInt32 isManaged;
[FieldOffset(8)] public UInt64 length;
[FieldOffset(16)] public UInt64 capacity;
[FieldOffset(24)] public UInt64 bound;
[FieldOffset(32)] public IntPtr buffer;
}
class Program
{
[DllImport("libplmwtss-cx", CallingConvention = CallingConvention.Cdecl)]
public static extern void FACE_TSS_Base_Initialize(ref FACE_TSS_Base PL_BASE_TSI, ref FACE_string config, ref int retCode);
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
string path = "/opt/pl-middleware/tss/TSSConnections.json";
byte[] pathBytes = Encoding.ASCII.GetBytes(path);
FACE_TSS_Base PL_BASE_TSI = new FACE_TSS_Base();
PL_BASE_TSI.ops.ctor = 0;
PL_BASE_TSI.ops.dtor = 0;
PL_BASE_TSI.ops.Initialize = 0;
PL_BASE_TSI.ops.Create_Connection = 0;
PL_BASE_TSI.ops.Destroy_Connection = 0;
PL_BASE_TSI.ops.Unregister_Callback = 0;
FACE_string config;
config.isManaged = 1;
config.length = 0;
config.capacity = 0;
config.bound = 0;
config.buffer = Marshal.AllocHGlobal(pathBytes.Length);
Marshal.Copy(pathBytes, 0, config.buffer, pathBytes.Length);
int retCode = -1;
FACE_TSS_Base_Initialize(ref PL_BASE_TSI, ref config, ref retCode);
Console.WriteLine(string.Format("FACE_TSS_Base_Initialize retCode={0} Initialize={1} data={2}", retCode, PL_BASE_TSI.ops.Initialize.ToString("X16"), PL_BASE_TSI.data.ToString("X16")));
}
}
}
That also fails with System.DllNotFoundException.
And here is the relevant extract from LD_DEBUG_all output:
3496: file=/usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libplmwtss-cx.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0]
3496:
3496: file=/home/fnatoli/CSharp/HelloWorldNoSuchFile/libplmwtss-cx.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0]
3496:
3496: file=libplmwtss-cx.so [0]; dynamically loaded by /usr/lib64/dotnet/shared/Microsoft.NETCore.App/3.1.11/libcoreclr.so [0]
3496: find library=libplmwtss-cx.so [0]; searching
3496: search path=tls/x86_64/x86_64:tls/x86_64:tls/x86_64:tls:x86_64/x86_64:x86_64:x86_64: (LD_LIBRARY_PATH)
3496: trying file=tls/x86_64/x86_64/libplmwtss-cx.so
3496: trying file=tls/x86_64/libplmwtss-cx.so
3496: trying file=tls/x86_64/libplmwtss-cx.so
3496: trying file=tls/libplmwtss-cx.so
3496: trying file=x86_64/x86_64/libplmwtss-cx.so
3496: trying file=x86_64/libplmwtss-cx.so
3496: trying file=x86_64/libplmwtss-cx.so
3496: trying file=libplmwtss-cx.so
3496: search path=/usr/lib64/tls:/usr/lib64 (system search path)
3496: trying file=/usr/lib64/tls/libplmwtss-cx.so
3496: trying file=/usr/lib64/libplmwtss-cx.so
3496: search path=/usr/local/lib64/tls/x86_64/x86_64:/usr/local/lib64/tls/x86_64:/usr/local/lib64/tls/x86_64:/usr/local/lib64/tls:/usr/local/lib64/x86_64/x86_64:/usr/local/lib64/x86_64:/usr/local/lib64/x86_64:/usr/local/lib64:/usr/local/lib/tls/x86_64/x86_64:/usr/local/lib/tls/x86_64:/usr/local/lib/tls/x86_64:/usr/local/lib/tls:/usr/local/lib/x86_64/x86_64:/usr/local/lib/x86_64:/usr/local/lib/x86_64:/usr/local/lib (LD_LIBRARY_PATH)
3496: trying file=/usr/local/lib64/tls/x86_64/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib64/tls/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib64/tls/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib64/tls/libplmwtss-cx.so
3496: trying file=/usr/local/lib64/x86_64/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib64/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib64/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib64/libplmwtss-cx.so
3496: trying file=/usr/local/lib/tls/x86_64/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib/tls/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib/tls/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib/tls/libplmwtss-cx.so
3496: trying file=/usr/local/lib/x86_64/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib/x86_64/libplmwtss-cx.so
3496: trying file=/usr/local/lib/libplmwtss-cx.so
3496: search cache=/etc/ld.so.cache
3496: search path=/lib64/tls/x86_64/x86_64:/lib64/tls/x86_64:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64/x86_64:/lib64/x86_64:/lib64/x86_64:/lib64:/usr/lib64/tls:/usr/lib64 (system search path)
3496: trying file=/lib64/tls/x86_64/x86_64/libplmwtss-cx.so
3496: trying file=/lib64/tls/x86_64/libplmwtss-cx.so
3496: trying file=/lib64/tls/x86_64/libplmwtss-cx.so
3496: trying file=/lib64/tls/libplmwtss-cx.so
3496: trying file=/lib64/x86_64/x86_64/libplmwtss-cx.so
3496: trying file=/lib64/x86_64/libplmwtss-cx.so
3496: trying file=/lib64/x86_64/libplmwtss-cx.so
3496: trying file=/lib64/libplmwtss-cx.so
3496: trying file=/usr/lib64/tls/libplmwtss-cx.so
3496: trying file=/usr/lib64/libplmwtss-cx.so
`
Note how different this LD_DEBUG=all output is from the previous LD_DEBUG=all output because, quite simply, this file does not exist whereas the former does.
I sincerely hope this convinces you the problem is with Microsoft dotnet failing to resolve symbol linkages and not me referencing a non-existent library.
@FrankNatoli thanks for your reply. I have updated the issue title to match what you have mentioned. From your logs, do you still the problem is specific to System.Globalization.Native? I would suggest you enable Globalization Invariant Mode which will avoid using System.Globalization.Native. This just to isolate where exactly the problem is coming from.
@FrankNatoli thanks for your reply. I have updated the issue title to match what you have mentioned. From your logs, do you still the problem is specific to System.Globalization.Native? I would suggest you enable Globalization Invariant Mode which will avoid using System.Globalization.Native. This just to isolate where exactly the problem is coming from.
@tarekgh: many, many thanks. Setting environment variable "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1" eliminated all four GlobalizationNative_xxx issues and single u_strlen issue. Only one "fatal" remains in "LD_DEBUG=all" output, that of "protobuf_c_empty_string". Here is the result of my search using "readelf -a" for "protobuf_c_empty_string" in all dot-so files: //usr/lib64/libprotobuf-c.so.1.0.0 [15] protobuf_c_empty_string@@LIBPROTOBUF_C_1 //usr/lib64/libplmwdm-c.so [UND] protobuf_c_empty_string //usr/lib64/libplmwdm-c.so [UND] protobuf_c_empty_string //usr/local/lib/libprotobuf-c.so.1.0.0 [14] protobuf_c_empty_string@@LIBPROTOBUF_C_1 Here is what I believe is happening: (1) my C# source references function FACE_TSS_Base_Initialize in DllImport file libplmwtss-c.so [customer proprietary]. (2) dotnet loads libplmwtss-c.so and numerous other libraries in an effort to resolve all referenced symbols. (3) libplmwdm-c.so [also customer proprietary] references "protobuf_c_empty_string". (4) A C++ decorated "protobuf_c_empty_string@@LIBPROTOBUF_C_1" is found in libprotobuf_c.so.1.0.0 [third party] but dotnet does not recognize that for "protobuf_c_empty_string". At first glance, that would seem to be an error in libplmwdm-c.so. Except, a C [not C++] language source, calling into FACE_TSS_Base_Initialize in libplmwtss-c.so, native compiled into dot-o then linked appropriately, has no problem resolving all symbols and successfully executing. Therefore, I infer, native compile and link has a way of resolving C++ decorated symbols that dotnet does not.
I am still very unsure of what's going on.
- What does
ldd /usr/lib64/libplmwdm-c.soshow? - What about
readelf -a ldd /usr/lib64/libplmwdm-c.so | grep NEED? - What about
eu-readelf -a ldd /usr/lib64/libplmwdm-c.so | grep protobuf_c_empty_string?
A C++ decorated "protobuf_c_empty_string@@LIBPROTOBUF_C_1
What leads you to suspect this a C++ decorated function? Don't C++ managed names look like _ZN7QString8truncateEi?
Could you share more about this:
Except, a C [not C++] language source, calling into FACE_TSS_Base_Initialize in libplmwtss-c.so, native compiled into dot-o then linked appropriately, has no problem resolving all symbols and successfully executing.
A C file that shows the code, plus the commands to build, link and run the executable would be a nice point of comparison. I would be interested in the output of ldd and eu-readelf | grep protobuf_c_empty_string on that binary as well.
For "ldd /usr/lib64/libplmwdm-c.so" I see:
linux-vdso.so.1 (0x00007ffd7fba9000)
libc.so.6 (0x00007fe4948d9000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe494ec9000)
For "readelf -a /usr/lib64/libplmwdm-c.so | grep NEED" I see:
[ 6] .gnu.version_r VERNEED 00000000000091f8 000091f8 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000006ffffffe (VERNEED) 0x91f8 0x000000006fffffff (VERNEEDNUM) 1
And for "eu-readelf -a /usr/lib64/libplmwdm-c.so | grep protobuf_c_empty_string" I see;
0x0000000000224928 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224970 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002249b8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224a00 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224a48 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224b28 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224b70 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224bb8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224c00 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224cc8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224d10 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224d58 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224da0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224de8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224e30 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224e78 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224ec0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224f08 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224f50 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224f98 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000224fe0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225028 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225070 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002250b8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225100 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225148 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225190 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002251d8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225220 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225688 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225e68 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000225eb0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000226a88 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002272e8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002287f0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000228b00 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000228c68 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000228cb0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000228e08 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002293b0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000229440 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002294d0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002295a8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002295f0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002296c8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002297a8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002298c8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x00000000002299e8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000229b48 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000229b90 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000229c20 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x0000000000229d68 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022a028 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022a070 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022a0b8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022a528 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022a600 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022a648 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022a8e8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022a9c8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022aaa8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022acd0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022ad18 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022ae30 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022ae78 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022af48 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022b2e8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022b7c8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022b810 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022b8e8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022b9c0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022bae8 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022bbc0 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022bc08 X86_64_64 000000000000000000 +0 protobuf_c_empty_string 0x000000000022be68 X86_64_GLOB_DAT 000000000000000000 +0 protobuf_c_empty_string 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF protobuf_c_empty_string 382: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF protobuf_c_empty_string [ 4a7e] protobuf_c_empty_string [ b3] protobuf_c_empty_string
I presume your use of "ldd" for "readelf" and "eu-readelf" was mistaken? Both of them are unhappy with an argument of "ldd". Perhaps I am mistaken about "C++ decorated"; I otherwise cannot explain the "@@LIBPROTOBUF_C_1" suffix.
ldd for the C language executable is:
linux-vdso.so.1 (0x00007fff4e5d2000)
libplmwdm-c.so => /usr/lib64/libplmwdm-c.so (0x00007f02c3d45000)
libplmwdm.so => /usr/lib64/libplmwdm.so (0x00007f02c3aa8000)
libplmwtim.so => /usr/lib64/libplmwtim.so (0x00007f02c38a5000)
libplmwtss.so => /usr/lib64/libplmwtss.so (0x00007f02c350c000)
libplmwtss-c.so => /usr/lib64/libplmwtss-c.so (0x00007f02c32c3000)
libplmwtsm.so => /usr/lib64/libplmwtsm.so (0x00007f02c2f40000)
libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007f02c2d20000)
librdkafka++.so.1 => /usr/lib64/librdkafka++.so.1 (0x00007f02c2b00000)
libcppkafka.so.0.3.1 => /usr/local/lib64/libcppkafka.so.0.3.1 (0x00007f02c283a000)
libprotobuf-c.so.1 => /usr/lib64/libprotobuf-c.so.1 (0x00007f02c2631000)
libprotobuf.so.22 => /usr/lib64/libprotobuf.so.22 (0x00007f02c2108000)
libc.so.6 => /usr/lib64/libc.so.6 (0x00007f02c1d45000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f02c19b0000)
libm.so.6 => /usr/lib64/libm.so.6 (0x00007f02c162e000)
libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007f02c1416000)
/lib64/ld-linux-x86-64.so.2 (0x00007f02c3f72000)
librdkafka.so.1 => /usr/lib64/librdkafka.so.1 (0x00007f02c1146000)
librt.so.1 => /usr/lib64/librt.so.1 (0x00007f02c0f3e000)
libssl.so.1.1 => /usr/lib64/libssl.so.1.1 (0x00007f02c0caa000)
libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 (0x00007f02c07c4000)
libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007f02c05c0000)
libz.so.1 => /usr/lib64/libz.so.1 (0x00007f02c03a9000)
libsasl2.so.3 => /usr/lib64/libsasl2.so.3 (0x00007f02c018b000)
liblz4.so.1 => /usr/lib64/liblz4.so.1 (0x00007f02bff6e000)
libresolv.so.2 => /usr/lib64/libresolv.so.2 (0x00007f02bfd57000)
libcrypt.so.1 => /usr/lib64/libcrypt.so.1 (0x00007f02bfb2e000)
libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007f02bf8d9000)
libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007f02bf5f0000)
libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007f02bf3d9000)
libcom_err.so.2 => /usr/lib64/libcom_err.so.2 (0x00007f02bf1d5000)
libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007f02befc4000)
libkeyutils.so.1 => /usr/lib64/libkeyutils.so.1 (0x00007f02bedc0000)
libselinux.so.1 => /usr/lib64/libselinux.so.1 (0x00007f02beb96000)
libpcre2-8.so.0 => /usr/lib64/libpcre2-8.so.0 (0x00007f02be912000)
eu-readelf for the C language executable has no occasion of "protobuf_c_empty_string" but for simply "protobuf" shows:
NEEDED Shared library: [libprotobuf-c.so.1] NEEDED Shared library: [libprotobuf.so.22] [ 50a] libprotobuf-c.so.1 [ 51d] libprotobuf.so.22
Thanks for your time.
Thanks for that! I think I see why this happens.
For "ldd /usr/lib64/libplmwdm-c.so" I see:
linux-vdso.so.1 (0x00007ffd7fba9000) libc.so.6 (0x00007fe4948d9000) /lib64/ld-linux-x86-64.so.2 (0x00007fe494ec9000)For "readelf -a /usr/lib64/libplmwdm-c.so | grep NEED" I see:
[ 6] .gnu.version_r VERNEED 00000000000091f8 000091f8 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000006ffffffe (VERNEED) 0x91f8 0x000000006fffffff (VERNEEDNUM) 1
One thing worth noting: libplmwdm-c.so doesn't have a dependency on libprotobuf-c.so - or variants, like libprotobuf-c.so.1 - or libprotobuf.so. Nothing in the output says "libplmwdm-c.so needs another library".
And for "eu-readelf -a /usr/lib64/libplmwdm-c.so | grep protobuf_c_empty_string" I see;
0x000000000022be68 X86_64_GLOB_DAT 000000000000000000 +0 protobuf_c_empty_string 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF protobuf_c_empty_string 382: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF protobuf_c_empty_string
If I am understanding this right, this NOTYPE GLOBAL DEFAULT UNDEF protobuf_c_empty_string means "libplmwdm-c.so will use protobuf_c_empty_string but it doesn't know where that comes from; something else will supply it". It doesn't say what will.
I think this is why this issue is happening: the library wants protobuf_c_empty_string but it expects someone else to supply it. Nothing else supplies it when this library is called via .NET. So you get the error loading the library.
Lets see what you C executable says it depends on:
ldd for the C language executable is:
linux-vdso.so.1 (0x00007fff4e5d2000) libplmwdm-c.so => /usr/lib64/libplmwdm-c.so (0x00007f02c3d45000) libplmwdm.so => /usr/lib64/libplmwdm.so (0x00007f02c3aa8000) libplmwtim.so => /usr/lib64/libplmwtim.so (0x00007f02c38a5000) libplmwtss.so => /usr/lib64/libplmwtss.so (0x00007f02c350c000) libplmwtss-c.so => /usr/lib64/libplmwtss-c.so (0x00007f02c32c3000) libplmwtsm.so => /usr/lib64/libplmwtsm.so (0x00007f02c2f40000) libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007f02c2d20000) librdkafka++.so.1 => /usr/lib64/librdkafka++.so.1 (0x00007f02c2b00000) libcppkafka.so.0.3.1 => /usr/local/lib64/libcppkafka.so.0.3.1 (0x00007f02c283a000) libprotobuf-c.so.1 => /usr/lib64/libprotobuf-c.so.1 (0x00007f02c2631000) libprotobuf.so.22 => /usr/lib64/libprotobuf.so.22 (0x00007f02c2108000) libc.so.6 => /usr/lib64/libc.so.6 (0x00007f02c1d45000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f02c19b0000) libm.so.6 => /usr/lib64/libm.so.6 (0x00007f02c162e000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007f02c1416000) /lib64/ld-linux-x86-64.so.2 (0x00007f02c3f72000) librdkafka.so.1 => /usr/lib64/librdkafka.so.1 (0x00007f02c1146000) librt.so.1 => /usr/lib64/librt.so.1 (0x00007f02c0f3e000) libssl.so.1.1 => /usr/lib64/libssl.so.1.1 (0x00007f02c0caa000) libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 (0x00007f02c07c4000) libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007f02c05c0000) libz.so.1 => /usr/lib64/libz.so.1 (0x00007f02c03a9000) libsasl2.so.3 => /usr/lib64/libsasl2.so.3 (0x00007f02c018b000) liblz4.so.1 => /usr/lib64/liblz4.so.1 (0x00007f02bff6e000) libresolv.so.2 => /usr/lib64/libresolv.so.2 (0x00007f02bfd57000) libcrypt.so.1 => /usr/lib64/libcrypt.so.1 (0x00007f02bfb2e000) libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007f02bf8d9000) libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007f02bf5f0000) libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007f02bf3d9000) libcom_err.so.2 => /usr/lib64/libcom_err.so.2 (0x00007f02bf1d5000) libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007f02befc4000) libkeyutils.so.1 => /usr/lib64/libkeyutils.so.1 (0x00007f02bedc0000) libselinux.so.1 => /usr/lib64/libselinux.so.1 (0x00007f02beb96000) libpcre2-8.so.0 => /usr/lib64/libpcre2-8.so.0 (0x00007f02be912000)
Yeah, so your C executable says it wants a ton of libraries. Those libraries are then loaded by the run time linker. Later, if libplmwtss-c.so wants to use a function from one of these libraries, that works, because the linker already know about the library.
Unfortunately, that's not true for .NET. When you load libplmwtss-c.so through .NET and libplmwtss-c.so tries to use a library that hasn't been declared as a dependency, the whole thing fails with the exception you see.
I don't think we should fix this issue on the .NET side. .NET can't declare dependencies on libraries it doesn't use (like protbuf). That will bloat our install size for no reason. .NET also can't declare dependencies on libraries which are non-public. That would just break .NET for all other users.
I think this really is a bug in the libplmwdm-c.so library (or one of the libraries that loads it): it should have a dependency on other libraries like libprotobuf that it needs to use symbols from.
I can think of a few hacks to work around this issue:
- Can you create a custom library (just like you created your executable) that links to all the libraries you need, then inject it via LD_PRELOAD?
- Can you create a custom library (that links to all the dependencies, similar to how you created your executable) then invoke it from your .NET application - this will bring in dependencies like
libprotobuf-c.so- and then call into thelibplmwtss-cthat's causing the breakage?
I presume your use of "ldd" for "readelf" and "eu-readelf" was mistaken?
Yeah, sorry about that: copy/paste mistake.
Perhaps I am mistaken about "C++ decorated"; I otherwise cannot explain the "@@LIBPROTOBUF_C_1" suffix.
A single library can export a symbol (a C function) with multiple different versions. This is useful for maintaining compatibility with older versions of the same library.
For example, librt (part of the standard C library on Linux) has this output:
$ eu-readelf -a /lib64/librt.so.1 | grep 'timer_settime'
110: 0000000000005ae0 66 FUNC GLOBAL DEFAULT 16 timer_settime@@GLIBC_2.3.3
111: 0000000000005b30 23 FUNC GLOBAL DEFAULT 16 timer_settime@GLIBC_2.2.5
...
That @ (and @@) separates the symbol (function) name from the version. So this output means there's a timer_settime function with version GLIBC2.3.3 and another with version GLIBC_2.2.5. If a program wants to use timer_settime with version GLIBC_2.2.5, they get the thing at address 0000000000005b30. The @@ means it's the default version. So if a program/library wants to use timer_settime function and doesn't specify which version, timer_settime@@GLIBC_2.3.3 gets used.
So protobuf_c_empty_string@@LIBPROTOBUF_C_1 is just the function protobuf_c_empty_string at version LIBPROTOBUF_C_1 but also the default version. It's still a "C" function, if you will.
Could I insert into my C# code a DllImport of "protobuf_c_empty_string" in libprotobuf-c? Would dotnet know to load libprotobuf-c.so.1.0.0?
Could I insert into my C# code a DllImport of "protobuf_c_empty_string" in libprotobuf-c?
Doh, yes, of course. Though maybe not DllImport of protobuf_c_empty_string (it's a data structure, not a function).
Would dotnet know to load libprotobuf-c.so.1.0.0?
I think it works if you give it the exact full path, or if it's in the system linker directory (like /usr/lib64), and you give dotnet the full name. Try something like this:
[DllImport("libprotobuf-c.so.1.0.0")]
static extern int protobuf_c_version_number();
Then call this function (ignore the return value because of signed vs unsinged int) before calling into libplmwtss-c.so.
Closing the issue per @omajid replies. Thanks @omajid for your help with that.
@FrankNatoli feel free to continue sending more questions if you have any.