Merge lp:~bdrung/apport/lp-1684535 into lp:~apport-hackers/apport/trunk

Proposed by Benjamin Drung
Status: Needs review
Proposed branch: lp:~bdrung/apport/lp-1684535
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 38 lines (+17/-0)
2 files modified
apport/report.py (+8/-0)
problem_report.py (+9/-0)
To merge this branch: bzr merge lp:~bdrung/apport/lp-1684535
Reviewer Review Type Date Requested Status
Apport upstream developers Pending
Review via email: mp+389620@code.launchpad.net

Description of the change

Support specifying a CoreDumpFile in the .crash file instead of requiring it to be included in the file.

Motivation: We transfer the core dump via network with lz4 compression. See Debian bug #857300 [1] for the collecting script.

[1] https://bugs.debian.org/857300

To post a comment you must log in.

Unmerged revisions

3283. By Benjamin Drung

Support lz4 compressed core dump files

LP: #1684535

3282. By Benjamin Drung

Support CoreDumpFile

Support specifying a core dump file instead of attaching it to the
.crash file.

LP: #1684535

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'apport/report.py'
--- apport/report.py 2020-06-09 21:41:57 +0000
+++ apport/report.py 2020-08-20 16:56:23 +0000
@@ -1623,6 +1623,14 @@
1623 else:1623 else:
1624 # value is a file path1624 # value is a file path
1625 core = self['CoreDump'][0]1625 core = self['CoreDump'][0]
1626 if core.endswith(".lz4"):
1627 compressed_core = core
1628 (fd, core) = tempfile.mkstemp(prefix="apport_core_")
1629 atexit.register(os.unlink, core)
1630 subprocess.check_call(
1631 ["lz4", "--decompress", "--to-stdout", compressed_core], stdout=fd
1632 )
1633 os.close(fd)
16261634
1627 command += ['--ex', 'core-file ' + core]1635 command += ['--ex', 'core-file ' + core]
16281636
16291637
=== modified file 'problem_report.py'
--- problem_report.py 2019-05-20 18:54:29 +0000
+++ problem_report.py 2020-08-20 16:56:23 +0000
@@ -204,6 +204,15 @@
204 if key is not None:204 if key is not None:
205 self.data[key] = self._try_unicode(value)205 self.data[key] = self._try_unicode(value)
206206
207 if "CoreDumpFile" in self.data:
208 coredumpfile = self.data.pop("CoreDumpFile")
209 if not coredumpfile.startswith("/"):
210 # Sanitize path (assumed it to be relative to the .crash file)
211 coredumpfile = os.path.join(
212 os.path.dirname(os.path.abspath(file.name)), coredumpfile
213 )
214 self.data["CoreDump"] = (coredumpfile,)
215
207 self.old_keys = set(self.data.keys())216 self.old_keys = set(self.data.keys())
208217
209 def extract_keys(self, file, bin_keys, dir):218 def extract_keys(self, file, bin_keys, dir):

Subscribers

People subscribed via source and target branches