mono / xwt

A cross-platform UI toolkit for creating desktop applications with .NET and Mono
MIT License
1.37k stars 239 forks source link

CanvasBackend.CustomCanvas ctor stack imbalance #398

Open amerkoleci opened 9 years ago

amerkoleci commented 9 years ago

I'm using Gtk3 backend but I have issue while running and using custom canvas controls, here is the execption:

Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 'D:\Engine\Alimer\Bin\Sandbox\Sandbox.vshost.exe'.

Additional information: A call to PInvoke function 'gtk-sharp!Gtk.Container::gtksharp_container_override_add' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
sevoku commented 9 years ago

Could you post some sample code?

Therzok commented 9 years ago

@sevoku This seems to be a bug in GtkSharp with wrong native signatures.

@amerkoleci 32bit or 64bit build?

amerkoleci commented 9 years ago

64bit, i can disable that exception in visual studio and it works, but wanted to keep trace about issue

sevoku commented 9 years ago

Yes, it looks like a Gtk bug. Where can I get 64bit Gtk3? Isn't the default installer 32bit only?

Therzok commented 9 years ago

This is another one of those C-long imbalances probably. Or the definition changed from Gtk2 to Gtk3 and someone didn't notice.

In any case, this should be upstreamed to https://github.com/mono/gtk-sharp/

sevoku commented 9 years ago

Thats why I asked for some sample code to narrow it down. Seems to occur, when a child is being added. Cause if you report an issue to gtk-sharp, they will ask for more information than just that this error occurred with Xwt, I think.

sevoku commented 9 years ago

I've played around with the configurations and at least on Linux everything seems to work (with target x64). I assumed you are running Windows because of the path in the message... On Windows I get a BadImageFormatException with x64.

amerkoleci commented 9 years ago

Yes, I'm using windows, you can reproduce same issue by using gtk3 sharp, create any widget which subclass from Gtk.Container (IE: Gtk.EventBox).