Commit fb2ca44d authored by dpranke@chromium.org's avatar dpranke@chromium.org

[chromium] Linux ASAN WebKit canary is running out of memory

https://bugs.webkit.org/show_bug.cgi?id=112978

Reviewed by Tony Chang.

Running the AddressSanitizer on a crash takes a lot of
memory, so we should serialize access to it to avoid running
out of memory on a machine.

* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort._get_crash_log):
* Scripts/webkitpy/layout_tests/port/http_lock.py:
(HttpLock.__init__):
(HttpLock.wait_for_httpd_lock):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6d01cb68
2013-03-21 Dirk Pranke <dpranke@chromium.org>
[chromium] Linux ASAN WebKit canary is running out of memory
https://bugs.webkit.org/show_bug.cgi?id=112978
Reviewed by Tony Chang.
Running the AddressSanitizer on a crash takes a lot of
memory, so we should serialize access to it to avoid running
out of memory on a machine.
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort._get_crash_log):
* Scripts/webkitpy/layout_tests/port/http_lock.py:
(HttpLock.__init__):
(HttpLock.wait_for_httpd_lock):
2013-03-21 Min Qin <qinmin@chromium.org>
Cleanup android media layout test code
......@@ -41,6 +41,7 @@ from webkitpy.common.system import executive
from webkitpy.common.system.path import cygpath
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
from webkitpy.layout_tests.port.base import Port, VirtualTestSuite
from webkitpy.layout_tests.port.http_lock import HttpLock
_log = logging.getLogger(__name__)
......@@ -369,10 +370,19 @@ class ChromiumPort(Port):
def _get_crash_log(self, name, pid, stdout, stderr, newer_than):
if stderr and 'AddressSanitizer' in stderr:
asan_filter_path = self.path_from_chromium_base('tools', 'valgrind', 'asan', 'asan_symbolize.py')
if self._filesystem.exists(asan_filter_path):
output = self._executive.run_command([asan_filter_path], input=stderr, decode_output=False)
stderr = self._executive.run_command(['c++filt'], input=output, decode_output=False)
# Running the AddressSanitizer take a lot of memory, so we need to
# serialize access to it across all the concurrently running drivers.
lock = HttpLock(lock_path=None, lock_file_prefix='WebKitASAN.lock.',
filesystem=self._filesystem, executive=self._executive,
name='ASAN')
try:
lock.wait_for_httpd_lock()
asan_filter_path = self.path_from_chromium_base('tools', 'valgrind', 'asan', 'asan_symbolize.py')
if self._filesystem.exists(asan_filter_path):
output = self._executive.run_command([asan_filter_path], input=stderr, decode_output=False)
stderr = self._executive.run_command(['c++filt'], input=output, decode_output=False)
finally:
lock.cleanup_http_lock()
return super(ChromiumPort, self)._get_crash_log(name, pid, stdout, stderr, newer_than)
......
......@@ -24,6 +24,9 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# FIXME: rename this file, and add more text about how this is
# different from the base file_lock class.
"""This class helps to block NRWT threads when more NRWTs run
perf, http and websocket tests in a same time."""
......@@ -42,7 +45,7 @@ _log = logging.getLogger(__name__)
class HttpLock(object):
def __init__(self, lock_path, lock_file_prefix="WebKitHttpd.lock.", guard_lock="WebKit.lock", filesystem=None, executive=None):
def __init__(self, lock_path, lock_file_prefix="WebKitHttpd.lock.", guard_lock="WebKit.lock", filesystem=None, executive=None, name='HTTP'):
self._executive = executive or Executive()
self._filesystem = filesystem or FileSystem()
self._lock_path = lock_path
......@@ -54,6 +57,7 @@ class HttpLock(object):
self._guard_lock_file = self._filesystem.join(self._lock_path, guard_lock)
self._guard_lock = FileLock(self._guard_lock_file)
self._process_lock_file_name = ""
self._name = name
def cleanup_http_lock(self):
"""Delete the lock file if exists."""
......@@ -123,11 +127,11 @@ class HttpLock(object):
"""Create a lock file and wait until it's turn comes. If something goes wrong
it wont do any locking."""
if not self._create_lock_file():
_log.debug("Warning, http locking failed!")
_log.debug("Warning, %s locking failed!" % self._name)
return
# FIXME: This can hang forever!
while self._current_lock_pid() != os.getpid():
time.sleep(1)
_log.debug("HTTP lock acquired")
_log.debug("%s lock acquired" % self._name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment