Cxx.jl
Cxx.jl copied to clipboard
GC/destruction segfault
Something is segfaulting when the gc runs and things are destroyed in Cxx.destruct
. I'm not sure what, and it may be my fault, so I reduced to a small test file and put that in a gist.
I may be doing something wrong with the C++ code, but I made a similar example in C++ and it did not segfault. I am probably very bad at C++ though (AWSCxx is the most C++ I've ever written).
https://gist.github.com/iamed2/e32162dda0ddb6a0ac3746acaabbe68f
Sometimes C++ code has assumptions on destruction time that are not obeyed by julia code. I'll take a look at your code later and see if that's what's happening here.
Thank you very much!
@keno Had a chance to look at this yet?
A discovery: if I change this line:
cpp_key = icxx"$iterator->first;"
to this line:
cpp_key = icxx"""auto key_item = $iterator->first;
key_item;"""
the problem goes away.