Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test_ChildVisitor fails with llvm 3.2 #15

Closed
chetant opened this issue Feb 23, 2013 · 3 comments
Closed

Test_ChildVisitor fails with llvm 3.2 #15

chetant opened this issue Feb 23, 2013 · 3 comments
Assignees

Comments

@chetant
Copy link
Owner

chetant commented Feb 23, 2013

Some name strings in the test have the first four chars replaced with '\0' (null) chars.
Here's the diff from the C and Haskell version outputs.

58c58
< Name:mode_t, Kind:TypedefDecl

---
> Name:_t, Kind:TypedefDecl
143c143
< Name:_G_uint16_t, Kind:TypedefDecl

---
> Name:int16_t, Kind:TypedefDecl
344c344
< Name:clang_equalCursors(CXCursor, CXCursor), Kind:FunctionDecl

---
> Name:g_equalCursors(CXCursor, CXCursor), Kind:FunctionDecl
420c420
< Name:clang_getSpecializedCursorTemplate(CXCursor), Kind:FunctionDecl

---
> Name:g_getSpecializedCursorTemplate(CXCursor), Kind:FunctionDecl
455c455
< Name:clang_defaultCodeCompleteOptions(), Kind:FunctionDecl

---
> Name:g_defaultCodeCompleteOptions, Kind:FunctionDecl
@sethfowler
Copy link
Collaborator

I don't know enough to fix this, but consider me interested in a fix. I see segfaults and other strange behavior on the LLVM 3.2 branch. I suspect they're caused by the same issue described here.

@sethfowler
Copy link
Collaborator

Now I do know enough to fix this, and I fixed it. =) See issue #18.

@chetant
Copy link
Owner Author

chetant commented Mar 21, 2013

Thanks for the changes, merged!
I see the problem, the ForeignPtr instance was gc'd before we were done with the Ptr we got out of it(unsafely), triggering the finalizer.
There are other places where I've used the same method (all the places in FFI.gc where I've used "fptr (ptr c)", I'm extracting the pointer.
I'm going to think about how to get this cleaned up..

@chetant chetant closed this as completed Mar 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants