[cfe-dev] clang via JNI + libclang-c

Anton Smirnov dev at antonsmirnov.name
Fri Oct 11 04:58:19 PDT 2013


Well, complicated things can work in unexpected way but sometimes it's the
developer who just does not know
how to make it working in correct way ;)

Are there any obvious reasons for it for not working (f.e. thread-safe
issues, any limitations or smth else)?

Anyway I will search for JNI problems definitely.
BTW. It's working on my mac without any problems, but i'm going to make it
working on Android.

Thanks for the help, Renato!


2013/10/11 Renato Golin <renato.golin at linaro.org>

> On 11 October 2013 12:20, Anton Smirnov <dev at antonsmirnov.name> wrote:
>
>> My idea is not CXInstance pointer address is corrupted (it's exactly the
>> same), but memory for this address.
>>
>
> This is also possible, JNI is *also* famous for heap corruption.
>
>
> I can provide code output where all the clang invocations are done with
>> one single native invocation and it works (tokens are found).
>>
>
> 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.
>
> Something similar to the problem I had, with a similar fix:
>
>
> http://stackoverflow.com/questions/5305079/how-to-debug-jni-heap-corruption-problems
>
> cheers,
> --renato
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131011/f2385d6a/attachment.html>


More information about the cfe-dev mailing list