<div dir="ltr">Well, complicated things can work in unexpected way but sometimes it's the developer who just does not know<div>how to make it working in correct way ;)</div><div><br></div><div>Are there any obvious reasons for it for not working (f.e. thread-safe issues, any limitations or smth else)?</div>
<div><br></div><div>Anyway I will search for JNI problems definitely.</div><div>BTW. It's working on my mac without any problems, but i'm going to make it working on Android.</div><div><br></div><div>Thanks for the help, Renato!</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/11 Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im">On 11 October 2013 12:20, Anton Smirnov <span dir="ltr"><<a href="mailto:dev@antonsmirnov.name" target="_blank">dev@antonsmirnov.name</a>></span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">My idea is not CXInstance pointer address is corrupted (it's exactly the same), but memory for this address.</div>

</div></blockquote><div><br></div></div><div>This is also possible, JNI is *also* famous for heap corruption.</div><div class="im"><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_extra">I can provide code output where all the clang invocations are done with one single native invocation and it works (tokens are found).</div></div></blockquote><div><br></div></div><div>
If it works from C and works on pure-C from Java, than the only answer is that JNI is corrupting the memory. It's either that, or your C compiler has a serious bug. To make sure it's not the compiler, try different versions. Search Google for "jni heap corruption" or "jni stack corruption" and you'll see what I mean.</div>

<div><br></div><div>Something similar to the problem I had, with a similar fix:</div><div><br></div><div><a href="http://stackoverflow.com/questions/5305079/how-to-debug-jni-heap-corruption-problems" target="_blank">http://stackoverflow.com/questions/5305079/how-to-debug-jni-heap-corruption-problems</a><br>

</div><div><br></div><div>cheers,</div><div>--renato</div><div> </div></div><br></div></div>
</blockquote></div><br></div>