Segfault in STL vector destructor on Linux

I have the following C++ code in a in Blueprint Function Library:

void UTestVector::DoTestVector() {
    std::vector<int> intz = std::vector<int>();
    intz.resize(2);
    intz.clear();
    return;
}

When I call this function, it crashes with a stack trace that points to the closing brace of the function and subsequently to the destructor of vector:

Thread 1 "UE4Editor" received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x21) at malloc.c:2949
2949	malloc.c: No such file or directory.
(gdb) 
(gdb) bt
#0  __GI___libc_free (mem=0x21) at malloc.c:2949
#1  0x00007ffff6f88666 in FMallocThreadSafeProxy::Free (this=0x6b94b0, Ptr=0xb62d9d0) at Runtime/Core/Public/HAL/MallocThreadSafeProxy.h:62
#2  0x00007ffefa087576 in operator delete (Ptr=0x21) at /home/smurthas/TestVectorProj/Source/TestVectorProj/TestVectorProj.cpp:5
#3  0x00007ffefa080d09 in __gnu_cxx::new_allocator<int>::deallocate (this=<optimized out>, __p=<optimized out>)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/ext/new_allocator.h:110
#4  std::allocator_traits<std::allocator<int> >::deallocate (__a=..., __p=<optimized out>, __n=<optimized out>)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/alloc_traits.h:517
#5  std::_Vector_base<int, std::allocator<int> >::_M_deallocate (this=<optimized out>, __p=<optimized out>, __n=<optimized out>)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/stl_vector.h:178
#6  std::_Vector_base<int, std::allocator<int> >::~_Vector_base (this=<optimized out>)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/stl_vector.h:160
#7  std::vector<int, std::allocator<int> >::~vector (this=0xb0f6f90) at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/stl_vector.h:425
#8  UTestVector::DoTestVector () at /home/smurthas/TestVectorProj/Source/TestVectorProj/TestVector.cpp:29

I’m on Ubuntu 16.04 and built UE with clang 3.8. UE was originally using jemalloc, so I tried it with Ansi malloc (via the -ansimalloc CLI flag), but the issue is still present.

I’ve heard “don’t use STL in UE…” however I am trying to integrate with an external library that uses the STL (the above example is simply an isolated example of vector causing this issue, it’s not my actual code), so NOT using STL would require rewriting the external library from the ground up, so I’d strongly prefer to use vector if possible.

Any ideas as to what might be happening here?

(bump) Any news on this? I am having a similar issue.