Merge lp:~achiang/ubuntu-nexus7/valgrind-ubuntu-dbg-packages into lp:~ubuntu-nexus7/ubuntu-nexus7/valgrind-ubuntu-dbg-packages
| Status: | Work in progress |
|---|---|
| Proposed branch: | lp:~achiang/ubuntu-nexus7/valgrind-ubuntu-dbg-packages |
| Merge into: | lp:~ubuntu-nexus7/ubuntu-nexus7/valgrind-ubuntu-dbg-packages |
| Diff against target: |
166 lines (+157/-0) 2 files modified
valgrind-ubuntu-dbg-packages.go (+92/-0) valgrind-ubuntu-dbg-packages.py (+65/-0) |
| To merge this branch: | bzr merge lp:~achiang/ubuntu-nexus7/valgrind-ubuntu-dbg-packages |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Mike Carifio (community) | Abstain on 2012-11-20 | ||
| Dimitri John Ledkov (community) | Needs Fixing on 2012-11-20 | ||
| Scott Sweeny (community) | 2012-11-19 | Approve on 2012-11-20 | |
| Martin Pitt | 2012-11-20 | Pending | |
|
Review via email:
|
|||
Description of the Change
Parallel python and go implementations of valgrind-
These tools parse a valgrind log looking for unknown symbols. It then
attempts to find a corresponding Ubuntu package that might provide the
proper debug symbols, and finally recommends them for installation by
the user.
Usage:
<script> <valgrind.log>
To build the go version:
go build valgrind-
- 3. By Alex Chiang on 2012-11-19
-
Re-implement in functional style
I found the multiple "found = True" statements to be a bit ugly so
refactored into a functional implementation.At the bottom, you see that I compare the package sets returned by
the two implementations, and the output on the console is:set([])
Therefore, I claim the functional implementation is equivalent to the
iterative implementation. - 4. By Alex Chiang on 2012-11-19
-
Remove iterative implementation of find_pkgs()
The previous commit proved they were equivalent, so now let's get rid
of the old one. - 5. By Alex Chiang on 2012-11-19
-
Fix debug print statements
- Remove superfluous prints that existed to print empty lines
- When no debug package found, print full name of original package
| Alex Chiang (achiang) wrote : | # |
| Scott Sweeny (ssweeny) wrote : | # |
Python script looks reasonable, and pylint/pep8 only show nitpicks, so I approve.
I'm not really qualified to review Go code, but the output of the Go program is functionally equivalent to the python script, so I feel good about it too :)
| Dimitri John Ledkov (xnox) wrote : | # |
Reviewing the python bits only.
Might be easier to use python-apt and/or python-debian bindings.
The code is not python3-safe.
General:
Only small subset of packages have -dbg packages. Most debug packages are generated as ddebs and are have -dbgsym suffix. https:/
We already have daisy and apport re-tracers that can find missing debug packages, can we not adapt/use those?
| Martin Pitt (pitti) wrote : | # |
It depends on how far you want to go with those. Installing -dbg packages only is insufficient for a lot of cases (as many/most packages don't build them), but is "safe" in the sense that they will always stay installable and upgradeable. Using -dbgsym isn't, due to the hackish and convoluted way that we (have to) use to build the ddebs archive. I would _not_ recommend to permanently install those.
Instead, what I recommend is to install apport-retrace and if you have a crash, use it to debug a .crash file in a temporary sandbox (-S system) which will include all available dbgsyms, not only for the transitive dependencies of a package, but also from the dynamically loaded plugins of the program.
What's the purpose of the script, i. e. in which cases would you run this? Is that an use case which should be supported by apport-retrace?
| Alex Chiang (achiang) wrote : | # |
The goal of this script was not to help debug crashers, but rather with the aim of providing a convenience script for community members as the Ubuntu Nexus 7 memory slimming program gets under way.
The idea was that as people run valgrind on individual programs, they might want to install the -dbg packages relevant to the program they are tracing. They might valgrind a program once, briefly; capture the log; then run this convenience script on the log.
The tool tells them which extra -dbg packages are available, user installs them, and then user re-runs valgrind for real.
| Martin Pitt (pitti) wrote : | # |
Right, so for permanent installation I indeed recommend installing -dbg only, not ddebs. For the "full" symbol experience the ddebs should be installed only temporarily (they are not very stable on upgrades and also take a ton of space), so something similar like apport-retrace ("apport-valgrind package" or so) would be more appropriate, if the need arises.
| Mike Carifio (carifio) wrote : | # |
As per our recent discussion in #premium, the golang portion is fine idomatic go. I didn't test it however.
If you want convert the go implementation to do the equivalent of python generators (the functions with yield in them), then I suggest golang channels and "go routines", see http://
| Alex Chiang (achiang) wrote : | # |
Hi Martin,
Thanks for the feedback, but I'm a little confused. Are you suggesting to fold this work into apport instead?
Hi Dmitrijs,
Based on Martin's feedback, I'll either fix the python up to be python3 compliant or figure out how to make it work with apport.
| Martin Pitt (pitti) wrote : | # |
> Thanks for the feedback, but I'm a little confused. Are you suggesting to fold
> this work into apport instead?
I was saying "if the need arises". If you prefer having permanently installed debug packages, and the number of -dbg that we have are sufficient for what you are trying to do, it's fine.
Unmerged revisions
- 5. By Alex Chiang on 2012-11-19
-
Fix debug print statements
- Remove superfluous prints that existed to print empty lines
- When no debug package found, print full name of original package - 4. By Alex Chiang on 2012-11-19
-
Remove iterative implementation of find_pkgs()
The previous commit proved they were equivalent, so now let's get rid
of the old one. - 3. By Alex Chiang on 2012-11-19
-
Re-implement in functional style
I found the multiple "found = True" statements to be a bit ugly so
refactored into a functional implementation.At the bottom, you see that I compare the package sets returned by
the two implementations, and the output on the console is:set([])
Therefore, I claim the functional implementation is equivalent to the
iterative implementation. - 2. By Alex Chiang on 2012-11-19
-
Parallel python and go implementations of valgrind-
ubuntu- dbg-packages These tools parse a valgrind log looking for unknown symbols. It then
attempts to find a corresponding Ubuntu package that might provide the
proper debug symbols, and finally recommends them for installation by
the user.Usage:
<script> <valgrind.log>To build the go version:
go build valgrind-ubuntu- dbg-packages. go


To understand the purpose of this helper program, you can run it on the log attached to comment #52 of a recent bug I worked on:
https:/ /bugs.launchpad .net/ubuntu/ +source/ network- manager- applet/ +bug/780602/ comments/ 52