# HG changeset patch # User Yasumasa Suenaga # Date 1486611087 -32400 # Node ID ef928edf1d208d6580be81d8ee03191c922f41ba # Parent c5c05ec81fea67a761eacb0a54715c883013cf93 Bug 3322: TClassContainer instance might be broken in multithreaded access Reviewed-by: SinTak https://github.com/HeapStats/heapstats/pull/84 diff -r c5c05ec81fea -r ef928edf1d20 agent/ChangeLog --- a/agent/ChangeLog Sun Jan 29 21:49:50 2017 +0900 +++ b/agent/ChangeLog Thu Feb 09 12:31:27 2017 +0900 @@ -1,3 +1,7 @@ +2017-02-09 Yasumasa Suenaga + + * Bug 3322: TClassContainer instance might be broken in multithreaded access + 2017-01-24 KUBOTA Yuji * Bug 3296: Reference counter should manage TObjectData instance diff -r c5c05ec81fea -r ef928edf1d20 agent/src/classContainer.hpp --- a/agent/src/classContainer.hpp Sun Jan 29 21:49:50 2017 +0900 +++ b/agent/src/classContainer.hpp Thu Feb 09 12:31:27 2017 +0900 @@ -1,7 +1,7 @@ /*! * \file classContainer.hpp * \brief This file is used to add up using size every class. - * Copyright (C) 2011-2015 Nippon Telegraph and Telephone Corporation + * Copyright (C) 2011-2017 Nippon Telegraph and Telephone Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -147,16 +147,6 @@ } /*! - * \brief Search class from container without container lock. - * \param klassOop [in] Target class oop. - * \return Class data of target class. - */ - inline TObjectData *findClassWithoutLock(void *klassOop) { - TClassMap::iterator it = classMap->find(klassOop); - return (it != classMap->end()) ? it->second : NULL; - } - - /*! * \brief Update class oop. * \param oldKlassOop [in] Target old class oop. * \param newKlassOop [in] Target new class oop. diff -r c5c05ec81fea -r ef928edf1d20 agent/src/snapShotMain.cpp --- a/agent/src/snapShotMain.cpp Sun Jan 29 21:49:50 2017 +0900 +++ b/agent/src/snapShotMain.cpp Thu Feb 09 12:31:27 2017 +0900 @@ -359,7 +359,7 @@ TObjectData *clsData = NULL; /* Search child class at local class container. */ - clsData = aClsContainer->findClassWithoutLock(klassOop); + clsData = aClsContainer->findClass(klassOop); if (unlikely(clsData == NULL)) { /* Search child class at root class container. */