Second test in NetworkServiceTest suite crashes on OS X 10.12.6 |
|
Issue descriptionChrome Version: 64.0.3251.0 What steps will reproduce the problem? Run content_unitests --gtest_filter=NetworkServiceTest*" on OS X 10.12.6 What is the expected result? All tests pass. What happens instead? Second test crashes at call notify_register_file_descriptor in NotifyWatcherMac::Watch. On OS X 10.13.1 all tests pass. Moreover on OS X 10.12.6 if each test is run separately then crash does not occur.
,
Aug 13
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2f74c00ee75348fc74946a3717f3fa23c49068f6 commit 2f74c00ee75348fc74946a3717f3fa23c49068f6 Author: Konstantin Ganenko <ganenkokb@yandex-team.ru> Date: Mon Aug 13 16:45:23 2018 Fix net services unittests on masos earlier than 10.13 The short crash stack: 6 libsystem_c.dylib 0x00007fffb1a889ed reallocf + 21 7 libsystem_notify.dylib 0x00007fffb1bf962f notify_retain_file_descriptor + 160 8 libsystem_notify.dylib 0x00007fffb1bf94c3 notify_register_file_descriptor + 1091 9 libnet.dylib 0x0000000111832021 net::NotifyWatcherMac::Watch(char const*, base::RepeatingCallback<void (bool)> const&) + 241 Crash happens on OS X 10.12.X. The fall occurs in the libnotify library. For macos 10.12.X libnotify library version 165 is used. https://opensource.apple.com/release/macos-1012.html By source code: https://opensource.apple.com/source/Libnotify/Libnotify-165/notify_client.c.auto.html the fall occurs in globals->fd_clnt = (int *)reallocf(globals - >fd_clnt, globals->fd_count * sizeof(int)); , or the same with fd_srv, fd_refcount. Global pointers to file descriptor tables are reset only when global is initialized and nowhere else. On releasing the last file descriptor free is called for these pointers without zeroing them. (see notify_release_file_descriptor in same file). Accordingly, when creating one file descriptor (notify_register_file_descriptor) with subsequent its destruction (notify_cancel), the creation of the next will lead to a crash - realloc on freed pointer. Here introduced simple approach to repair issue. We need to hold one stub file descriptor to avoid freeing globals in libnotify. For earlier implementations of the libraries (looked 10.11.X - version of library is 149) the problem is also there. More detailed crash stack is added in issue. R=agl@chromium.org Bug: 783148 Change-Id: I23396372bf6fdff78c70bf6a53a4183795677b02 Reviewed-on: https://chromium-review.googlesource.com/1168490 Commit-Queue: Adam Langley <agl@chromium.org> Reviewed-by: Adam Langley <agl@chromium.org> Cr-Commit-Position: refs/heads/master@{#582612} [modify] https://crrev.com/2f74c00ee75348fc74946a3717f3fa23c49068f6/net/dns/notify_watcher_mac.cc |
|
►
Sign in to add a comment |
|
Comment 1 by ganenk...@yandex-team.ru
, Aug 9