Cryptlex Forums

LexActivator C# nuget does not work under ARM

J
Jan_Funke

Right now I’m evaluating the LexActivator for our C# solutions. I’ve imported the LexActivator nuget package and compiled the project for multiple plattforms. As long as I’m running it under x86 or x64 everything works, whether its linux or windows.

Unfortunately I’m unable to run the application under ARM linux systems. I get the following the error message:

Unhandled exception. System.DllNotFoundException: Unable to load shared library 'LexActivator' or one  of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libLexActivator: cannot open shared object file: No such file or directory

If I copy the ARMhf so lib (libLexActivator.so) from the download page into the binary folder and duplicate it under the name (libLexActivator32.so) I can start the application, but get the following message:

Unhandled exception. Cryptlex.LexActivatorException: The product id is incorrect.
at Cryptlex.LexActivator.IsLicenseGenuine()

It seems like at least the arm runtimes are missing from the nuget package.

Am I doing something wrong here, or does the LexActivator nuget package not work with arm systems in the current state?

Thanks for your help in advance!

A
Adnan KamiliCryptlex team

Hi Jan,

Yes, the ARM runtimes were not present in the package. We have added the following new runtimes in the package now:

macOS ARM64
Linux ARM
Linux ARM64

Please use the LexActivator NuGet package version 3.15.2

Regards,
Adnan

J
Jan_Funke

Thank you for your fast response and the update. Unfortunately its still not working for me for me. Now I get the following error:

Unhandled exception. System.DllNotFoundException: Unable to load shared library ‘LexActivator32’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libLexActivator32: cannot open shared object file: No such file or directory
at Cryptlex.LexActivatorNative.IsLicenseGenuine_x86()
at Cryptlex.LexActivator.IsLicenseGenuine()

Here is the output from LD_DEBUG: https://controlc.com/2b7c8e98

Regards,
Jan

A
Adnan KamiliCryptlex team

It seems ARM32 bit requires library name to have 32 as suffix. Please try version 3.15.3.

J
Jan_Funke

If I use 3.15.3 I’m back at the error from my initial post:

Unhandled exception. System.DllNotFoundException: Unable to load shared library ‘LexActivator’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libLexActivator: cannot open shared object file: No such file or directory
at Cryptlex.LexActivatorNative.SetProductDataA(String productData)
at Cryptlex.LexActivator.SetProductData(String productData)

It seems like there is something broken internally. It first checks for libLexActivator.so, then libLexActivator32.so.

If i provide both files manually I’m stuck with:

Unhandled exception. Cryptlex.LexActivatorException: The product id is incorrect.
at Cryptlex.LexActivator.IsLicenseGenuine()

A
Adnan KamiliCryptlex team

This can only happen if it is being run on a Windows system, this function can never be called on a Linux or macOS system. Can you provide details about your ARM machine and OS?

J
Jan_Funke

It is a Raspberry Pi 2 Rev 1.0 with a 32bit ARM processor running Raspbian (Debian 10 Buster).

lscpu:

Architecture: armv7l
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Vendor ID: ARM
Model: 4
Model name: Cortex-A53
Stepping: r0p4
CPU max MHz: 1400.0000
CPU min MHz: 600.0000
BogoMIPS: 38.40
Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

I added the following code:

Console.WriteLine($"{RuntimeInformation.OSArchitecture} - {RuntimeInformation.OSDescription}");

Which results in:

Arm - Linux 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019

The code is compiled with Net 5.0:

dotnet publish -c Release -r linux-arm

A
Adnan KamiliCryptlex team

I am facing

host/fxr] does not contain any version-numbered

child folders issue on ARM 32 machine to run .NET 5.0. So can you please share the output of the following:

public static bool IsWindows()
        {
#if NETFRAMEWORK
            return Environment.OSVersion.Platform == PlatformID.Win32NT;
#else
            return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#endif
        }

It is seemingly returning true on your machine which is causing the issue.

J
Jan_Funke

The output is false, so the Windows check is working. If you look at my error from 3.15.3, the there is no x86 method call any longer though.

A
Adnan KamiliCryptlex team

Please share the LD_DEBUG output.

J
Jan_Funke
A
Adnan KamiliCryptlex team

Can you again try 3.15.2 and see the error message, if it is using the x86 suffixed function or A suffixed function? If the Windows check is working you should not be getting x86 suffixed function in the stack trace.

J
Jan_Funke

When using 3.15.2, IsLicenseGenuine_x86() is called. As far as I can see, there is no Windows Check in LexActivator.IsLicenseGenuine(), just a pointer size check.

IsWindows? : False
Arm - Linux 5.10.17-v7+ #1421 SMP Thu May 27 13:59:01 BST 2021
Unhandled exception. System.DllNotFoundException: Unable to load shared library ‘LexActivator32’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libLexActivator32: cannot open shared object file: No such file or directory
at Cryptlex.LexActivatorNative.IsLicenseGenuine_x86()
at Cryptlex.LexActivator.IsLicenseGenuine()

A
Adnan KamiliCryptlex team

Ah! now we got the exact issue. It is invoking the incorrect function. The current code assumes only 32 bit Windows machines not the 32 bit Linux machines. Thanks for your help, we will do the fix and update when it is released.

A
Adnan KamiliCryptlex team

Please use the version 3.15.4, it should run without any issues.

J
Jan_Funke

Thank you for the update. It now works as intended!

← Back to all topics · 16 posts · 1819 views · opened 2021-07-26