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

DllResolver fails with Ubuntu 22.04 (no libdl.so) #181

Closed
imnasnainaec opened this issue Dec 9, 2022 · 3 comments
Closed

DllResolver fails with Ubuntu 22.04 (no libdl.so) #181

imnasnainaec opened this issue Dec 9, 2022 · 3 comments

Comments

@imnasnainaec
Copy link
Contributor

Describe the bug

Upon updating The Combine from 20.04 to 22.04, our backend encounters the following: System.DllNotFoundException : Unable to load shared library 'libdl.so' or one of its dependencies. This appears to be from the configuration in https://github.com/sillsdev/icu-dotnet/blob/master/source/icu.net/App.config that is enforced by https://github.com/sillsdev/icu-dotnet/blob/master/source/icu.net/NativeMethods/DllResolver.cs.

The error is further documented in sillsdev/TheCombine#1768

Environment

  • Ubuntu 22.04
  • icu.net 2.7.1 & 2.8.1
@ermshiperete
Copy link
Member

This happens if the icu.net.dll.config doesn't get copied next to icu.net.dll, because that tells the name of the shared library to load (in this case libdl.so.2).

Also, when running under net6 you'll have to use the latest pre-release version 2.9.x - it seems that icu.net has to be build for net6 in order to pick up the config file.

See comment in sillsdev/TheCombine#1768.

papeh added a commit to sillsdev/liblcm that referenced this issue Dec 13, 2022
per a comment in sillsdev/icu-dotnet#181
sillsdev/TheCombine#1768

Change-Id: Ia1b09ac7bc0b73670c2a6e10924ae4f94e3e9adf
#issuecomment-1344645680
@papeh
Copy link
Contributor

papeh commented Dec 13, 2022

Even when copying icu.net.dll.config and including its content in SIL.LCModel.Core.Tests/App.config, tests fail with

   System.DllNotFoundException : libdl.so assembly:<unknown assembly> type:<unknown type> member:(null)
  Stack Trace:
    at (wrapper managed-to-native) SIL.LCModel.Core.SpellChecking.SpellEngineLinux.dlopen(string,int)
  at SIL.LCModel.Core.SpellChecking.SpellEngineLinux.get_Library () [0x00014] in <8dfbb8a640e7481f8301a9226f75cf3f>:0 
  at SIL.LCModel.Core.SpellChecking.SpellEngineLinux.Hunspell_initialize (System.Byte[] affFile, System.Byte[] dictFile) [0x00000] in <8dfbb8a640e7481f8301a9226f75cf3f>:0 

(see https://github.com/sillsdev/liblcm/actions/runs/3688810619/jobs/6244040627)
Anything else I need to do?

@papeh papeh reopened this Dec 13, 2022
@ermshiperete
Copy link
Member

That's a rabbit trail. Note that this reference of libdl.so doesn't come from icu.net code but instead from SIL.LCModel.Core which is missing a dll mapping for libdl.so. So this is not a bug in icu.net.

See sillsdev/liblcm#267 (comment)

@ermshiperete ermshiperete closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2022
papeh added a commit to sillsdev/liblcm that referenced this issue Dec 14, 2022
* Update to Newtonsoft.Json 13.0.2 to patch security
* deprecate IsWinXp (8.1 extended support ends is 27 days)
* Update to Icu4c 70.1.152
* Fix Linux Tests (similar to sillsdev/icu-dotnet#181)
* Add libdl.so dll mapping to SIL.LCModel.Core
* Source environ on Linux before running tests and adjust LD_LIBRARY_PATH for libicu.

Co-authored-by: Eberhard Beilharz <eb1@sil.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants