Discussion:
[chromium-discuss] There is always a crash triggered by CHECK_EQ in ProfileDestroyer::~ProfileDestroyer.
Liu Xiao
2018-07-30 03:15:21 UTC
Permalink
There is always a crash triggered by CHECK_EQ in
ProfileDestroyer::~ProfileDestroyer when our team run our autotest program
for a long time.



However, as normally used chrome to browse, we find
ProfileDestroyer::~ProfileDestroyer can be not called, and not crash
triggered by it.



I want to kown what is the scene for this crash.



I have got some clues from the code and comment, but I don't kown the
exactly reason.



Could you help me?



https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?q=ProfileDestroyer::~ProfileDestroyer&sq=package:chromium&g=0&l=154



*ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=25&ct=xref_jump_to_def&gsn=ProfileDestroyer>::~ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=145&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523KHaSwwnEsZTjJZieX4vTiHbG0QsY6HfgrVKLXYEai2s%25253D&gsn=~ProfileDestroyer&ct=xref_usages>*() {

// Check again, in case other render hosts were added while we were

// waiting for the previous ones to go away...

if (profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>)

DestroyProfileWhenAppropriate <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=33&ct=xref_jump_to_def&gsn=DestroyProfileWhenAppropriate>(profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>);



#ifdef NDEBUG

// Don't wait for pending registrations, if any, these hosts are buggy.

// Note: this can happen, but if so, it's better to crash here than wait

// for the host to dereference a deleted Profile. http://crbug.com/248625 <https://www.google.com/url?q=http://crbug.com/248625>

CHECK_EQ(0U, num_hosts_) << "Some render process hosts were not "

<< "destroyed early enough!";

#endif // NDEBUG

DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> != NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>);

DestroyerSet <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=32&ct=xref_jump_to_def&gsn=DestroyerSet>::iterator <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=427&ct=xref_jump_to_def&gsn=iterator> iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523fptDPL6Qj913xgEy8W6MCqZKOS%25252Fw3ZhiZPO8j1lFDr0%25253D&gsn=iter&ct=xref_usages> = pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->find <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=650&ct=xref_jump_to_def&gsn=find>(this);

DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter> != <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/__tree?l=944&ct=xref_jump_to_def&gsn=!%3D> pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->end <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=552&ct=xref_jump_to_def&gsn=end>());

pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->erase <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=627&ct=xref_jump_to_def&gsn=erase>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter>);

if (pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->empty <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=579&ct=xref_jump_to_def&gsn=empty>()) {

delete pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>;

pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> = NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>;

}

}
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Wez
2018-07-30 15:52:02 UTC
Permalink
Hi Liu,

That CHECK indicates that the Profile is being destroyed before all the
things that rely upon it are destroyed.

There are two main causes of this:
1. Something is holding objects live which are still using the profile
(e.g. a leaked WebContents).
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.

Are you autotesting a custom Chromium-based build? If so then you can add
further logging to get more information on what objects are still around at
that point.

HTH,

Wez
Post by Liu Xiao
There is always a crash triggered by CHECK_EQ in
ProfileDestroyer::~ProfileDestroyer when our team run our autotest program
for a long time.
However, as normally used chrome to browse, we find
ProfileDestroyer::~ProfileDestroyer can be not called, and not crash
triggered by it.
I want to kown what is the scene for this crash.
I have got some clues from the code and comment, but I don't kown the
exactly reason.
Could you help me?
https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?q=ProfileDestroyer::~ProfileDestroyer&sq=package:chromium&g=0&l=154
*ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=25&ct=xref_jump_to_def&gsn=ProfileDestroyer>::~ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=145&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523KHaSwwnEsZTjJZieX4vTiHbG0QsY6HfgrVKLXYEai2s%25253D&gsn=~ProfileDestroyer&ct=xref_usages>*() {
// Check again, in case other render hosts were added while we were
// waiting for the previous ones to go away...
if (profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>)
DestroyProfileWhenAppropriate <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=33&ct=xref_jump_to_def&gsn=DestroyProfileWhenAppropriate>(profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>);
#ifdef NDEBUG
// Don't wait for pending registrations, if any, these hosts are buggy.
// Note: this can happen, but if so, it's better to crash here than wait
// for the host to dereference a deleted Profile. http://crbug.com/248625 <https://www.google.com/url?q=http://crbug.com/248625>
CHECK_EQ(0U, num_hosts_) << "Some render process hosts were not "
<< "destroyed early enough!";
#endif // NDEBUG
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> != NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>);
DestroyerSet <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=32&ct=xref_jump_to_def&gsn=DestroyerSet>::iterator <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=427&ct=xref_jump_to_def&gsn=iterator> iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523fptDPL6Qj913xgEy8W6MCqZKOS%25252Fw3ZhiZPO8j1lFDr0%25253D&gsn=iter&ct=xref_usages> = pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->find <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=650&ct=xref_jump_to_def&gsn=find>(this);
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter> != <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/__tree?l=944&ct=xref_jump_to_def&gsn=!%3D> pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->end <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=552&ct=xref_jump_to_def&gsn=end>());
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->erase <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=627&ct=xref_jump_to_def&gsn=erase>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter>);
if (pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->empty <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=579&ct=xref_jump_to_def&gsn=empty>()) {
delete pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>;
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> = NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>;
}
}
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Liu Xiao
2018-07-31 01:52:41 UTC
Permalink
Thank you very much.

2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Post by Wez
You mean that the browser may be killed suddenly by others, e.g. by
other app or by the system.

Are you autotesting a custom Chromium-based build? If so then you can add
further logging to get more information on what objects are still around at
that point.
Post by Wez
Yes, my team have a custom Chromium-based build.
I have add additional logs for it, but I have found the ProfileDestroyer
object is not created and ProfileDestroyer::~ProfileDestroyer is not be
called.
Post by Wez
I don't kown how to reproduce the scene.
Hi Liu,
That CHECK indicates that the Profile is being destroyed before all the
things that rely upon it are destroyed.
1. Something is holding objects live which are still using the profile
(e.g. a leaked WebContents).
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Are you autotesting a custom Chromium-based build? If so then you can add
further logging to get more information on what objects are still around at
that point.
HTH,
Wez
There is always a crash triggered by CHECK_EQ in
ProfileDestroyer::~ProfileDestroyer when our team run our autotest program
for a long time.
However, as normally used chrome to browse, we find
ProfileDestroyer::~ProfileDestroyer can be not called, and not crash
triggered by it.
I want to kown what is the scene for this crash.
I have got some clues from the code and comment, but I don't kown the
exactly reason.
Could you help me?
https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?q=ProfileDestroyer::~ProfileDestroyer&sq=package:chromium&g=0&l=154
*ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=25&ct=xref_jump_to_def&gsn=ProfileDestroyer>::~ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=145&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523KHaSwwnEsZTjJZieX4vTiHbG0QsY6HfgrVKLXYEai2s%25253D&gsn=~ProfileDestroyer&ct=xref_usages>*() {
// Check again, in case other render hosts were added while we were
// waiting for the previous ones to go away...
if (profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>)
DestroyProfileWhenAppropriate <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=33&ct=xref_jump_to_def&gsn=DestroyProfileWhenAppropriate>(profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>);
#ifdef NDEBUG
// Don't wait for pending registrations, if any, these hosts are buggy.
// Note: this can happen, but if so, it's better to crash here than wait
// for the host to dereference a deleted Profile. http://crbug.com/248625 <https://www.google.com/url?q=http://crbug.com/248625>
CHECK_EQ(0U, num_hosts_) << "Some render process hosts were not "
<< "destroyed early enough!";
#endif // NDEBUG
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> != NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>);
DestroyerSet <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=32&ct=xref_jump_to_def&gsn=DestroyerSet>::iterator <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=427&ct=xref_jump_to_def&gsn=iterator> iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523fptDPL6Qj913xgEy8W6MCqZKOS%25252Fw3ZhiZPO8j1lFDr0%25253D&gsn=iter&ct=xref_usages> = pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->find <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=650&ct=xref_jump_to_def&gsn=find>(this);
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter> != <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/__tree?l=944&ct=xref_jump_to_def&gsn=!%3D> pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->end <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=552&ct=xref_jump_to_def&gsn=end>());
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->erase <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=627&ct=xref_jump_to_def&gsn=erase>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter>);
if (pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->empty <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=579&ct=xref_jump_to_def&gsn=empty>()) {
delete pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>;
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> = NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>;
}
}
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Liu Xiao
2018-07-31 02:42:50 UTC
Permalink
Thank you very much.

2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Post by Wez
You mean that the browser may be killed suddenly by others, e.g. by
other app or by the system.

Are you autotesting a custom Chromium-based build? If so then you can add
further logging to get more information on what objects are still around at
that point.
Post by Wez
Yes, my team have a custom Chromium-based build.
I have added additional logs for it, but I have found the
ProfileDestroyer object is not created and
ProfileDestroyer::~ProfileDestroyer can not be called.
Post by Wez
I don't kown how to reproduce the scene.
Hi Liu,
That CHECK indicates that the Profile is being destroyed before all the
things that rely upon it are destroyed.
1. Something is holding objects live which are still using the profile
(e.g. a leaked WebContents).
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Are you autotesting a custom Chromium-based build? If so then you can add
further logging to get more information on what objects are still around at
that point.
HTH,
Wez
There is always a crash triggered by CHECK_EQ in
ProfileDestroyer::~ProfileDestroyer when our team run our autotest program
for a long time.
However, as normally used chrome to browse, we find
ProfileDestroyer::~ProfileDestroyer can be not called, and not crash
triggered by it.
I want to kown what is the scene for this crash.
I have got some clues from the code and comment, but I don't kown the
exactly reason.
Could you help me?
https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?q=ProfileDestroyer::~ProfileDestroyer&sq=package:chromium&g=0&l=154
*ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=25&ct=xref_jump_to_def&gsn=ProfileDestroyer>::~ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=145&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523KHaSwwnEsZTjJZieX4vTiHbG0QsY6HfgrVKLXYEai2s%25253D&gsn=~ProfileDestroyer&ct=xref_usages>*() {
// Check again, in case other render hosts were added while we were
// waiting for the previous ones to go away...
if (profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>)
DestroyProfileWhenAppropriate <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=33&ct=xref_jump_to_def&gsn=DestroyProfileWhenAppropriate>(profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>);
#ifdef NDEBUG
// Don't wait for pending registrations, if any, these hosts are buggy.
// Note: this can happen, but if so, it's better to crash here than wait
// for the host to dereference a deleted Profile. http://crbug.com/248625 <https://www.google.com/url?q=http://crbug.com/248625>
CHECK_EQ(0U, num_hosts_) << "Some render process hosts were not "
<< "destroyed early enough!";
#endif // NDEBUG
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> != NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>);
DestroyerSet <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=32&ct=xref_jump_to_def&gsn=DestroyerSet>::iterator <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=427&ct=xref_jump_to_def&gsn=iterator> iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523fptDPL6Qj913xgEy8W6MCqZKOS%25252Fw3ZhiZPO8j1lFDr0%25253D&gsn=iter&ct=xref_usages> = pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->find <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=650&ct=xref_jump_to_def&gsn=find>(this);
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter> != <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/__tree?l=944&ct=xref_jump_to_def&gsn=!%3D> pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->end <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=552&ct=xref_jump_to_def&gsn=end>());
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->erase <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=627&ct=xref_jump_to_def&gsn=erase>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter>);
if (pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->empty <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=579&ct=xref_jump_to_def&gsn=empty>()) {
delete pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>;
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> = NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>;
}
}
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Wez
2018-07-31 17:28:33 UTC
Permalink
Post by Liu Xiao
Thank you very much.
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Post by Wez
You mean that the browser may be killed suddenly by others, e.g. by
other app or by the system.
Actually no, that is a different mechanism. Chrome's Profile management
makes the assumption that the main "run loop" will continue to execute
until all objects dependent on a Profile have been torn down - usually that
means until all the browser windows have been closed - so that it can
safely teardown the Profile objects. If you have some custom code that
e.g. uses RunLoop::QuitCurrentDeprecated() to exit that run-loop yourself,
then you will hit these problems.

Are you autotesting a custom Chromium-based build? If so then you can add
Post by Liu Xiao
further logging to get more information on what objects are still around at
that point.
Post by Wez
Yes, my team have a custom Chromium-based build.
I have added additional logs for it, but I have found the
ProfileDestroyer object is not created and
ProfileDestroyer::~ProfileDestroyer can not be called.
Post by Wez
I don't kown how to reproduce the scene.
I'm not sure what you mean by that. Are you saying that the issue doesn't
reproduce after you add logging to the ProfileDestroyer class...?
Post by Liu Xiao
Post by Wez
Hi Liu,
That CHECK indicates that the Profile is being destroyed before all the
things that rely upon it are destroyed.
1. Something is holding objects live which are still using the profile
(e.g. a leaked WebContents).
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Are you autotesting a custom Chromium-based build? If so then you can
add further logging to get more information on what objects are still
around at that point.
HTH,
Wez
There is always a crash triggered by CHECK_EQ in
ProfileDestroyer::~ProfileDestroyer when our team run our autotest program
for a long time.
However, as normally used chrome to browse, we find
ProfileDestroyer::~ProfileDestroyer can be not called, and not crash
triggered by it.
I want to kown what is the scene for this crash.
I have got some clues from the code and comment, but I don't kown the
exactly reason.
Could you help me?
https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?q=ProfileDestroyer::~ProfileDestroyer&sq=package:chromium&g=0&l=154
*ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=25&ct=xref_jump_to_def&gsn=ProfileDestroyer>::~ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=145&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523KHaSwwnEsZTjJZieX4vTiHbG0QsY6HfgrVKLXYEai2s%25253D&gsn=~ProfileDestroyer&ct=xref_usages>*() {
// Check again, in case other render hosts were added while we were
// waiting for the previous ones to go away...
if (profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>)
DestroyProfileWhenAppropriate <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=33&ct=xref_jump_to_def&gsn=DestroyProfileWhenAppropriate>(profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>);
#ifdef NDEBUG
// Don't wait for pending registrations, if any, these hosts are buggy.
// Note: this can happen, but if so, it's better to crash here than wait
// for the host to dereference a deleted Profile. http://crbug.com/248625 <https://www.google.com/url?q=http://crbug.com/248625>
CHECK_EQ(0U, num_hosts_) << "Some render process hosts were not "
<< "destroyed early enough!";
#endif // NDEBUG
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> != NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>);
DestroyerSet <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=32&ct=xref_jump_to_def&gsn=DestroyerSet>::iterator <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=427&ct=xref_jump_to_def&gsn=iterator> iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523fptDPL6Qj913xgEy8W6MCqZKOS%25252Fw3ZhiZPO8j1lFDr0%25253D&gsn=iter&ct=xref_usages> = pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->find <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=650&ct=xref_jump_to_def&gsn=find>(this);
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter> != <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/__tree?l=944&ct=xref_jump_to_def&gsn=!%3D> pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->end <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=552&ct=xref_jump_to_def&gsn=end>());
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->erase <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=627&ct=xref_jump_to_def&gsn=erase>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter>);
if (pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->empty <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=579&ct=xref_jump_to_def&gsn=empty>()) {
delete pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>;
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> = NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>;
}
}
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Liu Xiao
2018-08-01 01:51:50 UTC
Permalink
Thank you very much.

Actually no, that is a different mechanism. Chrome's Profile management
makes the assumption that the main "run loop" will continue to execute
until all objects dependent on a Profile have been torn down - usually that
means until all the browser windows have been closed - so that it can
safely teardown the Profile objects. If you have some custom code that
e.g. uses RunLoop::QuitCurrentDeprecated() to exit that run-loop yourself,
then you will hit these problems.
Post by Wez
I have got it, I will check the source code.
Is there only one Profile for one Chrome ?
I'm not sure what you mean by that. Are you saying that the issue doesn't
reproduce after you add logging to the ProfileDestroyer class...?
Post by Wez
I'm sorry, maybe my expression is not very clear.
This problem can only occur with the autotest program, but no matter how
we operate the browser in manual, ProfileDestroyer::~ProfileDestroyer can
not be called.
Post by Wez
Thank you very much.
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Post by Wez
You mean that the browser may be killed suddenly by others, e.g. by
other app or by the system.
Actually no, that is a different mechanism. Chrome's Profile management
makes the assumption that the main "run loop" will continue to execute
until all objects dependent on a Profile have been torn down - usually that
means until all the browser windows have been closed - so that it can
safely teardown the Profile objects. If you have some custom code that
e.g. uses RunLoop::QuitCurrentDeprecated() to exit that run-loop yourself,
then you will hit these problems.
Are you autotesting a custom Chromium-based build? If so then you can add
further logging to get more information on what objects are still around at
that point.
Post by Wez
Yes, my team have a custom Chromium-based build.
I have added additional logs for it, but I have found the
ProfileDestroyer object is not created and
ProfileDestroyer::~ProfileDestroyer can not be called.
Post by Wez
I don't kown how to reproduce the scene.
I'm not sure what you mean by that. Are you saying that the issue doesn't
reproduce after you add logging to the ProfileDestroyer class...?
Post by Wez
Hi Liu,
That CHECK indicates that the Profile is being destroyed before all the
things that rely upon it are destroyed.
1. Something is holding objects live which are still using the profile
(e.g. a leaked WebContents).
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Are you autotesting a custom Chromium-based build? If so then you can
add further logging to get more information on what objects are still
around at that point.
HTH,
Wez
There is always a crash triggered by CHECK_EQ in
ProfileDestroyer::~ProfileDestroyer when our team run our autotest program
for a long time.
However, as normally used chrome to browse, we find
ProfileDestroyer::~ProfileDestroyer can be not called, and not crash
triggered by it.
I want to kown what is the scene for this crash.
I have got some clues from the code and comment, but I don't kown the
exactly reason.
Could you help me?
https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?q=ProfileDestroyer::~ProfileDestroyer&sq=package:chromium&g=0&l=154
*ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=25&ct=xref_jump_to_def&gsn=ProfileDestroyer>::~ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=145&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523KHaSwwnEsZTjJZieX4vTiHbG0QsY6HfgrVKLXYEai2s%25253D&gsn=~ProfileDestroyer&ct=xref_usages>*() {
// Check again, in case other render hosts were added while we were
// waiting for the previous ones to go away...
if (profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>)
DestroyProfileWhenAppropriate <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=33&ct=xref_jump_to_def&gsn=DestroyProfileWhenAppropriate>(profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>);
#ifdef NDEBUG
// Don't wait for pending registrations, if any, these hosts are buggy.
// Note: this can happen, but if so, it's better to crash here than wait
// for the host to dereference a deleted Profile. http://crbug.com/248625 <https://www.google.com/url?q=http://crbug.com/248625>
CHECK_EQ(0U, num_hosts_) << "Some render process hosts were not "
<< "destroyed early enough!";
#endif // NDEBUG
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> != NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>);
DestroyerSet <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=32&ct=xref_jump_to_def&gsn=DestroyerSet>::iterator <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=427&ct=xref_jump_to_def&gsn=iterator> iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523fptDPL6Qj913xgEy8W6MCqZKOS%25252Fw3ZhiZPO8j1lFDr0%25253D&gsn=iter&ct=xref_usages> = pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->find <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=650&ct=xref_jump_to_def&gsn=find>(this);
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter> != <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/__tree?l=944&ct=xref_jump_to_def&gsn=!%3D> pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->end <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=552&ct=xref_jump_to_def&gsn=end>());
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->erase <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=627&ct=xref_jump_to_def&gsn=erase>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter>);
if (pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->empty <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=579&ct=xref_jump_to_def&gsn=empty>()) {
delete pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>;
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> = NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>;
}
}
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Liu Xiao
2018-08-01 01:52:55 UTC
Permalink
Thank you very much.

Actually no, that is a different mechanism. Chrome's Profile management
makes the assumption that the main "run loop" will continue to execute
until all objects dependent on a Profile have been torn down - usually that
means until all the browser windows have been closed - so that it can
safely teardown the Profile objects. If you have some custom code that
e.g. uses RunLoop::QuitCurrentDeprecated() to exit that run-loop yourself,
then you will hit these problems.
Post by Wez
I have got it, I will check the source code.
Is there only one Profile for one Chrome ?
I'm not sure what you mean by that. Are you saying that the issue doesn't
reproduce after you add logging to the ProfileDestroyer class...?
Post by Wez
I'm sorry, maybe my expression is not very clear.
This problem can only occur with the autotest program, but no matter how
we operate the browser in manual, ProfileDestroyer::~ProfileDestroyer can
not be called.
Post by Wez
Thank you very much.
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Post by Wez
You mean that the browser may be killed suddenly by others, e.g. by
other app or by the system.
Actually no, that is a different mechanism. Chrome's Profile management
makes the assumption that the main "run loop" will continue to execute
until all objects dependent on a Profile have been torn down - usually that
means until all the browser windows have been closed - so that it can
safely teardown the Profile objects. If you have some custom code that
e.g. uses RunLoop::QuitCurrentDeprecated() to exit that run-loop yourself,
then you will hit these problems.
Are you autotesting a custom Chromium-based build? If so then you can add
further logging to get more information on what objects are still around at
that point.
Post by Wez
Yes, my team have a custom Chromium-based build.
I have added additional logs for it, but I have found the
ProfileDestroyer object is not created and
ProfileDestroyer::~ProfileDestroyer can not be called.
Post by Wez
I don't kown how to reproduce the scene.
I'm not sure what you mean by that. Are you saying that the issue doesn't
reproduce after you add logging to the ProfileDestroyer class...?
Post by Wez
Hi Liu,
That CHECK indicates that the Profile is being destroyed before all the
things that rely upon it are destroyed.
1. Something is holding objects live which are still using the profile
(e.g. a leaked WebContents).
2. You exited the browser main-loop manually, rather than letting the
"keep-alive" mechanism do it - the keepalive system is normally responsible
for ensuring that we don't exit, and teardown the Profile, before
everything else is done.
Are you autotesting a custom Chromium-based build? If so then you can
add further logging to get more information on what objects are still
around at that point.
HTH,
Wez
There is always a crash triggered by CHECK_EQ in
ProfileDestroyer::~ProfileDestroyer when our team run our autotest program
for a long time.
However, as normally used chrome to browse, we find
ProfileDestroyer::~ProfileDestroyer can be not called, and not crash
triggered by it.
I want to kown what is the scene for this crash.
I have got some clues from the code and comment, but I don't kown the
exactly reason.
Could you help me?
https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?q=ProfileDestroyer::~ProfileDestroyer&sq=package:chromium&g=0&l=154
*ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=25&ct=xref_jump_to_def&gsn=ProfileDestroyer>::~ProfileDestroyer <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=145&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523KHaSwwnEsZTjJZieX4vTiHbG0QsY6HfgrVKLXYEai2s%25253D&gsn=~ProfileDestroyer&ct=xref_usages>*() {
// Check again, in case other render hosts were added while we were
// waiting for the previous ones to go away...
if (profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>)
DestroyProfileWhenAppropriate <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=33&ct=xref_jump_to_def&gsn=DestroyProfileWhenAppropriate>(profile_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=59&ct=xref_jump_to_def&gsn=profile_>);
#ifdef NDEBUG
// Don't wait for pending registrations, if any, these hosts are buggy.
// Note: this can happen, but if so, it's better to crash here than wait
// for the host to dereference a deleted Profile. http://crbug.com/248625 <https://www.google.com/url?q=http://crbug.com/248625>
CHECK_EQ(0U, num_hosts_) << "Some render process hosts were not "
<< "destroyed early enough!";
#endif // NDEBUG
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> != NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>);
DestroyerSet <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.h?l=32&ct=xref_jump_to_def&gsn=DestroyerSet>::iterator <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=427&ct=xref_jump_to_def&gsn=iterator> iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fchrome%252Fbrowser%252Fprofiles%252Fprofile_destroyer.cc%253Froot%253Dchromium-android%2523fptDPL6Qj913xgEy8W6MCqZKOS%25252Fw3ZhiZPO8j1lFDr0%25253D&gsn=iter&ct=xref_usages> = pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->find <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=650&ct=xref_jump_to_def&gsn=find>(this);
DCHECK <https://cs.chromium.org/chromium/src/base/logging.h?l=879&ct=xref_jump_to_def&gsn=DCHECK>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter> != <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/__tree?l=944&ct=xref_jump_to_def&gsn=!%3D> pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->end <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=552&ct=xref_jump_to_def&gsn=end>());
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->erase <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=627&ct=xref_jump_to_def&gsn=erase>(iter <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=159&ct=xref_jump_to_def&gsn=iter>);
if (pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>->empty <https://cs.chromium.org/chromium/src/third_party/android_ndk/sources/cxx-stl/llvm-libc%2B%2B/include/set?l=579&ct=xref_jump_to_def&gsn=empty>()) {
delete pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_>;
pending_destroyers_ <https://cs.chromium.org/chromium/src/chrome/browser/profiles/profile_destroyer.cc?l=30&ct=xref_jump_to_def&gsn=pending_destroyers_> = NULL <https://cs.chromium.org/chromium/kythe_builtins/include/stddef.h?l=100&ct=xref_jump_to_def&gsn=NULL>;
}
}
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Loading...