Bug 59496 - resgen crashes if X11 is not installed
Summary: resgen crashes if X11 is not installed
Status: RESOLVED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: resgen ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-14 15:22 UTC by eb1
Modified: 2017-09-15 22:54 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description eb1 2017-09-14 15:22:11 UTC
It should be possible to compile without having X11 installed. Yet trying to do so crashes in resgen:

System.TypeInitializationException: The type initializer for 'System.Windows.Forms.TableLayoutPanel' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.Layout.TableLayout' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.WindowsFormsSynchronizationContext' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.ArgumentNullException: Could not open display (X-Server required. Check your DISPLAY environment variable)
Parameter name: Display
  at System.Windows.Forms.XplatUIX11.SetDisplay (System.IntPtr display_handle) [0x00435] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Windows.Forms.XplatUIX11..ctor () [0x00077] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x0001c] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Windows.Forms.XplatUI..cctor () [0x0007d] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
   --- End of inner exception stack trace ---
  at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00005] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Windows.Forms.Control..ctor () [0x000ea] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
  at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
   --- End of inner exception stack trace ---
  at System.Windows.Forms.Control..ctor () [0x00014] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Windows.Forms.Control..ctor (System.String text) [0x00000] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor (string)
  at System.Windows.Forms.Layout.TableLayout..cctor () [0x00000] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
   --- End of inner exception stack trace ---
  at System.Windows.Forms.TableLayoutPanel..cctor () [0x00000] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
   --- End of inner exception stack trace ---
  at System.Windows.Forms.Layout.TableLayoutSettingsTypeConverter.ConvertFrom (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, System.Object value) [0x00027] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.ComponentModel.TypeConverter.ConvertFromString (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, System.String text) [0x00000] in <7425e89669ce4771a08a54ff18d47264>:0 
  at System.ComponentModel.TypeConverter.ConvertFromInvariantString (System.String text) [0x00007] in <7425e89669ce4771a08a54ff18d47264>:0 
  at System.Resources.TypeConverterFromResXHandler.ConvertData (System.ComponentModel.TypeConverter c) [0x00066] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Resources.TypeConverterFromResXHandler.GetValue (System.ComponentModel.Design.ITypeResolutionService typeResolver) [0x0005a] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Resources.ResXDataNode.GetValue (System.ComponentModel.Design.ITypeResolutionService typeResolver) [0x00000] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Resources.ResXResourceReader.ParseDataNode (System.Boolean meta) [0x00117] in <c072c8b38e8f4268a3d5b018f57f4369>:0 
  at System.Resources.ResXResourceReader.LoadData () [0x0010c] in <c072c8b38e8f4268a3d5b018f57f4369>:0
Comment 1 eb1 2017-09-14 15:23:52 UTC
It seems this bug got introduced when fixing #395 (https://bugzilla.xamarin.com/show_bug.cgi?id=395)
Comment 2 eb1 2017-09-14 16:13:02 UTC
https://github.com/mono/mono/pull/5577 contains a suggested fix.
Comment 3 Ludovic Henry 2017-09-15 22:54:28 UTC
Fixed in master with https://github.com/mono/mono/pull/5577