diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2021-06-17 14:46:03 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2021-06-17 22:48:02 +0200 |
commit | 960b2878cb504f10a27b24714d3c81bba6f48634 (patch) | |
tree | 33bb428e5fdddb7b83638862853cb1a3afa28b4c /bin | |
parent | b5eb15a21d89d5c4bb45122f68e68944ab8ffe42 (diff) |
don't ignore dump_syms errors during symbol extraction
also fix the file filtering in case directories are passed for recursive
traversal (pdb files are not created in instdir, so that never really
matched our build-env)
Pass a directory to the invocation to make use of that filtering, and
also add a retry in case dump_syms segfaults during processing
(see also 73299faa75a4974eb49c93ffdfb2d6329cb4e519)
Change-Id: I8989c3fd72de0b18eecce490fac81db956f87515
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117386
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/symbolstore.py | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/bin/symbolstore.py b/bin/symbolstore.py index 1f80e2f69e99..2101e396153b 100755 --- a/bin/symbolstore.py +++ b/bin/symbolstore.py @@ -452,12 +452,17 @@ class Dumper: if filename.startswith("cvs"): (ver, checkout, source_file, revision) = filename.split(":", 3) sourceFileStream += sourcepath + "*MYSERVER*" + source_file + '*' + revision + "\r\n" - f.write("FILE %s %s\n" % (index, filename)) + f.write("FILE %s %s\r\n" % (index, filename)) else: # pass through all other lines unchanged f.write(line) f.close() - cmd.close() + command_exit = cmd.close() + if command_exit: + if command_exit == 11: + print >> sys.stderr, "INFO: dump_syms segfault while processing {}, retrying".format(file) + return self.ProcessFile(file) + raise Exception("ERROR - dump_syms error while processing {} (exit code {})".format(file, command_exit)) # we output relative paths so callers can get a list of what # was generated print rel_path @@ -468,6 +473,7 @@ class Dumper: result = self.SourceServerIndexing(debug_file, guid, sourceFileStream, cvs_root) result = True except StopIteration: + print >> sys.stderr, "WARN: dump_syms - no debug info extracted for {}".format(file) pass except: print >> sys.stderr, "Unexpected error: ", sys.exc_info()[0] @@ -483,11 +489,29 @@ class Dumper_Win32(Dumper): def ShouldProcess(self, file): """This function will allow processing of pdb files that have dll or exe files with the same base name next to them.""" - if file.endswith(".pdb"): - (path,ext) = os.path.splitext(file) - if os.path.isfile(path + ".exe") or os.path.isfile(path + ".dll") or os.path.isfile(path + ".bin"): - return True - return False + + skip_extensions = [ + ".bat", ".class", ".config", ".css", ".glsl", ".hrc", ".ini", ".jar", ".mo", ".msu", + ".ods", ".png", ".py", ".pyc", ".rdb", ".rst", ".sh", ".svg", ".ttf", ".txt", ".xml", + ] + (path,ext) = os.path.splitext(file) + basename = os.path.basename(file) + if ext in skip_extensions: + return False + elif os.path.getsize(file) == 21: + # content is the "invalid - merged lib" stub + return False + elif basename.startswith("LICENSE") or basename.startswith("README"): + return False + elif basename == "msvcp140.dll" or basename == "vcruntime140.dll": + return False + elif basename.startswith("wininst-") or basename == "fetch_macholib" or basename == "command_template": + # ignore python distutils stubs and scripts + return False + elif ext == "": + print >> sys.stderr, "INFO: Skipping {}, has no extension".format(file) + return False + return True def FixFilenameCase(self, file): """Recent versions of Visual C++ put filenames into |