Re: JVM interactions
David Curylo <[email protected]> Wed, 6 Sep 2017 15:54:30 -0400
| Newsgroups | gmane.comp.gnome.mono.general |
|---|---|
| Message-ID | <[email protected]> |
--===============2830334585900053973== Content-Type: multipart/alternative; boundary="Apple-Mail=_B9BE1DF5-A952-4DD4-81BA-E7CA0569F98E" --Apple-Mail=_B9BE1DF5-A952-4DD4-81BA-E7CA0569F98E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Julian This project is incredibly outdated, but it is a starting point, so = better than nothing: https://github.com/olympum/caffeine = <https://github.com/olympum/caffeine> -Dave > On Sep 6, 2017, at 2:55 PM, Julian Dolby <[email protected]> wrote: >=20 > I have been trying to use C# code together with Java code, to provide = program analysis of .NET code as part of WALA = (https://github.com/wala/WALA). Given the seeming end of work on IKVM, = I have been exploring using a small amount of C++ code and JNI to bridge = the two systems. I have tried two options: > =20 > 1) a C++ program that create a Mono VM and a JVM, loading the needed = code into both and then calls functions in the them. The Java code = contains 'native' methods that call back into C++ and from there to = Mono. > =20 > 2) a Java program that calls C++ using JNI, which creates a Mono VM = and calls code in it, passing results (integers and strings) back to = Java. > =20 > In both cases, I get code that works fine up to a point, and then = crashes with what appears to be a segmentation fault in the Mono memory = allocator. Depending on what GC I choose, I get slightly different = errors. > =20 > Does anyone have a recommended recipe for doing what I need? > =20 > Thanks, > Julian > =20 >=20 > _______________________________________________ > Mono-list maillist - [email protected] > http://lists.dot.net/mailman/listinfo/mono-list --Apple-Mail=_B9BE1DF5-A952-4DD4-81BA-E7CA0569F98E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D"">Julian<div class=3D""><br class=3D""></div><div class=3D"">This= project is incredibly outdated, but it is a starting point, so better = than nothing:</div><div class=3D""><br class=3D""></div><div class=3D""><a= href=3D"https://github.com/olympum/caffeine" = class=3D"">https://github.com/olympum/caffeine</a></div><div = class=3D""><br class=3D""></div><div class=3D"">-Dave</div><div = class=3D""><br class=3D""><div><blockquote type=3D"cite" class=3D""><div = class=3D"">On Sep 6, 2017, at 2:55 PM, Julian Dolby <<a = href=3D"mailto:[email protected]" class=3D"">[email protected]</a>> = wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div = class=3D"socmaildefaultfont" dir=3D"ltr" style=3D"font-family:Arial, = Helvetica, sans-serif;font-size:10.5pt"><div dir=3D"ltr" = class=3D""> I have been trying to use C# code together with Java = code, to provide program analysis of .NET code as part of WALA (<a = href=3D"https://github.com/wala/WALA" = class=3D"">https://github.com/wala/WALA</a>). Given the seeming = end of work on IKVM, I have been exploring using a small amount of C++ = code and JNI to bridge the two systems. I have tried two = options:</div> <div dir=3D"ltr" class=3D""> </div> <div dir=3D"ltr" class=3D"">1) a C++ program that create a Mono VM and a = JVM, loading the needed code into both and then calls functions in = the them. The Java code contains 'native' methods that call back = into C++ and from there to Mono.</div> <div dir=3D"ltr" class=3D""> </div> <div dir=3D"ltr" class=3D"">2) a Java program that calls C++ using JNI, = which creates a Mono VM and calls code in it, passing results (integers = and strings) back to Java.</div> <div dir=3D"ltr" class=3D""> </div> <div dir=3D"ltr" class=3D""> In both cases, I get code that works = fine up to a point, and then crashes with what appears to be a = segmentation fault in the Mono memory allocator. Depending on what = GC I choose, I get slightly different errors.</div> <div dir=3D"ltr" class=3D""> </div> <div dir=3D"ltr" class=3D""> Does anyone have a recommended recipe = for doing what I need?</div> <div dir=3D"ltr" class=3D""> </div> <div dir=3D"ltr" class=3D""> Thanks,</div> <div dir=3D"ltr" class=3D""> = Julian</div> <div dir=3D"ltr" class=3D""> </div></div><br class=3D""> _______________________________________________<br class=3D"">Mono-list = maillist - <a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a><br class=3D""><a = href=3D"http://lists.dot.net/mailman/listinfo/mono-list" = class=3D"">http://lists.dot.net/mailman/listinfo/mono-list</a><br = class=3D""></div></blockquote></div><br class=3D""></div></body></html>= --Apple-Mail=_B9BE1DF5-A952-4DD4-81BA-E7CA0569F98E-- --===============2830334585900053973== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTW9uby1saXN0 IG1haWxsaXN0ICAtICBNb25vLWxpc3RAbGlzdHMuZG90Lm5ldApodHRwOi8vbGlzdHMuZG90Lm5l dC9tYWlsbWFuL2xpc3RpbmZvL21vbm8tbGlzdAo= --===============2830334585900053973==--