Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 471b695cde8eb37910d73abb4cdaa7d93c7a0fc1
https://github.com/WebKit/WebKit/commit/471b695cde8eb37910d73abb4cdaa7d93c7a0fc1
Author: Carlos Alberto Lopez Perez <[email protected]>
Date: 2026-06-02 (Tue, 02 Jun 2026)
Changed paths:
M Tools/Scripts/webkitpy/port/linux_get_crash_log.py
M Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py
Log Message:
-----------
[Tools] linux_get_crash_log: avoid python crashes when the coredumps are
auto-deleted with multiple concurrent workers.
https://bugs.webkit.org/show_bug.cgi?id=315195
Unreviewed follow-up after 313530@main
With multiple parallel workers and the auto-delete feature enabled (which is
enabled on the bots),
it can happen that two workers select the same coredump (one matching by pid
and another matching
by program name because it couldn't match by pid). Then it can happen that one
worker deletes the
coredump meanwhile the other is trying to process it. This causes a
FileNotFoundError fatal python
crash that interrupts the whole test suite.
Avoid this by guarding against these race conditions. Also do not delete the
coredumps when
matching by pid was not possible. This may allow the real owner of that
coredump to find it later.
And in the case of matching by pid, when autodeletion is enabled, rename the
file as soon as
possible so no other worker matching by name can pick that one.
Those will be cleaned in the next run at clean_old_coredumps() /
clean_old_thread_info_files().
On top of that improve a bit the info displayed on the debug logs when
capturing the thread names,
which may be useful for checking later issues with the crash log generator not
capturing specific
crashes.
This has been observed on the EWS bots:
https://ews-build.webkit.org/#/builders/1/builds/137321
https://ews-build.webkit.org/#/builders/34/builds/128982
* Tools/Scripts/webkitpy/port/linux_get_crash_log.py:
(CrashLogUtils):
(CrashLogUtils.safe_getmtime):
(CrashLogUtils.most_recent_existing):
(ThreadNamesCrashLogCapturer.handle_coredump):
(GDBCrashLogStartupHandler._maybe_remove_file_if_old):
(GDBCrashLogStartupHandler.clean_old_coredumps):
(GDBCrashLogGenerator._pick_most_recent):
(GDBCrashLogGenerator._get_coredump_path_with_core_pattern_method):
(GDBCrashLogGenerator._get_thread_info_for_effective_pid):
(GDBCrashLogGenerator.generate_crash_log):
* Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py:
(SafeGetmtimeMostRecentExistingTest):
(SafeGetmtimeMostRecentExistingTest.setUp):
(SafeGetmtimeMostRecentExistingTest.test_returns_mtime_for_existing_file):
(SafeGetmtimeMostRecentExistingTest.test_returns_none_for_missing_file):
(SafeGetmtimeMostRecentExistingTest._touch):
(SafeGetmtimeMostRecentExistingTest.test_empty_returns_none):
(SafeGetmtimeMostRecentExistingTest.test_picks_newest):
(SafeGetmtimeMostRecentExistingTest.test_skips_vanished_path):
(SafeGetmtimeMostRecentExistingTest.test_newest_vanished_falls_back_to_next):
(SafeGetmtimeMostRecentExistingTest.test_all_vanished_returns_none):
(GenerateCrashLogTest.test_no_coredump_emits_help_message_and_sections):
(GenerateCrashLogTest.test_stderr_section_skipped_when_no_stderr):
(CorePatternScanRaceTest):
(CorePatternScanRaceTest.setUp):
(CorePatternScanRaceTest._touch):
(CorePatternScanRaceTest.test_candidate_deleted_between_listdir_and_stat_does_not_crash):
(CorePatternScanRaceTest.test_candidate_deleted_between_listdir_and_stat_does_not_crash.flaky_getmtime):
(CoredumpDeletionGatingTest):
(CoredumpDeletionGatingTest.setUp):
(CoredumpDeletionGatingTest._setup):
(CoredumpDeletionGatingTest.test_pid_match_deletes_coredump_and_thread_info):
(CoredumpDeletionGatingTest.test_name_match_keeps_coredump_and_thread_info):
(CoredumpDeletionGatingTest.test_no_autodelete_keeps_coredump_even_on_pid_match):
(CoredumpDeletionGatingTest.test_pid_match_claims_coredump_by_rename_before_gdb):
(CoredumpDeletionGatingTest.test_pid_match_claims_coredump_by_rename_before_gdb.fake_gdb):
(CoredumpDeletionGatingTest.test_name_match_is_not_claimed_by_rename):
(CoredumpDeletionGatingTest.test_name_match_is_not_claimed_by_rename.fake_gdb):
(CoredumpDeletionGatingTest.test_coredump_gone_at_stat_time_skips_rename_and_gdb):
(CoredumpDeletionGatingTest.test_coredump_gone_at_stat_time_skips_rename_and_gdb.fake_gdb):
(CleanOldCoredumpsTest):
(CleanOldCoredumpsTest.setUp):
(CleanOldCoredumpsTest._touch):
(CleanOldCoredumpsTest.test_reaps_old_pattern_and_claimed_keeps_fresh_and_unrelated):
(GetCoredumpPathTest.test_selection_ignores_claimed_prefixed_files):
Canonical link: https://commits.webkit.org/314414@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications