Bug 16413 - Xamarin studio crashes when creating a empty text file.
Summary: Xamarin studio crashes when creating a empty text file.
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 4.2.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 4.2.4 (from master)
Assignee: Bugzilla
URL:
: 17895 ()
Depends on:
Blocks:
 
Reported: 2013-11-23 05:15 UTC by Joakim Erlandsson
Modified: 2015-06-27 15:18 UTC (History)
4 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 Developer Community or GitHub 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:
VERIFIED FIXED

Description Joakim Erlandsson 2013-11-23 05:15:55 UTC
Hi, thanks for an awesome development environment!

... 

Symptom: Xamarin studio crashes when creating a empty text file. 

Steps to reproduce: 
 1. File -> New -> File...
 2. Create a Empty Text File.
 3. Give it a name.
 4. Press the new button and the crash occurs.

I tried searching for this issue but I could not find it.

I'm creating a text-file for bash-scripting and since I had an IDE that I like I thought why not use it. :) There might be better ways of doing this?
Comment 1 Joakim Erlandsson 2013-11-23 05:52:51 UTC
I figured that even if my purpose is "goofy", or unsupported the crash might still be interesting for you.
Comment 2 Mike Krüger 2013-11-23 13:31:45 UTC
Can you give me the exception text ?
Comment 3 Joakim Erlandsson 2013-11-23 14:41:27 UTC
Sure thing! 

It might be a clue that I did not include the text file in a project. I just opened the studio and created a text file. 

11/23/13 8:29:17.171 PM XamarinStudio[438]: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: cgImage != NULL'
*** Call stack at first throw:
(
	0   CoreFoundation                      0x91ec8e8b __raiseError + 219
	1   libobjc.A.dylib                     0x9604652e objc_exception_throw + 230
	2   CoreFoundation                      0x91e28698 +[NSException raise:format:arguments:] + 136
	3   Foundation                          0x998ed364 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
	4   AppKit                              0x94d51525 -[NSBitmapImageRep initWithCGImage:] + 145
	5   ???                                 0x0edf580c 0x0 + 249518092
	6   ???                                 0x095ebb94 0x0 + 157203348
	7   ???                                 0x095eb1b4 0x0 + 157200820
	8   ???                                 0x095e9fa0 0x0 + 157196192
	9   ???                                 0x095e9be3 0x0 + 157195235
	10  ???                                 0x095e9b70 0x0 + 157195120
	11  ???                                 0x095e9654 0x0 + 157193812
	12  ???                                 0x10711586 0x0 + 275846534
	13  ???                                 0x1070bbcc 0x0 + 275823564
	14  ???                                 0x1070b9ea 0x0 + 275823082
	15  ???                                 0x1070a533 0x0 + 275817779
	16  ???                                 0x1070a350 0x0 + 275817296
	17  ???                                 0x141198db 0x0 + 336697563
	18  libmonosgen-2.0.dylib               0x0100d86e mono_jit_runtime_invoke + 798
	19  libmonosgen-2.0.dylib               0x011c738e mono_runtime_invoke + 126
	20  libmonosgen-2.0.dylib               0x011ce38c mono_runtime_invoke_array + 1596
	21  libmonosgen-2.0.dylib               0x01134a76 ves_icall_InternalInvoke + 1286
	22  ???                                 0x04feb7e8 0x0 + 83802088
	23  ???                                 0x04feb468 0x0 + 83801192
	24  ???                                 0x04feb3b3 0x0 + 83801011
	25  ???                                 0x0f25dd7c 0x0 + 254139772
	26  ???                                 0x0f25db54 0x0 + 254139220
	27  ???                                 0x0f25db17 0x0 + 254139159
	28  ???                                 0x0f25dae8 0x0 + 254139112
	29  ???                                 0x0f25d9ac 0x0 + 254138796
	30  ???                                 0x0f25c714 0x0 + 254134036
	31  ???                                 0x091a15dc 0x0 + 152704476
	32  libgobject-2.0.0.dylib              0x07e26918 g_closure_invoke + 504
	33  libgobject-2.0.0.dylib              0x07e47b89 signal_emit_unlocked_R + 2345
	34  libgobject-2.0.0.dylib              0x07e46a3f g_signal_emit_valist + 4735
	35  libgobject-2.0.0.dylib              0x07e470f1 g_signal_emit + 65
	36  libgtk-quartz-2.0.0.dylib           0x071f0b19 gtk_tree_view_row_activated + 217
	37  libgtk-quartz-2.0.0.dylib           0x071d99c9 gtk_tree_view_button_press + 4345
	38  libgtk-quartz-2.0.0.dylib           0x0706813e _gtk_marshal_BOOLEAN__BOXED + 286
	39  libgobject-2.0.0.dylib              0x07e2719e g_type_class_meta_marshal + 142
	40  libgobject-2.0.0.dylib              0x07e26918 g_closure_invoke + 504
	41  libgobject-2.0.0.dylib              0x07e47a28 signal_emit_unlocked_R + 1992
	42  libgobject-2.0.0.dylib              0x07e46af1 g_signal_emit_valist + 4913
	43  libgobject-2.0.0.dylib              0x07e470f1 g_signal_emit + 65
	44  libgtk-quartz-2.0.0.dylib           0x0721b47d gtk_widget_event_internal + 749
	45  libgtk-quartz-2.0.0.dylib           0x0721ac6f gtk_widget_event + 319
	46  libgtk-quartz-2.0.0.dylib           0x07065a51 propagate_event_up + 97
	47  libgtk-quartz-2.0.0.dylib           0x07065e17 propagate_event + 535
	48  libgtk-quartz-2.0.0.dylib           0x07065f27 gtk_propagate_event + 247
	49  libgtk-quartz-2.0.0.dylib           0x07064019 gtk_main_do_event + 777
	50  libgdk-quartz-2.0.0.dylib           0x074d2d89 gdk_event_dispatch + 153
	51  libglib-2.0.0.dylib                 0x06df69b9 g_main_dispatch + 409
	52  libglib-2.0.0.dylib                 0x06df7780 g_main_context_dispatch + 48
	53  libglib-2.0.0.dylib                 0x06df7975 g_main_context_iterate + 485
	54  libglib-2.0.0.dylib                 0x06df7eaf g_main_loop_run + 527
	55  libgtk-quartz-2.0.0.dylib           0x06faa945 gtk_dialog_run + 597
	56  ???                                 0x15c86aa8 0x0 + 365456040
	57  ???                                 0x15c86a60 0x0 + 365455968
	58  ???                                 0x15c86960 0x0 + 365455712
	59  ???                                 0x15c85e30 0x0 + 365452848
	60  ???                                 0x15c85d38 0x0 + 365452600
	61  ???                                 0x153dc2b8 0x0 + 356369080
	62  ???                                 0x153dc264 0x0 + 356368996
	63  ???                                 0x153dc247 0x0 + 356368967
	64  ???                                 0x153dbf9c 0x0 + 356368284
	65  ???                                 0x153db960 0x0 + 356366688
	66  ???                                 0x153dafc4 0x0 + 356364228
	67  ???                                 0x153daf7c 0x0 + 356364156
	68  ???                                 0x148f382a 0x0 + 344930346
	69  ???                                 0x0edfe7c8 0x0 + 249554888
	70  libglib-2.0.0.dylib                 0x06df8af6 g_timeout_dispatch + 102
	71  libglib-2.0.0.dylib                 0x06df69b9 g_main_dispatch + 409
	72  libglib-2.0.0.dylib                 0x06df7780 g_main_context_dispatch + 48
	73  libglib-2.0.0.dylib                 0x06df7975 g_main_context_iterate + 485
	74  libglib-2.0.0.dylib                 0x06df7eaf g_main_loop_run + 527
	75  libgtk-quartz-2.0.0.dylib           0x07063600 gtk_main + 240
	76  ???                                 0x148f1258 0x0 + 344920664
	77  ???                                 0x148f0fbc 0x0 + 344919996
	78  ???                                 0x148f0f9c 0x0 + 344919964
	79  ???                                 0x036e04a0 0x0 + 57541792
	80  ???                                 0x006d913c 0x0 + 7180604
	81  ???                                 0x006d8ed4 0x0 + 7179988
	82  ???                                 0x006d8f9a 0x0 + 7180186
	83  libmonosgen-2.0.dylib               0x0100d86e mono_jit_runtime_invoke + 798
	84  libmonosgen-2.0.dylib               0x011c738e mono_runtime_invoke + 126
	85  libmonosgen-2.0.dylib               0x011cb944 mono_runtime_exec_main + 420
	86  libmonosgen-2.0.dylib               0x011cbcb5 mono_runtime_run_main + 725
	87  libmonosgen-2.0.dylib               0x01078da5 mono_jit_exec + 149
	88  libmonosgen-2.0.dylib               0x0107b2ff mono_main + 9551
	89  XamarinStudio                       0x00002dde main + 2398
	90  XamarinStudio                       0x00002475 start + 53
)
Comment 4 Mikayla Hutchinson [MSFT] 2013-11-23 15:26:27 UTC
What version of MacOS?

If I had to guess, I'd say the crash is here, when asking MacOS for up the icon for the file: https://github.com/mono/monodevelop/blob/master/main/src/addins/MacPlatform/MacPlatform.cs#L391
Comment 5 Joakim Erlandsson 2013-11-23 16:08:33 UTC
I am using OS X Version 10.8.5. Let me know if you can't replicate and what I can do to help out. With the bit map commotion going on you might be right. I have not yet looked into how to debug the mono environment but I'm eager to learn.
Comment 6 Joakim Erlandsson 2013-11-24 05:19:42 UTC
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/nsbitmapimagerep_class/reference/reference.html

I guess it's about time I upgrade to Mavericks. I will let you know if it occurs there also.

Thanks for getting me started on reading the Mono source.
Comment 7 Joakim Erlandsson 2013-11-24 11:08:46 UTC
This issue does not occur on OS X Mavericks.
Comment 8 Joakim Erlandsson 2013-11-24 13:40:17 UTC
This issue does not occur on OS X Mavericks (10.9)
Comment 9 Mike Krüger 2013-11-25 02:05:23 UTC
That's why I can't repro it maybe - closing this one.
Comment 10 Joakim Erlandsson 2013-11-25 03:24:05 UTC
I tried finding what versions of Mac os you support in the FAQ, but I could not find it. Maybe I'm missing something. If it's unsupported I fully agree. Further on this is a non issue for me. I reported it because I think the crash looks bad. I will look further into mono next weekend if I get some time over.
Comment 11 Mikayla Hutchinson [MSFT] 2013-11-25 15:59:31 UTC
We currently support 10.9, 10.8, 10.7.
Comment 12 Joakim Erlandsson 2013-11-26 04:01:31 UTC
With the upgrade I got all the way up to 10.9. Unfortunately I can't give you an exact version of when it stopped occuring.
Comment 13 Mikayla Hutchinson [MSFT] 2014-01-23 18:44:53 UTC
Hopefully fixed by https://github.com/mono/monodevelop/commit/353ca5a71b3394aeb428242bf0ef4fa4f0a3ab11
Comment 14 Mohit Kheterpal 2014-01-24 06:31:21 UTC
Checked with the steps mentioned in Description and its working fine. empty text file created successfully. Screencast: http://screencast.com/t/V01Oc258rEY6

Environment info:
Xamarin Studio
Version 4.2.3 (build 154)
Build Information
Release ID: 402030154
Git revision: 4dca4a28d7ecc2c4df8a4d58e74b8902d0283b53
Xamarin addins: cc120a6f639fa6649aa4d23a0f0e7c5701134047

Xam.Android 4.13.0-39 (mac master)

Xamarin.iOS
Version: 7.0.7.64 
Hash: 094bb4e
Comment 15 Mohit Kheterpal 2014-01-24 06:32:02 UTC
Checked on ML 10.8.5
Comment 16 Mikayla Hutchinson [MSFT] 2014-02-19 22:12:05 UTC
*** Bug 17895 has been marked as a duplicate of this bug. ***
Comment 17 Randy 2015-06-27 15:18:27 UTC
I still have issue with creating and adding empty text file to project.

After an empty text file (a changelog.txt) is created and added to the project, I can see the new file in the project file list, but the IDE hangs for ever; I have to kill it manually (Force Quit on dock bar).


=== Xamarin Studio ===

Version 5.9.3 (build 1)
Installation UUID: 3a108a28-b4a8-4ac3-ba31-2e556713c413
Runtime:
	Mono 4.0.1 ((detached/ed1d3ec)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010044

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.iOS ===

Not Installed

=== Xamarin.Android ===

Not Installed

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 509030001
Git revision: 5a524e1726ed103fdd4fe37e0356f2b35466ce9d
Build date: 2015-06-02 16:35:08-04
Xamarin addins: 51957cfbd06be911b212671ad05c2c6221ac90f9

=== Operating System ===

Mac OS X 10.10.3
Darwin mini.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64