fsprojects / zarchive-fsharpbinding

Archive of F# Language Bindings for Open Editors
Other
307 stars 106 forks source link

Drag'n'Drop of F# files crashes MonoDevelop #290

Closed artyomszasa closed 10 years ago

artyomszasa commented 10 years ago

It's fully reproductable.

My system: mono 3.2.7 (git) MonoDevelop 4.2.3 (git) FSharpBinding 3.2.22 (git)

Latest (git) GTK#, Gnome#, fsharp (3.0)..

Stack trace:

WARNING [2014-01-11 17:20:42Z]: GLib-GObject-Warning: Attempt to add property __gtksharp_61_Mono_TextEditor_TextArea::im-module after class was initialised
Stack trace: 
   at GLib.Object.gtksharp_register_property(IntPtr , IntPtr , IntPtr , IntPtr , UInt32 , IntPtr , Boolean , Boolean )
   at GLib.Object.AddProperties(GType gtype, System.Type t)
   at GLib.Object.RegisterGType(System.Type t)
   at GLib.Object.LookupGType(System.Type t)
   at GLib.Object.LookupGType()
   at GLib.Object.CreateNativeObject(System.String[] names, GLib.Value[] vals)
   at Gtk.Object.CreateNativeObject(System.String[] names, GLib.Value[] vals)
   at Gtk.Widget.CreateNativeObject(System.String[] names, GLib.Value[] vals)
   at Gtk.Container..ctor()
   at Mono.TextEditor.TextArea..ctor(Mono.TextEditor.TextDocument doc, ITextEditorOptions options, Mono.TextEditor.EditMode initialMode)
   at Mono.TextEditor.TextEditor..ctor(Mono.TextEditor.TextDocument doc, ITextEditorOptions options, Mono.TextEditor.EditMode initialMode)
   at Mono.TextEditor.TextEditor..ctor(Mono.TextEditor.TextDocument doc, ITextEditorOptions options)
   at Mono.TextEditor.TextEditor..ctor(Mono.TextEditor.TextDocument doc)
   at Mono.TextEditor.TextEditor..ctor()
   at MonoDevelop.SourceEditor.ExtensibleTextEditor..ctor(MonoDevelop.SourceEditor.SourceEditorView view)
   at MonoDevelop.SourceEditor.SourceEditorWidget..ctor(MonoDevelop.SourceEditor.SourceEditorView view)
   at MonoDevelop.SourceEditor.SourceEditorView..ctor()
   at MonoDevelop.SourceEditor.SourceEditorDisplayBinding.CreateContent(FilePath fileName, System.String mimeType, MonoDevelop.Projects.Project ownerProject)
   at MonoDevelop.Ide.Gui.LoadFileWrapper.Invoke(System.String fileName)
   at MonoDevelop.Ide.Gui.Workbench.RealOpenFile(IProgressMonitor monitor, MonoDevelop.Ide.Gui.FileOpenInformation openFileInfo)
   at MonoDevelop.Ide.Gui.Workbench.OpenDocument(MonoDevelop.Ide.Gui.FileOpenInformation info)
   at MonoDevelop.Ide.Gui.Workbench.OpenDocument(FilePath fileName, MonoDevelop.Projects.Project project, Int32 line, Int32 column, OpenDocumentOptions options, System.Text.Encoding encoding, IViewDisplayBinding binding)
   at MonoDevelop.Ide.Gui.Workbench.OpenDocument(FilePath fileName, MonoDevelop.Projects.Project project, OpenDocumentOptions options)
   at MonoDevelop.Ide.Gui.Workbench.OpenDocument(FilePath fileName, MonoDevelop.Projects.Project project, Boolean bringToFront)
   at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFileNodeCommandHandler.ActivateMultipleItems()
   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.ActivateCurrentItem()
   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.OnNodeActivated(System.Object sender, Gtk.RowActivatedArgs args)
   at System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod , System.Object , System.Object[] , System.Exception ByRef )
   at System.Reflection.MonoMethod.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(System.Object obj, System.Object[] parameters)
   at System.Delegate.DynamicInvokeImpl(System.Object[] args)
   at System.MulticastDelegate.DynamicInvokeImpl(System.Object[] args)
   at System.Delegate.DynamicInvoke(System.Object[] args)
   at GLib.Signal.ClosureInvokedCB(System.Object o, GLib.ClosureInvokedArgs args)
   at GLib.SignalClosure.Invoke(GLib.ClosureInvokedArgs args)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
   at Gtk.Widget.gtksharp_widget_base_button_press_event(IntPtr , IntPtr )
   at Gtk.Widget.OnButtonPressEvent(Gdk.EventButton evnt)
   at MonoDevelop.Components.ContextMenuTreeView.OnButtonPressEvent(Gdk.EventButton evnt)
   at Gtk.Widget.buttonpressevent_cb(IntPtr widget, IntPtr evnt)
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at MonoDevelop.Ide.IdeApp.Run()
   at MonoDevelop.Ide.IdeStartup.Run(MonoDevelop.Ide.MonoDevelopOptions options)
   at MonoDevelop.Ide.IdeStartup.Main(System.String[] args)
   at MonoDevelop.Startup.MonoDevelopMain.Main(System.String[] args)
**
Gtk:ERROR:/build/buildd/gtk+2.0-2.24.20/gtk/gtkselection.c:3174:gtk_selection_bytes_per_item: code should not be reached
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff>
  at Gtk.Application.Run () <0x0000b>
  at MonoDevelop.Ide.IdeApp.Run () <0x0000b>
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) <0x01d97>
  at MonoDevelop.Ide.IdeStartup.Main (string[]) <0x00177>
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) <0x00013>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

    monodevelop() [0x4f9eb8]
    /lib/x86_64-linux-gnu/libpthread.so.0(+0xfbb0) [0x7f4635156bb0]
    /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f4634b9ff77]
    /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f4634ba35e8]
    /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4efdd) [0x7f4630bd4fdd]
    /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_assertion_message+0x137) [0x7f4630bf23b7]
    /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x18cb15) [0x7f4630497b15]
    /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x18f788) [0x7f463049a788]
    /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x12d645) [0x7f4630438645]
    /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_closure_invoke+0x138) [0x7f462a328188]
    /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(+0x218db) [0x7f462a3398db]
    /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0xab9) [0x7f462a3414f9]
    /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x82) [0x7f462a341ae2]
    /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x23d5f4) [0x7f46305485f4]
    /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_main_do_event+0x4db) [0x7f46304373ab]
    /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x5927c) [0x7f46300b227c]
    /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x146) [0x7f4630bce3b6]
    /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x48708) [0x7f4630bce708]
    /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_loop_run+0x6a) [0x7f4630bceb0a]
    /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_main+0xa7) [0x7f4630436277]
    [0x41255b95]

I can also attach full gdb dump if needed.

7sharp9 commented 10 years ago

What were you drag and dropping?

artyomszasa commented 10 years ago

.fs files to change the build order.

Additionally just found out, that drag'n'drop reordering works (at least for few cases now) if all involved files are opened.

knocte commented 10 years ago

I also experience a native crash when drag'n'droping files to change the build order, but I'm not sure I get the same backtrace as you. BTW what platform are you on? I'm on Linux 64bits (Ubuntu 13.04). This is important to note because this might be actually a gtk+ bug. Also I think I've reproduced it as well with the C# binding, so this issue might not definitely belong here.

artyomszasa commented 10 years ago

Ubuntu 13.10 (x64) here.

knocte commented 10 years ago

Given that @7sharp9 seems surprised about this bug, I guess that it's not affecting Mac.

7sharp9 commented 10 years ago

I don't get it on osx with XS 4.3.0. Moving the fs nodes uses the same monodevelop internals, so seeing this in the C# binding seems to confirm it might be gtk related.

On 11 Jan 2014, at 17:34, "Andres G. Aragoneses" notifications@github.com wrote:

Given that @7sharp9 seems surprised about this bug, I guess that it's not affecting Mac.

— Reply to this email directly or view it on GitHub.

knocte commented 10 years ago

Actually I just tested with latest master with the C# binding and the bug is not there anymore. So maybe they added recently a workaround for it in the managed C# binding...

I say a 'workaround' instead of a fix, because this still smells gtk related. This is the trace I get in my case:

Gtk:ERROR:/build/buildd/gtk+2.0-2.24.17/gtk/gtkselection.c:3174:gtk_selection_bytes_per_item: code should not be reached
Stacktrace:
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x0000e, 0xffffffff>
  at Gtk.Application.Run () <IL 0x00000, 0x0001f>
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /home/knocte/Documents/Code/OpenSource/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:387
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) [0x007c0] in /home/knocte/Documents/Code/OpenSource/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:291
  at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00086] in /home/knocte/Documents/Code/OpenSource/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:575
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /home/knocte/Documents/Code/OpenSource/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:17
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>
knocte commented 10 years ago

I'll try to reproduce it in Ubuntu 13.10 or 14.04-beta.

7sharp9 commented 10 years ago

Is this an upstream problem then?

7sharp9 commented 10 years ago

Does this still occur anywhere?

knocte commented 10 years ago

I just tested this again with latest Ubuntu trusty and: a) Good news: doesn't crash anymore. b) Bad news: drag and drop files to be able to move them up or down doesn't work anymore.

7sharp9 commented 10 years ago

Its not something that would be fixed here unless unless the code that is used is causing some anomalous behaviour in linux: FSharpProjectFileNodeExtension

knocte commented 10 years ago

But why was it working 2 months ago and not now? Any changes in that area recently?

7sharp9 commented 10 years ago

There was a bug fix relating to node comparisons mid Jan, but nothing gtk related.

knocte commented 10 years ago

Could the node comparison affect the DragNDrop functionality? If yes can you point me to the exact commit so I can try with that commit reverted?

7sharp9 commented 10 years ago

Maybe, it works on Windows and Mac though: https://github.com/fsharp/fsharpbinding/commit/0687e3bf18cdf7aa612245b3f4ad0dd0b5a33ebe

ghost commented 10 years ago

I'm closing this issue now, since the original problem appears to have gone @knocte please open a new issue if you have a new consistent repro, thx