gentoo/dotnet

libgdiplus.so.0 is not found

EinstokFair opened this issue · 5 comments

After updating from mono-5.12 to mono 5.20, my Windows.Forms application stopped working. When I launch it, it doen't start, and prints into console the following:


Name (current) = ru-RU
Name (thread) = ru-RU
LCID = 1049
exception inside UnhandledException handler: (null) assembly:/usr/lib64/mono/4.5/mscorlib.dll type:TypeInitializationException member:(null)

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception. ---> System.DllNotFoundException: libgdiplus.so.0
  at (wrapper managed-to-native) System.Drawing.GDIPlus.GdiplusStartup(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x000b0] in /var/tmp/portage/dev-lang/mono-5.20.1.19/work/mono-5.20.1.19-abi_x86_64.amd64/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:134 

The file is present on disk:


# time find / -iname "libgdiplus.so*"
/usr/lib64/libgdiplus.so
/usr/lib64/debug/usr/lib64/libgdiplus.so.0.0.0.debug
/usr/lib64/libgdiplus.so.0
/usr/lib64/libgdiplus.so.0.0.0

real 8m53,934s
user 0m15,843s
sys 0m36,169s 

It comes from


$ qfile /usr/lib64/libgdiplus.so.0.0.0
dev-dotnet/libgdiplus (/usr/lib64/libgdiplus.so.0.0.0) 

I suppose, that this file is used by System.Drawing.dll (from stack trace details): There is only one such file in the system:


/usr/lib64/mono # readlink ./4.5/System.Drawing.dll
../gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 

I tried to use ld to check which path is tested, but failed:


/usr/lib64/mono/gac $ sudo ld ./System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
ld: i386 architecture of input file `./System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll' is incompatible with i386:x86-64 output
ld: warning: cannot find entry symbol _start; defaulting to 0000000000400084 

I don't know what to check next

see also
mono/mono#14030
https://bugs.gentoo.org/682068
https://bugs.gentoo.org/682198
https://stackoverflow.com/questions/22596498/mono-and-libgdiplus-libgdi-not-found

fixed with cc646e0

cnd commented

ported to tree

gentoo/gentoo@2e6dcec
gentoo/gentoo@29a833b

thank you for report & test

leio commented

ported to tree

That was reverted due to some deptree breakage.

leio commented

I don't agree with it having been handled that way (arm64 keywords should have been dropped instead), BUT I also do not see a re-keywording bug for arm (let alone arm64), which must be done as even asked about in the developer quizzes.

cnd commented

Yes, I've mistaken with libgdiplus update, reverted keywords to old ones for now