diff options
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rwxr-xr-x | src/third_party/wiredtiger/test/evergreen.yml | 9 | ||||
-rw-r--r-- | src/third_party/wiredtiger/test/evergreen/print_stack_trace.py | 49 |
3 files changed, 33 insertions, 27 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index e3c740238b1..4a41d1926b6 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "df5a0886739b55f767bf8f7b722adbc31f106826" + "commit": "b5dc894abbb12fe4661866fb40b276a9d2cf0851" } diff --git a/src/third_party/wiredtiger/test/evergreen.yml b/src/third_party/wiredtiger/test/evergreen.yml index adbf3173d10..44861263e50 100755 --- a/src/third_party/wiredtiger/test/evergreen.yml +++ b/src/third_party/wiredtiger/test/evergreen.yml @@ -364,6 +364,9 @@ functions: echo "$exit_code" > cppsuite_exit_code if [ "$exit_code" != 0 ]; then echo "[{\"info\":{\"test_name\": \"${test_name}\"},\"metrics\": []}]" > ${test_name}.json + # Since we later remove the WiredTiger folder, we need to check for core dumps now. + cd ../.. + ${python_binary|python3} ../test/evergreen/print_stack_trace.py fi exit 0 - command: perf.send @@ -590,18 +593,14 @@ functions: script: | set -o errexit set -o verbose - # Parse through any failures inside the WT_TEST directory. - ${python_binary|python3} ../test/evergreen/print_stack_trace.py --unit_test -e ${python_binary|python3} -c WT_TEST -l . + ${python_binary|python3} ../test/evergreen/print_stack_trace.py - # Look through the stress format directory for any coredumps. - ${python_binary|python3} ../test/evergreen/print_stack_trace.py --format -e ./test/format/t -c test/format/. -l test/format/. - command: s3.put params: aws_secret: ${aws_secret} aws_key: ${aws_key} local_files_include_filter: - wiredtiger/cmake_build/*stacktrace.txt - - wiredtiger/cmake_build/test/format/*stacktrace.txt bucket: build_external permissions: public-read content_type: text/plain diff --git a/src/third_party/wiredtiger/test/evergreen/print_stack_trace.py b/src/third_party/wiredtiger/test/evergreen/print_stack_trace.py index 9758bc1763f..82848f48e80 100644 --- a/src/third_party/wiredtiger/test/evergreen/print_stack_trace.py +++ b/src/third_party/wiredtiger/test/evergreen/print_stack_trace.py @@ -57,6 +57,7 @@ class LLDBDumper: sys.exit("Debugger lldb not found," "skipping dumping of {}".format(core_path)) + cmds = [] if dump_all: cmds.append("thread apply all backtrace -c 30") else: @@ -108,50 +109,56 @@ class GDBDumper: def main(): parser = argparse.ArgumentParser() - parser.add_argument('-e', '--executable_path', - help='path to the executable', - required=True) parser.add_argument('-c', '--core_path', - help='directory path to the core dumps', - required=True) + help='directory path to the core dumps') parser.add_argument('-l', '--lib_path', help='library path') - group = parser.add_mutually_exclusive_group(required=True) - group.add_argument('--unit_test', action='store_true', help='Format core dumps from python unit tests') - group.add_argument('--format', action='store_true', help='Format core dumps from format tests') args = parser.parse_args() - # Store the path of the core files as a list. - core_files = [] - dump_all = args.unit_test + # If the lib_path is not provided then search the current dir. + lib_path = "." if args.lib_path is None else args.lib_path - regex = None - if (args.format): - regex = re.compile(r'dump_t.*core', re.IGNORECASE) - elif (args.unit_test): - regex = re.compile(r'dump.*python.*core', re.IGNORECASE) + # If the core_path is not provided then search the current dir. + core_path = "." if args.core_path is None else args.core_path - for root, _, files in os.walk(args.core_path): + # Append the path of the core files present in the core path in a list. + core_files = [] + regex = re.compile(r'dump.*core', re.IGNORECASE) + for root, _, files in os.walk(core_path): for file in files: if regex.match(file): core_files.append(os.path.join(root, file)) for core_file_path in core_files: print(border_msg(core_file_path), flush=True) + + # Get the executable from the core file itself. + proc = subprocess.Popen(["file", core_file_path], stdout=subprocess.PIPE) + # The file command prints something similar to: + # WT_TEST/test_practice.0/dump_python3.16562.core: ELF 64-bit LSB core file x86-64, version 1 (SYSV), + # SVR4-style, from 'python3 /home/ubuntu/wiredtiger/test/suite/run.py -j 1 -p test_practice', + # real uid: 1000, effective uid: 1000, real gid: 1000, effective gid: 1000, execfn: '/usr/bin/python3', platform: 'x86_64' + output = str(proc.communicate()) + + # The field of interest is execfn: '/usr/bin/python3' from the example above. + start = output.find('execfn: ') + # Fetch the value of execfn. This is the executable path! + executable_path = re.search(r'\'.*?\'', output[start:]).group(0) + if sys.platform.startswith('linux'): dbg = GDBDumper() - dbg.dump(args.executable_path, core_file_path, args.lib_path, dump_all, None) + dbg.dump(executable_path, core_file_path, lib_path, False, None) # Extract the filename from the core file path, to create a stacktrace output file. file_name, _ = os.path.splitext(os.path.basename(core_file_path)) - dbg.dump(args.executable_path, core_file_path, args.lib_path, True, file_name + ".stacktrace.txt") + dbg.dump(executable_path, core_file_path, lib_path, True, file_name + ".stacktrace.txt") elif sys.platform.startswith('darwin'): # FIXME - macOS to be supported in WT-8976 # dbg = LLDBDumper() - # dbg.dump(args.executable_path, core_file_path, dump_all) + # dbg.dump(args.executable_path, core_file_path, False, None) # Extract the filename from the core file path, to create a stacktrace output file. # file_name, _ = os.path.splitext(os.path.basename(core_file_path)) - # dbg.dump(args.executable_path, core_file_path, args.lib_path, dump_all, file_name + ".stacktrace.txt") + # dbg.dump(executable_path, core_file_path, True, file_name + ".stacktrace.txt") pass elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): # FIXME - Windows to be supported in WT-8937 |