id summary reporter owner description type status milestone component version severity resolution keywords cc 286 intrusive_ptr may cause dungling ptr access nobody Peter Dimov "{{{ I think intrusive_ptr may cause dungling ptr access in multithreaded environment. Currently, it's constructor is: intrusive_ptr(T * p, bool add_ref = true) : p_(p) /* the object may be deleted by other thread because this thread does not increment reference counter yet. */ { if(p_ != 0 && add_ref) intrusive_ptr_add_ref(p_); /* this may occur dungling ptr operation. */ } We can avoid this problem by ""addref-before-use"" policy. intrusive_ptr(T * p, bool add_ref = true) { if(p != 0 && add_ref) intrusive_ptr_add_ref(p_); /* other thread never delete the object */ p_ = p; } }}}" Bugs closed smart_ptr None Invalid