⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 244064 in webkit


Ignore:
Timestamp:
Apr 8, 2019, 6:32:17 PM (7 years ago)
Author:
Jonathan Bedard
Message:

Log stack-trace for run-webkit-tests when interrupted
https://bugs.webkit.org/show_bug.cgi?id=176393
<rdar://problem/34262310>

Reviewed by Lucas Forschler.

  • Scripts/webkitpy/common/interrupt_debugging.py: Added.

(log_stack_trace): Given a Python frame object, log a stack trace to the provided file.
(StackTraceFileContext): Context which allows stack-traces to be printed to stderr or to a file.
(log_stack_trace_on_term): Attach a listener to SIGTERM so that a stack-trace can be logged when a program is terminated.
(log_stack_trace_on_ctrl_c): Attach a listener to SIGINT so that a stack-trace can be logged when a program is CTRL+Ced.

  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:

(main): Set handlers to log stack trace on interruption.

Location:
trunk/Tools
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r244062 r244064  
     12019-04-08  Jonathan Bedard  <jbedard@apple.com>
     2
     3        Log stack-trace for run-webkit-tests when interrupted
     4        https://bugs.webkit.org/show_bug.cgi?id=176393
     5        <rdar://problem/34262310>
     6
     7        Reviewed by Lucas Forschler.
     8
     9        * Scripts/webkitpy/common/interrupt_debugging.py: Added.
     10        (log_stack_trace): Given a Python frame object, log a stack trace to the provided file.
     11        (StackTraceFileContext): Context which allows stack-traces to be printed to stderr or to a file.
     12        (log_stack_trace_on_term): Attach a listener to SIGTERM so that a stack-trace can be logged when a program is terminated.
     13        (log_stack_trace_on_ctrl_c): Attach a listener to SIGINT so that a stack-trace can be logged when a program is CTRL+Ced.
     14        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     15        (main): Set handlers to log stack trace on interruption.
     16
    1172019-04-08  Fujii Hironori  <Hironori.Fujii@sony.com>
    218
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r243842 r244064  
    11# Copyright (C) 2010 Google Inc. All rights reserved.
    22# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
    3 # Copyright (C) 2011, 2016 Apple Inc. All rights reserved.
     3# Copyright (C) 2011, 2016, 2019 Apple Inc. All rights reserved.
    44#
    55# Redistribution and use in source and binary forms, with or without
     
    3737
    3838from webkitpy.common.host import Host
     39from webkitpy.common.interrupt_debugging import log_stack_trace_on_ctrl_c, log_stack_trace_on_term
    3940from webkitpy.layout_tests.controllers.manager import Manager
    4041from webkitpy.layout_tests.models.test_run_results import INTERRUPTED_EXIT_STATUS
     
    7576        print(str(e), file=stderr)
    7677        return EXCEPTIONAL_EXIT_STATUS
     78
     79    stack_trace_path = host.filesystem.join(port.results_directory(), 'python_stack_trace.txt')
     80    log_stack_trace_on_ctrl_c(output_file=stack_trace_path)
     81    log_stack_trace_on_term(output_file=stack_trace_path)
    7782
    7883    if options.print_expectations:
Note: See TracChangeset for help on using the changeset viewer.