You are not logged in.

#1 2016-03-29 12:33:34

zebulon
Member
Registered: 2008-10-20
Posts: 365

mono 4.4 breaks portable applications using local mono libraries

Hi,

I have a problem with airvpn client (an open source VPN client for AirVPN service) since mono has been updated to 4.4.0.40 from 4.2.2.30.

AirVPN client can use either system mono, or its local mono package when using the AirVPN client tarball from the AirVPN website or the airvpn-portable package from AUR. The "portable" version provides file libMonoPosixHelper.so in the airvpn install folder.

When mono-4.2.2.30 package was also installed system wide, the portable version was running fine, using its own libraries. After mono has been updated to 4.4.0.40, then launching airvpn leads to this error:

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Mono.Unix.Native.Syscall ---> System.DllNotFoundException: $mono_libdir/libMonoPosixHelper.so
  at (wrapper managed-to-native) Mono.Unix.Native.Syscall:_L_ctermid ()
  at Mono.Unix.Native.Syscall..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at AirVPN.Platforms.Linux.GetExecutablePath () [0x00000] in <filename unknown>:0 
  at AirVPN.Core.Platform.GetProgramFolder () [0x00000] in <filename unknown>:0 
  at AirVPN.Core.Engine.Initialization () [0x00000] in <filename unknown>:0 
  at AirVPN.UI.Linux.Program.Main () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Mono.Unix.Native.Syscall ---> System.DllNotFoundException: $mono_libdir/libMonoPosixHelper.so
  at (wrapper managed-to-native) Mono.Unix.Native.Syscall:_L_ctermid ()
  at Mono.Unix.Native.Syscall..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at AirVPN.Platforms.Linux.GetExecutablePath () [0x00000] in <filename unknown>:0 
  at AirVPN.Core.Platform.GetProgramFolder () [0x00000] in <filename unknown>:0 
  at AirVPN.Core.Engine.Initialization () [0x00000] in <filename unknown>:0 
  at AirVPN.UI.Linux.Program.Main () [0x00000] in <filename unknown>:0 

Normally, system-wide mono should not override the use of the local libraries. Why is it so with the new mono 4.4, and what could have changed between the old and new version?

Thanks in advance for your suggestions.

Offline

#2 2016-03-29 13:21:36

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,758

Re: mono 4.4 breaks portable applications using local mono libraries

This sounds like libMonoPosixHelper.so may be linked dynamically to some libs that are not included.

Could you post

ldd libMonoPosixHelper.so

both with and without mono 4.4 installed ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2016-03-29 17:29:28

zebulon
Member
Registered: 2008-10-20
Posts: 365

Re: mono 4.4 breaks portable applications using local mono libraries

Lone_Wolf wrote:

This sounds like libMonoPosixHelper.so may be linked dynamically to some libs that are not included.

Could you post

ldd libMonoPosixHelper.so

both with and without mono 4.4 installed ?

From the AirVPN tarball directory:

With mono 4.4.0.40-2 installed:

$ ldd libMonoPosixHelper.so
        linux-vdso.so.1 (0x00007ffe6eba3000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007f3f4c0e4000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007f3f4bddf000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f3f4bbdb000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f3f4b9bd000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f3f4b61c000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x000055e4f0847000)

After removal of mono (and having run sudo ldconfig):

$ ldd libMonoPosixHelper.so 
        linux-vdso.so.1 (0x00007fff8dbf4000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007fcf5f83a000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007fcf5f535000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fcf5f331000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fcf5f113000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007fcf5ed72000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x0000556d9d963000)

Last edited by zebulon (2016-03-29 17:33:48)

Offline

#4 2016-03-30 07:30:32

zebulon
Member
Registered: 2008-10-20
Posts: 365

Re: mono 4.4 breaks portable applications using local mono libraries

There does not seem to be any difference. Could it be a path problem, leading airvpn to use system libraries prior to the local one?

Offline

#5 2016-03-30 13:52:10

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,758

Re: mono 4.4 breaks portable applications using local mono libraries

Zebulon, i looked into the AUR airvpn-portable package and am considering filing a deletion request and a warning post on aur-general about it !

This package creates a folder in user HOME folder, something arch packages should NEVER do.

In the .install-file it also changes stuff things in userfolders !


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2016-03-30 17:47:26

zebulon
Member
Registered: 2008-10-20
Posts: 365

Re: mono 4.4 breaks portable applications using local mono libraries

Lone_Wolf wrote:

Zebulon, i looked into the AUR airvpn-portable package and am considering filing a deletion request and a warning post on aur-general about it !

This package creates a folder in user HOME folder, something arch packages should NEVER do.

In the .install-file it also changes stuff things in userfolders !

Thanks for pointing this out. This is indeed bad practice and it should be corrected.

However the mono problem is another matter: the tarball from AirVPN website behaves the same (airvpn-portable in AUR is actually a deployment of that same tarball). So we still need to diagnose this issue that did not happen with mono 4.2 (or no mono at all).

Offline

#7 2016-03-30 22:36:03

Anon1234
Member
Registered: 2016-03-30
Posts: 6

Re: mono 4.4 breaks portable applications using local mono libraries

Here is the output with Mono 4.2.2.30 installed

$ ldd libMonoPosixHelper.so   
        linux-vdso.so.1 (0x00007ffeaaad1000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f15ad2d6000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007f15acfd1000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f15acdcd000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f15acbaf000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f15ac80e000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x000055a4d1447000)

Not sure if it will help, but thought i would include it in case it helps

Anon1234

Last edited by Anon1234 (2016-03-30 22:36:29)

Offline

#8 2016-03-31 14:16:52

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,758

Re: mono 4.4 breaks portable applications using local mono libraries

Ok, the ldd output doesn't give any clues.

I downloaded the protable tarball, extracted it.

$ ls -l
total 19196
-rwxr-xr-x 1 panoramix users 8210925 13 aug  2015 airvpn
-rwxr-xr-x 1 panoramix users 5436026 13 aug  2015 libgdiplus.so.0
-rwxr-xr-x 1 panoramix users  228944 13 aug  2015 libMonoPosixHelper.so
-rwxr-xr-x 1 panoramix users 3029664 13 aug  2015 openvpn                                                        
-rwxr-xr-x 1 panoramix users 2739956 13 aug  2015 stunnel                                                        
-rwxr-xr-x 1 panoramix users    1357 13 aug  2015 update-resolv-conf                                             
$  

No documentation,no instructions,just 3 binaries + 1 bashscript +2 libraries .

I decide to try running ./airvpn --help and am greeted by a kdesu prompt asking for root credentials.
I cancel that prompt, get the kdesu help output and have to use CTRL+C to get back to the bash prompt.

I sincerely hope the non-portable version of airvpn builds from source and does have documentation, but i won't touch the portable version anymore.

For those trusting this tarball :

compare PKGBUILD for mono 4.2.2.30 with latest mono .
Several patches have been removed, try building latest mono with those patches to see if that solves the problem.

The patch named "Microsoft.Portable.Common.targets" looks like a good starting point.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#9 2016-04-01 07:27:03

zebulon
Member
Registered: 2008-10-20
Posts: 365

Re: mono 4.4 breaks portable applications using local mono libraries

Lone_Wolf wrote:

For those trusting this tarball :

compare PKGBUILD for mono 4.2.2.30 with latest mono .
Several patches have been removed, try building latest mono with those patches to see if that solves the problem.

The patch named "Microsoft.Portable.Common.targets" looks like a good starting point.

Thanks Lone_Wolf. Please note that AirVPN client is open source and available on Github: https://github.com/AirVPN/airvpn-client. The fact it requires root privilege is because it uses iptables to lock down the network in case the VPN somehow disconnects.

I reported the issue on AirVPN forum, and was told there is a development version of the client at https://github.com/Clodo76/airvpn-clien … 4459defdc9. I will try it.

Offline

Board footer

Powered by FluxBB