apport_python_hook.py doesn't check to see if apport is enabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apport (Ubuntu) |
Fix Released
|
Medium
|
Martin Pitt | ||
Hardy |
Fix Released
|
Medium
|
Martin Pitt |
Bug Description
Binary package hint: apport
1) Hardy Heron
2) Installed: 0.108
3) python crashes not to show up in Launchpad for Hardy Heron any more
4) I found bug 222217
The changelog for apport 0.108 states:
* debian/
it is less useful in stable releases, and drains a lot of CPU and I/O
power on crashes. Disabling it here instead of in update-
more discoverable and more centralized.
However, apport_
TEST CASE:
1. Introduce a bug into a Python program (or find an existing crash):
sudo sed -i '2 s/^/assert False/' /usr/bin/
2. Run "lsb_release" in a Terminal.
With current Hardy you will get an Apport crash notification. With the hardy-proposed version, you will not get any more if /etc/default/apport disabled apport. If you enable it again, you should get an Apport notification again.
3. Restore lsb_release again:
sudo sed -i '2 s/^.*$//' /usr/bin/
Changed in apport: | |
assignee: | nobody → pitti |
importance: | Undecided → Medium |
status: | New → Triaged |
description: | updated |
Attaching a branch that fixes this. I note, however, that this is not a very distro-agnostic way to handle it. Perhaps a /var/lib/apport file that /etc/init.d/apport modifies would be "better"?
=== modified file 'apport_ python_ hook.py' python_ hook.py 2008-04-11 21:04:30 +0000 python_ hook.py 2008-04-26 01:06:30 +0000 '/etc/default/ apport' )
--- apport_
+++ apport_
@@ -30,6 +30,15 @@
# import locally here so that there is no routine overhead on python
# startup time - only when a traceback occurs will this trigger.
try:
+ # test if apport is enabled
+ enabled=1
+ try:
+ execfile(
+ except:
+ pass
+ if not enabled:
+ return
+
# ignore 'safe' exit types.
if exc_type in (KeyboardInterrupt, ):
return