The copy constructor of boost::compute::detail::lru_cache does not seem to work properly: the new map holds invalidated std::list iterators after its copying. I believe that the copy constructor should be deleted there at all (seems reasonable for this class), or iterators should be restored from the new list.