Bug 4651 - MonoDevelop crashed when editing code with syntax errors
Summary: MonoDevelop crashed when editing code with syntax errors
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: Trunk
Hardware: Macintosh Mac OS
: High blocker
Target Milestone: 3.0
Assignee: Mike Krüger
: 4710 ()
Depends on:
Reported: 2012-04-25 16:25 UTC by Chris Hardy [MSFT]
Modified: 2012-10-09 06:48 UTC (History)
6 users (show)

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

Log file from MD crash (48.05 KB, application/octet-stream)
2012-05-07 06:52 UTC, Nic Wise
second crash log (40.38 KB, text/plain)
2012-05-07 07:02 UTC, Nic Wise
crash 3 (40.14 KB, text/plain)
2012-05-07 07:06 UTC, Nic Wise

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:

Description Chris Hardy [MSFT] 2012-04-25 16:25:41 UTC
This is the trace that I got with it: https://gist.github.com/c7c33a74180c78277b1a

Using MonoDevelop trunk - version info details here:

The error was similar to the following behaviour: http://screencast.com/t/Rvdy3k7D (Losing mouse focus) except this one crashed MonoDevelop
Comment 1 Mike Krüger 2012-04-26 05:52:04 UTC
nothing to do with syntax errors -> native crash
Comment 2 Mike Krüger 2012-04-26 06:23:59 UTC
*** Bug 4497 has been marked as a duplicate of this bug. ***
Comment 3 Alan McGovern 2012-04-26 06:31:10 UTC

*** This bug has been marked as a duplicate of bug 4353 ***
Comment 4 Chris Hardy [MSFT] 2012-04-29 09:31:46 UTC
I had this crash happen again with the following stack trace - https://gist.github.com/173569a3b79609c6f15e it was preceded by the mouse events not being picked up again, the beachball and then crash.

Not 100% sure it's the same issue that's in 4353 so re-opening but feel free to close if it is the same.
Comment 5 Mike Krüger 2012-04-29 11:57:25 UTC
I think it's a different one 

#5  0x04518107 in gdk_window_is_toplevel ()
#6  0x04526f4c in convert_native_coords_to_toplevel ()
#7  0x0452927d in _gdk_windowing_got_event ()
#8  0x04534056 in gdk_events_queue ()

I think it's either in convert_native_coords_to_toplevel () or gdk_window_is_toplevel ().
Comment 6 Kristian Rietveld (inactive) 2012-04-29 18:46:23 UTC
The trace in comment 4 shows exactly the same glib warnings as for bug 2158.  Isn't it likely this is also caused by bug 2158, putting the program in a bad state on which it crashes later on?
Comment 7 Mikayla Hutchinson [MSFT] 2012-04-29 19:33:31 UTC
*** Bug 4710 has been marked as a duplicate of this bug. ***
Comment 8 Mikayla Hutchinson [MSFT] 2012-04-29 20:08:55 UTC
Seems likely. If we don't get any more like this after fixing 2158, I'll close all the bugs with similar frames in the trace.
Comment 9 Miguel de Icaza [MSFT] 2012-05-01 10:16:59 UTC
Raising this bug to blocker, since it did not happen with MonoDevelop 2.8.x, but happens frequently with 2.9.5, reported both internally by Eric and by Nic Wise (#4710)
Comment 10 Nic Wise 2012-05-01 12:05:40 UTC
What do you guys need from me to help with this? I'm back on the alpha channel, so I can fire MD up and ... use it for a bit... is there anyhing I can do - command line options et al - to get more out?
Comment 11 Kristian Rietveld (inactive) 2012-05-05 06:42:06 UTC
Now that we have likely found the cause of bugs 2158/4353, we can say that this bug is slightly different.  The crash occurs because event->any.window is NULL.  In 2158/4353 we did have an event window, but we got out of bounds coordinates.
Comment 12 Kristian Rietveld (inactive) 2012-05-05 06:44:24 UTC
Also, the stack traces in the opening comment and comment 4 are different.  The bug in the trace in the opening comment should have been fixed, the bug in comment 4 not.
Comment 13 Kristian Rietveld (inactive) 2012-05-05 07:51:44 UTC
> The crash occurs because event->any.window is NULL.

On a second look this seems wrong, because _gdk_windowing_got_event() explicitly guards for a NULL event_window...
Comment 14 Kristian Rietveld (inactive) 2012-05-05 08:09:42 UTC
If I have to believe the instruction address where the crash occurs, the crash happens when reading window->parent->window_type into a register.  The check window->parent == NULL fails, so getting a sigsegv at this point would mean the window->parent pointer is busted.
Comment 15 Nic Wise 2012-05-07 06:52:14 UTC
Do you need more logs / dumps? I'm using MD all day today, so I can keep adding them here. If they are of no use, tell me, and I'll stop :)

First one was just a crash - the mouse didn't lock up first, it just beachballed then died. I DID have syntax errors beforehand.
Comment 16 Nic Wise 2012-05-07 06:52:49 UTC
Created attachment 1815 [details]
Log file from MD crash
Comment 17 Nic Wise 2012-05-07 07:01:45 UTC
Second crash, the mouse went out for a bit before hand - maybe 30 seconds? Also the code completion stopped working. Eg, I had this:

for(int i = 0; i

and it wanted to complete i as "if"

See "second crash log" attachment.
Comment 18 Nic Wise 2012-05-07 07:02:08 UTC
Created attachment 1816 [details]
second crash log
Comment 19 Nic Wise 2012-05-07 07:05:42 UTC
And again. I'll leave it at that unless you need more. ("crash 3")
Comment 20 Nic Wise 2012-05-07 07:06:01 UTC
Created attachment 1817 [details]
crash 3
Comment 21 Kristian Rietveld (inactive) 2012-05-13 12:34:59 UTC
What would be very useful is a "bt full" backtrace from gdb.
Comment 22 Nic Wise 2012-05-13 16:51:51 UTC
Sorry, I upgraded to 3.0 this morning, and I've not had the problem all day (as opposed to every 20 mins or so)... so most likely, problem solved...
Comment 23 Mike Krüger 2012-10-09 06:48:23 UTC
ok closing