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

Exception occurs on Ubuntu 20.04 #19

Closed
douglas11534 opened this issue Jan 31, 2021 · 5 comments
Closed

Exception occurs on Ubuntu 20.04 #19

douglas11534 opened this issue Jan 31, 2021 · 5 comments

Comments

@douglas11534
Copy link

douglas11534 commented Jan 31, 2021

$ dotnet PgsToSrt.dll --input test.sup --output test.srt --tesseractlanguage eng
PgsToSrt 1.3.0.0

2021/01/31 13:38:00.145|INFO|Detected tesseract language data for language 'eng'.
2021/01/31 13:38:00.180|INFO|Starting OCR for 285 items...
2021/01/31 13:38:00.228|ERROR|Error: Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Tncl.NativeLoader.NativeInstance.CreateInstance(NativeLoader loader, Type interfaceType)
at PgsToSrt.TesseractApi.Initialize()
at PgsOcr.DoOcr() Exception has been thrown by the target of an invocation.

I am using:

  • Ubuntu 20.04.2 LTS
  • libtesseract4
  • dotnet 5.0.102

$ ldconfig -p -v | grep libdl
libdl.so.2 (libc6,x86-64, OS ABI: Linux 3.2.0) => /lib/x86_64-linux-gnu/libdl.so.2
libdl.so.2 (libc6, OS ABI: Linux 3.2.0) => /lib/i386-linux-gnu/libdl.so.2
libdl.so (libc6,x86-64, OS ABI: Linux 3.2.0) => /lib/x86_64-linux-gnu/libdl.so

Simiar to issue #6, caused by the missing libtesseract3 package

@Tentacule
Copy link
Owner

Can you run the command below and add the output to this issue
ldconfig -p -v | grep libdl

@Tentacule
Copy link
Owner

I cannot reproduce this issue with Ubuntu on Windows.

But you can retry with the latest version (v1.4.0), it has an improved linux support and error logging, by now you should have a more descriptive message than "Exception has been thrown by the target of an invocation".

@douglas11534
Copy link
Author

Trying with v1.4.0 gives this output:

$ dotnet PgsToSrt.dll --input test2.sup --output test2.srt --tesseractlanguage eng
PgsToSrt 1.4.0.0

2021/03/05 13:19:40.603|INFO|Detected tesseract language data for language 'eng'.
2021/03/05 13:19:40.647|INFO|Starting OCR for 494 items...
2021/03/05 13:19:40.770|ERROR|Failed: Unable to load shared library 'libtesseract.so.4' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /snap/core18/current/lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /lib/x86_64-linux-gnu/libtesseract.so.4) Unable to load shared library 'libtesseract.so.4' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /snap/core18/current/lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /lib/x86_64-linux-gnu/libtesseract.so.4)

Checking the current GLIBC version:

$ ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.2) 2.31
...

@Tentacule
Copy link
Owner

Ok, it's not working because you installed dotnet 5 through Snap and libtesseract with apt (or another 'non-snap' package manager).

Unfortunatly that's leading to a situation where this version of dotnet 5 is depending on Snap 'core18' (ie. Ubuntu 18), but libtessract4 is compiled to work on Ubuntu 20 (your Ubuntu installed version).

I may create a Snap version of PgsToStr in the future but the quick fix for now is to install dotnet 5 with apt.

https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2004-

@douglas11534
Copy link
Author

Thanks for the info.
I have installed dotnet with apt as you suggested and the software now runs without a problem.
Great work!

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

2 participants