Issue 184046
Summary [clang-c] using clang_getNullCursor clang-c from Java causes munmap_chunk(): invalid pointer on exit
Labels new issue
Assignees
Reporter BlueGoliath
    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<CXCursorKind> 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
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to