[clang-c] using clang_getNullCursor from Java causes munmap_chunk(): invalid pointer on exit
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Hi,
I'm making Java bindings for clang-c and have ran into an issue wherein using the `clang_getNullCursor` function will cause a `munmap_chunk(): invalid pointer` error on exit.
e.g:
```java
public class Test
{
public static void main(String[] args)
{
Index_h index = Index_h.INSTANCE;
CXCursor cursor = index.clang_getNullCursor();
NativeEnum32 kindField = cursor.getField(0);
System.out.println(kindField.get());
System.out.println(index.clang_isReference(CXCursorKind.CXCursor_ObjCSuperClassRef));
}
}
```
prints
```
CXCursor_FirstInvalid
1
munmap_chunk(): invalid pointer
```
If I comment out the clang-c `clang_getNullCursor` function call and related code, leaving only clang_isReference, this does not happen.
Is this some kind of bad interaction between clang-c and the JVM?
Clang Version is 21.1.8
Contributor guide
Assessment
This issue has not been assessed yet.