apport ERROR: hook /usr/share/apport/package-hooks//chromium-browser.py crashed

Bug #759635 reported by joopbraak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Fix Released
Medium
Fabien Tassin

Bug Description

Binary package hint: chromium-browser

Got this error message while doing "ubuntu-bug chromium-browser" in the terminal:

~$ ubuntu-bug chromium-browser
ERROR: hook /usr/share/apport/package-hooks//chromium-browser.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 632, in add_hooks_info
    symb['add_info'](self, ui)
  File "/usr/share/apport/package-hooks//chromium-browser.py", line 234, in add_info
    user_prefs(report, user_dir + "/Preferences")
TypeError: unsupported operand type(s) for +: 'instance' and 'str'

The bug reporting procedure continued successfully after that.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: chromium-browser 10.0.648.204~r79063-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
Architecture: amd64
Date: Wed Apr 13 12:07:00 2011
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
ProcEnviron:
 LANGUAGE=en_GB:en
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: chromium-browser
UpgradeStatus: Upgraded to natty on 2011-03-21 (22 days ago)
chromium-default: CHROMIUM_FLAGS=""

Revision history for this message
joopbraak (joopbraak) wrote :
joopbraak (joopbraak)
summary: - ERROR: hook /usr/share/apport/package-hooks//chromium-browser.py crashed
+ apport ERROR: hook /usr/share/apport/package-hooks//chromium-browser.py
+ crashed
Revision history for this message
Fabien Tassin (fta) wrote :

d'oh! do you even have a chromium profile?

===
 user_dir = userdir if userdir is not None else get_user_profile_dir(report)

def get_user_profile_dir(report):
    dir = HOME + "/.config/chromium/Default"
    return dir
===

Changed in chromium-browser (Ubuntu):
assignee: nobody → Fabien Tassin (fta)
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
joopbraak (joopbraak) wrote :

I don't understand your question. It's not that I can't use chromium, the error message happens when I try to report a bug about chromium.

But for the record, I logged in as another user, deleted my ~/.config/chromium folder, started up chromium once, closed it, then did "ubuntu-bug chromium-browser" ---> same error.

Changed in chromium-browser (Ubuntu):
status: Incomplete → New
Revision history for this message
Fabien Tassin (fta) wrote :

sorry but i still don't understand.
do you mean that you both started chromium and ubuntu-bug as the same user and it failed?

if so, please check that $HOME is what you expect it to be and that $HOME/.config/chromium/Default really exists (and is readable by that user)

I can easily prevent the hooks from failing on this but i don't understand how you end up in this situation. The hooks have been there for a long time and noone else complained about this.

Revision history for this message
joopbraak (joopbraak) wrote :

Yes, no problems with my chromium profile. As I said, I logged in as a different user (to make sure it was not only a problem with my user profile), deleted the chromium profile (to rule out any corruption), started up chromium, closed it again, checked if a new chromium profile was created (including the default directory).

Then I opened a terminal, typed in "ubuntu-bug chromium-browser", and then got this error message.

The problem looks a bit like #660579

It's natty, their have been lot's of chromium and apport updates, so can't it be some kind of regression?

Revision history for this message
joopbraak (joopbraak) wrote :

bug 660579 (should be a link now)

Revision history for this message
Fabien Tassin (fta) wrote :

bug 660579 was different (a missing section in the prefs file), i fixed it.
Yours means the python hooks are unable to even locate your profile.

Could you please try this in a shell:

python /usr/share/apport/package-hooks/chromium-browser.py

(it should help see if the bug is in the hooks or deeper in apport).
if it fails:

echo $HOME
cd $HOME/.config/chromium/Default
ls -l Preferences

and if that works (maybe python can't figure out your HOME):

python

then..

>>> import os
>>> HOME = os.getenv("HOME")
>>> HOME

it should match the $HOME from above.

Revision history for this message
joopbraak (joopbraak) wrote :

user@computer:~$ python /usr/share/apport/package-hooks/chromium-browser.py
Traceback (most recent call last):
  File "/usr/share/apport/package-hooks/chromium-browser.py", line 269, in <module>
    print '[%s]\n%s\n' % (key, report[key])
  File "/usr/lib/python2.7/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 300: ordinal not in range(128)
user@computer:~$ echo $HOME
/home/user
user@computer:~$ cd $HOME/.config/chromium/Default
user@computer:~/.config/chromium/Default$ ls -l Preferences
-rw------- 1 user user 6945 2011-04-13 22:58 Preferences
user@computer:~/.config/chromium/Default$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> HOME = os.getenv("HOME")
>>> HOME
'/home/user'

Revision history for this message
joopbraak (joopbraak) wrote :

Above I replaced my name with "user" and my computername with "computer" for privacy reasons.

Revision history for this message
Fabien Tassin (fta) wrote :

ok, that UnicodeDecodeError is unrelated, and should not happen within apport or when redirecting the script stdout to a file.
Could you please try that?

I'm really inclined to think the error is elsewhere...

Revision history for this message
joopbraak (joopbraak) wrote :

user@computer:~$ python /usr/share/apport/package-hooks/chromium-browser.py > 1.txt
Traceback (most recent call last):
  File "/usr/share/apport/package-hooks/chromium-browser.py", line 269, in <module>
    print '[%s]\n%s\n' % (key, report[key])
  File "/usr/lib/python2.7/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 300: ordinal not in range(128)
user@computer:~$ cat 1.txt
user@computer:~$

No stdout output at all !

Revision history for this message
joopbraak (joopbraak) wrote :

user@computer:~$ python /usr/share/apport/package-hooks/chromium-browser.py 2> 2.txt
user@computer:~$ cat 2.txt
Traceback (most recent call last):
  File "/usr/share/apport/package-hooks/chromium-browser.py", line 269, in <module>
    print '[%s]\n%s\n' % (key, report[key])
  File "/usr/lib/python2.7/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 300: ordinal not in range(128)

Revision history for this message
Fabien Tassin (fta) wrote :

oh, i see what it's about now.
when run from within apport, the hooks receive user_dir which is an apport.ui.HookUI instance.
I'll fix that.

Fabien Tassin (fta)
Changed in chromium-browser (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package chromium-browser - 10.0.648.205~r81283-0ubuntu1

---------------
chromium-browser (10.0.648.205~r81283-0ubuntu1) natty; urgency=high

  * New upstream minor release from the Stable Channel (LP: #762275)
    This release fixes the following security issues:
    - [75629] Critical, CVE-2011-1301: Use-after-free in the GPU process.
      Credit to Google Chrome Security Team (Inferno).
    - [78524] Critical, CVE-2011-1302: Heap overflow in the GPU process. Credit
      to Christoph Diehl.
  * Make the default mail client and browser settings work with the
    x-scheme-handler method of registering URI handlers in gnome3.
    This is based on the xdg-utils 1.1.0~rc1-2ubuntu3 fix by Chris Coulson
    <email address hidden>, itself based on Bastien Nocera <email address hidden>
    upstream fix (LP: #670128)
    - add debian/patches/xdg-utils_gnome3_lp670128_for_natty.patch
    - update debian/patches/series
  * Fix the apport hooks to pass the expected 'ui' to add_info(), needed when
    called from apport/ubuntu-bug (LP: #759635)
    - update debian/apport/chromium-browser.py
  * Report a dedicated WMClass per webapp, needed by Unity/bamf.
    (backported from trunk) (LP: #692462)
    - add debian/patches/webapps-wm-class-lp692462.patch
    - update debian/patches/series
 -- Fabien Tassin <email address hidden> Thu, 14 Apr 2011 22:36:16 +0200

Changed in chromium-browser (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.