LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-13-2014, 03:46 AM   #1
wombatr0n
LQ Newbie
 
Registered: Aug 2014
Posts: 1

Rep: Reputation: Disabled
Mono gives unhandled exception in Slackware 14.1


I've been trying to use the portable version of KeePass on Slackware, and I ran into a problem: I can't seem to run anything with mono. I installed it and the dependencies with sbopkg. After unzipping the KeePass portable archive to my flash drive, I run:

mono KeePass.exe, which gives me:

Code:
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.Net.Sockets.SocketException: The requested address is not valid in this context
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] in <filename unknown>:0 
  at KeePass.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.Net.Sockets.SocketException: The requested address is not valid in this context
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] in <filename unknown>:0 
  at KeePass.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
With mono --debug KeePass.exe, I get:
Code:
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.Net.Sockets.SocketException: The requested address is not valid in this context
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00065] in /tmp/SBo/mono-3.2.3/mcs/class/System/System.Net.Sockets/Socket.cs:1115 
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x001c6] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:494 
  at System.Windows.Forms.XplatUIX11..ctor () [0x0006c] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:268 
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x0001c] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:297 
  at System.Windows.Forms.XplatUI..cctor () [0x0007d] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:112 
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Application.EnableVisualStyles () [0x00006] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:487 
  at KeePass.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.Net.Sockets.SocketException: The requested address is not valid in this context
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00065] in /tmp/SBo/mono-3.2.3/mcs/class/System/System.Net.Sockets/Socket.cs:1115 
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x001c6] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:494 
  at System.Windows.Forms.XplatUIX11..ctor () [0x0006c] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:268 
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x0001c] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:297 
  at System.Windows.Forms.XplatUI..cctor () [0x0007d] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:112 
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Application.EnableVisualStyles () [0x00006] in /tmp/SBo/mono-3.2.3/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:487 
  at KeePass.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
I tried installing the KeePass slackbuild, and I got a similar error, which made me think it had something to do with mono. I copied and pasted a test program from the mono project website, compiled, and got a similar error when trying to run the resulting exe.

I think it has something to do with the WinForms library, which googling revealed isn't always installed with mono on Linux. Does anyone know if this is the case for Slackware, and if so is there a option to enable it when installing the slackbuild? Or is there some other issue?

Last edited by wombatr0n; 08-13-2014 at 03:48 AM.
 
Old 08-13-2014, 08:15 AM   #2
slacktroll
Member
 
Registered: May 2011
Distribution: Slackware64/current
Posts: 175

Rep: Reputation: 45
Works for me!
ls /var/log/packages/|grep mono
mono-2.11.4-i486-1_SBo
mono-addins-1.0-i486-1_SBo

KeePass-2.27.zip,
Professional Edition
KeePass 2.27

Hmm! you used 14.1...
perhaps the 'mono2' package will work? (NOTE IT WILL CONFLICT WITH MONO3)

Last edited by slacktroll; 08-13-2014 at 08:25 AM. Reason: add info regarding keepass
 
Old 08-15-2014, 02:58 AM   #3
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 3,496

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
I use KeePass with mono. I had been using mono 2.10.9 with KeePass, it's latest versin 2.27. My version of libgdiplus is version 2.10.9. I am running on Slackware64-current.

I upgraded mono 3.2.3 and encounter no problems in the compile or running KeePass. I then decided to upgrade to mono 3.6.0 using the source tarball. It works with KeePass. That said, I did run in to a few problems. This only applies to the source tarball you can get from http://download.mono-project.com/sources/mono/ and not from github.

If you have an older version of mono, and I did, it must be removed before compiling mono as it will try to use the older version during the build process. Removing the older version of mono solves this.

The SlackBuild script for mono on SBo needs a slight modification, aside from changing the VERSION to match the mono version. Find README in the docs part of the script near the end and change it to README.md

After a successful run with the modified mono.SlackBuild and running keepass I encountered a similar, yet different error than yours, basically it could not find /usr/lib/libgdiplus.so.

I'm on a x86_64 system and libgdiplus is located in /usr/lib64/. The quick fix was to create a simlink

Code:
ln -s /usr/lib64/libgdiplus.so /usr/lib/libgdiplus.so
KeePass is installed using the SlackBuild from SBo.

By the way, on a standard installation of Slackware the only requirement for mono is libgdiplus.
 
Old 08-17-2014, 04:21 PM   #4
larryhaja
Member
 
Registered: Jul 2008
Distribution: Slackware 13.1
Posts: 305

Rep: Reputation: 80
Quote:
Originally Posted by chrisretusn View Post
After a successful run with the modified mono.SlackBuild and running keepass I encountered a similar, yet different error than yours, basically it could not find /usr/lib/libgdiplus.so.

I'm on a x86_64 system and libgdiplus is located in /usr/lib64/. The quick fix was to create a simlink

Code:
ln -s /usr/lib64/libgdiplus.so /usr/lib/libgdiplus.so
That's an ugly fix. I've already reported the issue to the SBo maintainer back on Jan 19th in regards to libgdiplus on x86_64 for mono. The issue is that the /usr/lib/libgdiplus.so file is hard coded into the /etc/mono/config file.

Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=8309

Looking at that bug it looks like they have fixed it upstream for mono 3.4.0 but I haven't verified.

Simple solution is just to manually edit /etc/mono/config to use /usr/lib64 for libgdiplus.so.
 
Old 08-19-2014, 02:24 AM   #5
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 3,496

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by larryhaja View Post
That's an ugly fix. I've already reported the issue to the SBo maintainer back on Jan 19th in regards to libgdiplus on x86_64 for mono. The issue is that the /usr/lib/libgdiplus.so file is hard coded into the /etc/mono/config file.
I did say it was quick fix.

Quote:
Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=8309

Looking at that bug it looks like they have fixed it upstream for mono 3.4.0 but I haven't verified.
I missed that bug report, thanks for pointing it out. I have verified, it has not been fixed yet. I compiled and installed 3.6.0 from the source tarball available at http://download.mono-project.com/sources/mono/ and it still exist.

Quote:
Simple solution is just to manually edit /etc/mono/config to use /usr/lib64 for libgdiplus.so.
Also a quick fix. One that I have applied (and it works) as I don't like the symlink fix. Thanks.

Wonder if the OP has found a solution yet.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What are the likely causes of this Unhandled Anaconda Exception? MASTER1 Linux - General 1 06-20-2014 12:45 PM
NetworkManager unhandled exception cooltoad Red Hat 1 11-22-2013 09:42 PM
An unhandled exception occurred oldhobo Ubuntu 2 08-17-2013 11:12 AM
Unhandled Exception in SuSE 10.1 pandre45 SUSE / openSUSE 1 10-21-2006 03:03 PM
unhandled exception has occurred thinhla Fedora - Installation 1 06-02-2005 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration