[Mono-dev] Embedded mono - cross compile on cygwin and linux

Matthias D. matthi.d at googlemail.com
Mon Jun 4 11:42:36 UTC 2012


Hello,

after some further digging I'm quite sure this SIGSEGV and SIGILL happens
on a function pointer created by mono_method_get_unmanaged_thunk.
This method looks really really scarry to me
(mono_marshal_get_thunk_invoke_wrapper)!

I did also tried to repruduce this on a smaller codeset, but even my
current code works on some circumstances. (It's occures only when I change
some settings that I do not understand how they relate to this, they only
cause the code to be called more often).

Added some code, maybe I made a simple mistake on marshalling or something
simple like that (on the struct field types).
Here you can see exaclty what I'm doing.
https://docs.google.com/document/d/1JDUrHGyYIYKdTcwLDIsdIeW17I5OA0AOs-hG_sWThSQ/edit
(Note: I do not try to engage you to try to reproduce this error [Its
pretty time consuming], I wrote these documents for my own reference, if I
ever try to embed mono in another app. However i figured, if somebody want
to look into this why not give him all information what i have done)
These documents also point out how you can statically link to libmono-2.0.a
on windows (which is also not supported for some reason).
The documents may very well be incomplete, just leave a comment there if
you want.

When somebody has any tipps I'd appreciate to hear them (What the cause
could be, how to debug this properly...or anything really), if not I will
hopefully figure it out sometimes....
And send the required patches back here.

Note: I did also add the patches which should be more "git" like than the
diffs I did add before (sorry for that, I'm just getting into this git
thing).

have a nice week,
Matthias




On Mon, Jun 4, 2012 at 10:42 AM, Matthias D. <matthi.d at googlemail.com>wrote:

> Hello,
>
> I did setup my system like this (can anyone tell me why this linked email
> was not sent to the mailing list?):
>
> https://docs.google.com/document/d/1rtkBYdPlRvnWQsFHetIAQqTNNzPu8_iP8maoQUl3zRE/edit
>
>
> Some additions to that mail (that was somehow not send).
> I know this scenario is currently unsupported, but is there anything I can
> do to prevent breaking changes to that scenario as I noticed these changes
> will not work on master!
> On master branch mono it will not make with the erorr:
>
> Like I said: I managed to get it working with 2.11.1 do it shouldn't be
> difficult to get it working on master, should it?
> Or will you continue to let this scenario be unsupported? (Read the above
> link)
>
> I will continue to work some time on this scenario (the above mono
> statically embedded in a native app on cygwin -> mingw cross compile).
> Currenty I'm trying to debug a SIGSEGV and a SIGILL most likely caused by
> the embedded mono.
> What I'm tried to do is compile mono with the "-g" flag but I still
> doesn't get a propper stack stack trace (bt in gdb).
> Any hints how I could track this one down?
>
>
> Thanks for your time reading this,
> Matthias
>
> PS: I hope you can also answer the questions in the linked Email (that was
> not sent).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/d2de8af2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MonoLoader.cpp
Type: text/x-c++src
Size: 6100 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/d2de8af2/attachment-0001.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MonoLoader.h
Type: text/x-chdr
Size: 3391 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/d2de8af2/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BotLoader.cs
Type: application/octet-stream
Size: 16563 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/d2de8af2/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-to-make-mono-cross-compile-with-master-branch.patch
Type: application/octet-stream
Size: 841 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/d2de8af2/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Fix-for-typo-on-CPPFLAGS.patch
Type: application/octet-stream
Size: 671 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/d2de8af2/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fixes-to-make-mono-cross-compile-on-linux-cygwin-to-.patch
Type: application/octet-stream
Size: 1503 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/d2de8af2/attachment-0007.obj>


More information about the Mono-devel-list mailing list