GettingBetterBugReports

Dev Week -- Getting better bug reports -- nigelb and bdmurray -- Fri, Mar 4th, 2011

   1 [15:56] <dholbach> HELLO EVERYBODY! WELCOME TO THE LAST DAY OF UBUNTU DEVELOPER WEEK!
   2 [15:56] <dholbach> I know it's unfortunate that it's the last day, but I promise it's going to be action packed and loads of fun.
   3 [15:56] <dholbach> if you haven't joined #ubuntu-classroom-chat yet, please do that now
   4 [15:56] <dholbach> because that's where all the chatter and the questions go
   5 [15:56] <dholbach> you know how it works... please prefix your question with QUESTION:
   6 [15:57] <dholbach> first up are Brian Murray and Nigel Babu who are going to tell us how to get better bug reports
   7 [15:57] <dholbach> we still have a few minutes left, so go and grab yourself some coffee, tea or water and let's get cracking in 3 minutes :)
   8 === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu Developer Week - Current Session: Getting better bug reports  - Instructors: bdmurray, nigelb
   9 [16:01] <dholbach> alright... bdmurray, nigelb: the stage is yours
  10 [16:01] <nigelb> ok, that's our cue!
  11 [16:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/03/04/%23ubuntu-classroom.html following the conclusion of the session.
  12 [16:01] <nigelb> Hello and welcome everyone!
  13 [16:02] <nigelb> I'm nigel from the Bug Control Team and with me is bdmurray who's with the QA Team and the Bug Master for Ubuntu
  14 [16:02] <nigelb> We're both going to talk to you folks today about getting better bug reports for your application
  15 [16:02] <nigelb> Bugs happen with software.  We can't control it.
  16 [16:03] <nigelb> Getting good bug reports is very essential to us developers.
  17 [16:03] <nigelb> Sometimes along with bugs we want the user to give us certain debugging information.
  18 [16:03] <nigelb> Sometimes we want to talk to users just before and just after they file a bug.
  19 [16:03] <nigelb> One of the first things we'd like to show you is a newish LP feature.
  20 [16:04] <nigelb> This new feature lets us set package specific bug reporting guidelines.
  21 [16:04] <nigelb> For example, the ubiquity package can have specific guidelines (and it does!).
  22 [16:04] <nigelb> Lets take a look at the information displayed for ubiquity.
  23 [16:04] <nigelb> Lets all look at https://bugs.staging.launchpad.net/ubuntu/+source/ubiquity/+filebug.  This is LP's staging interface and feel free to play with it.
  24 [16:05] <nigelb> If you enter a summary and click next, you'll get to see what I'm talking about
  25 [16:06] <nigelb> If you get a list of duplicate bugs, click "No, I want to file a new bug" and you should see it
  26 [16:07] <nigelb> Here's a screenshot of what I see http://people.ubuntu.com/~nigelbabu/Screenshot.png
  27 [16:08] <nigelb> So, the cool bit is we can tell our users that "Please attach the files /var/log/syslog and /var/log/partman to your bug....
  28 [16:08] <nigelb> and here we get a huge advantage, the bug report now has some information that is probably absolutely necessary for triaging it
  29 [16:09] <nigelb> Launchpad also lets developers set the bug reported acknowledgement.
  30 [16:09] <nigelb> This acknowledgment might be a good way to tell people to test this package from a PPA or tell them what to expect next
  31 [16:10] <nigelb> This would be awesome if you have a daily build PPA for your package
  32 [16:10] <nigelb> (If you dont, hang around and listen to Quintasan_ later today ;) )
  33 [16:10] <nigelb> The Bug supervisor for Ubuntu, which is set to Bug Control has access to edit the bug reporting information and the acknowledgement
  34 [16:10] <nigelb> Since I'm part of bug control, I can see this edit page
  35 [16:10] <nigelb> Here's a screenshot of that page: http://goo.gl/t73Lj
  36 [16:11] <nigelb> Any questions so far?
  37 [16:11] <nigelb> Moving on then.
  38 [16:12] <nigelb> The next very important way to get good bug reports is through apport.
  39 [16:12] <bdmurray> nigelb: if I may
  40 [16:12] <nigelb> bdmurray: please :)
  41 [16:13] <bdmurray> If you can not set the bug reporting guidelines or the acknowledgement for a particular package please let nigelb or I know, or email the bug squad, and we'll be happy to set it for you.
  42 [16:13] <bdmurray> Anything we can do to get higher quality bug reports is a win for everyone! ;-)
  43 [16:15] <ClassBot> techbreak asked: can you explain bit more no syslog and partman ?
  44 [16:16] <bdmurray> So ubiquity logs information to /var/log/partman and /var/log/syslog and the developers want / need to this information to sort out what is going on
  45 [16:17] <bdmurray> After file in the title and the description and the bottom you'll notice an attach files dialog.  There you can then add a log file as an attachment.
  46 [16:17] <bdmurray> However, we have just the tool for you techbreak which makes bug reporting much easier.
  47 [16:18] <bdmurray> Which we'll get to shortly.
  48 [16:18] <nigelb> Ok, so apport is that mystery tool :)
  49 [16:18] <nigelb> Apport is a system which intercepts crashes right when they happen, in development releases of Ubuntu
  50 [16:18] <nigelb> and gathers useful information about the crash and the operating system environment.
  51 [16:19] <nigelb> Additionally, it is used as a mechanism to file non-crash bug reports about software so that we receive more detailed reports.
  52 [16:19] <nigelb> Precisly what we're talking about.
  53 [16:19] <nigelb> Lets take a look at a bug filed by apport.
  54 [16:20] <nigelb> I filed a test bug in the staging environment.
  55 [16:20] <nigelb> https://bugs.staging.launchpad.net/ubuntu/+source/squid3/+bug/724766
  56 [16:20] <nigelb> This bug is filed against the squid3 package (the proxy server for those curious).
  57 [16:20] <nigelb> The title and description isn't very helpful, but hey its a test bug!
  58 [16:21] <nigelb> Of note here is that the squid3 package does not have an apport hook. (we'll get to what it is later)
  59 [16:21] <nigelb> So the information we have here is generic information that apport would collect for any package.
  60 [16:22] <nigelb> We have the architecture, the release being used, the package version and the source package name.
  61 [16:22] <nigelb> Additionally, in the Dependencies.txt attachment we have information about the versions of packages upon which squid3 depends.
  62 [16:22] <nigelb> Really cool isn't it?
  63 [16:22] <nigelb> I was talking about hooks earlier.
  64 [16:23] <nigelb> Apport lets us write 2 types of hooks,
  65 [16:23] <nigelb> one is package specific hooks that run for a particular package.
  66 [16:23] <nigelb> like for example a squid3 package
  67 [16:23] <nigelb> The other is symptom based hooks like audio or storage or display.
  68 [16:24] <nigelb> audio is the problem but the actual bug may be in different packages depending on the symptoms
  69 [16:24] <nigelb> So, questions on apport so far?
  70 === mohammed_ is now known as Guest60593
  71 [16:24] <nigelb> netsplit's playing havoc today, stay with us :)
  72 === Guest60593 is now known as Safwat
  73 [16:25] <nigelb> Lets take a look at /usr/share/apport/package-hooks to see what hooks are on your computer right now.
  74 [16:26] <nigelb> One thing common among a  lot of files in that folder is that a majority of them were probably written by bdmurray ;)
  75 [16:26] <nigelb> When you open that folder there's going to be a lot of python files
  76 [16:27] <nigelb> almost all of them are of the pattern source_foo.py
  77 === Pendulum_ is now known as Pendulum
  78 === msnsachin12 is now known as msnsachin
  79 [16:27] <nigelb> Well, apport hooks are all written in python because apport itself, I belive, is written in python
  80 === _LibertyZero is now known as LibertyZero
  81 [16:28] <bdmurray> nigelb: it is written in python
  82 [16:28] <nigelb> Aha!
  83 [16:28] <nigelb> I wasn't sure ;)
  84 [16:28] <bdmurray> and now you are! ;-)
  85 [16:28] <nigelb> heh, thanks
  86 [16:28] <nigelb> Lets take a look at one of the hooks
  87 [16:29] <nigelb> There are some really simple ones and some really complicated ones in there
  88 [16:29] <nigelb> Open the source_totem.py file
  89 [16:29] <nigelb> That's the hook for totem, the media player
  90 [16:29] <nigelb> Its on the default install, so the hook should be in most of your computers
  91 [16:30] <nigelb> In case you don't have the file, head over to http://goo.gl/UUWpt
  92 [16:30] <nigelb> techbreak> can you tell me what actually a hook is ? a bug ? a problem ?
  93 [16:31] <nigelb> I figure this question would benefit a common answer.
  94 [16:31] <nigelb> A hook is a python script that gets executed when you run ubuntu-bug <packagename>
  95 [16:31] <nigelb> So, we do smart things in the hook like as you questions, run certain processes, gather certain log files, and get them all onto launchpad
  96 === msnsachin12 is now known as msnsachin
  97 [16:34] <nigelb> Lets look at the import statements in the totem hook first
  98 [16:34] <nigelb> apport.hookutils and apport.packaging are the significant ones
  99 [16:34] <nigelb> You can look at 'pydoc apport.hookutils' and 'pydoc apport.packaging' to see the functions in both these imports
 100 [16:35] <nigelb> Basically both of them provide a collection of readymade and safe functions for many commonly used things.
 101 [16:35] <nigelb> There are functions for attaching a file's contents, getting a command's output, grabbing hardware information and much more.
 102 [16:36] <nigelb> In this hook, we start with asking the user a question and providing 3 choices for an answer.
 103 [16:36] <nigelb> The question is "How would you describe the issue?" and the options are "The totem interface is not working correctl", "No sound is being played", "Some audio files or videos are not being played correctly".
 104 [16:37] <nigelb> While the first one is definitely something to be filed against totem, the other 2 may not be a totem problem.
 105 [16:37] <nigelb> I mean, how can you blame the media player if your sound driver itself has a bug ;)
 106 [16:37] <nigelb> If the user selected "No sound is being played", we'd come to "if response[0] == 1:", which means the problem is actually a something to do with audio and not totem, so we open the audio hook.
 107 [16:38] <nigelb> there, we straightfoward use a python function to execute another program
 108 [16:38] <nigelb> And if the user selected "Some audio files or videos are not being played correctly", we come to if "response[0] == 2:" where we add the gstreamer package info.
 109 [16:39] <nigelb> Here we use a function provided by apport to add information about a package
 110 [16:39] <nigelb> Now turn your attention to lines 16, 17, and 18.
 111 [16:39] <nigelb> The lines are self explanatory, but I'll take a moment to name those functions
 112 [16:39] <nigelb> apport.hookutils.command_output, apport.hookutils.package_versions, and apport.hookutils.read_file
 113 [16:40] <nigelb> Very self explanatory and the pydoc command I gave earlier should explain all of these functions
 114 [16:40] <nigelb> With these 3 commands we've added valuable debugging information for the developer.  All this information will be uploaded to launchpad and attached to the bug report.
 115 [16:40] <nigelb> As a developer you'll surely recognize the value of this information.
 116 [16:40] <nigelb> That was a bit of information cramming.  Are there any questions so far?
 117 [16:42] <ClassBot> techbreak asked: i just checked /var/log.. but there is neither syslog or partman directory..
 118 [16:42] <nigelb> err, sorry
 119 [16:42] <ClassBot> techbreak asked: can we edit this .py files if we think it can be better and submit ?
 120 [16:43] <nigelb> In short, yes!
 121 [16:43] <nigelb> All these files belong to a particular package.  Like the source_totem.py in the totem package.
 122 [16:43] <nigelb> If you'd like to help make it better, get the code, open a bug, and submit a patch
 123 [16:44] <bdmurray> report a bug about the sourcepackage providing the file so in this example totem
 124 [16:44] <nigelb> You can poke bdmurray or me in #ubuntu-bugs and we'd be happy to review and help get it packaged
 125 === popey_ is now known as popey
 126 [16:44] <nigelb> you can use dpkg S /path/to/file to figureout which package
 127 [16:45] <nigelb> err, that was dpkg -S /path/to/file
 128 [16:45] <nigelb> One of my favorite hooks is the new audio hook, http://goo.gl/r4dFW
 129 [16:45] <nigelb> Don't get alarmed by its size though
 130 [16:46] <nigelb> It asks good questions and manages to be very friendly in diagnosing audio problems.
 131 [16:46] <nigelb> There are some other neat things you could do with hooks, like add tags to the bug report.
 132 [16:47] <nigelb> For example, if a particular question is answered, you want to add a particular tag
 133 [16:47] <nigelb> This helps reduce the load with triaging
 134 [16:47] <nigelb> To see an example of that, see the cheese hook, http://goo.gl/tsJ6G
 135 [16:47] <nigelb> See line numbers 9, 42, 45, 72-76 for the bits where the tags come into play.
 136 [16:47] <nigelb> If you know python, its kind of simple to read what's done.
 137 [16:49] <nigelb> With the cheese hook tags are added based on symptoms, so the devs have a generic idea of the bugs
 138 === Quintasan_ is now known as Quintasan
 139 === dpm_ is now known as dpm
 140 [16:50] <nigelb> There's developer information for Apport available at https://wiki.ubuntu.com/Apport/DeveloperHowTo.
 141 [16:50] <nigelb> There are lots of packages without an apport hook.
 142 [16:51] <bdmurray> Well, that's partially because there are a lot of packages. ;-)
 143 [16:51] <nigelb> Clearly we've shown how much an apport hook helps get better bug reports for a package
 144 [16:51] <ClassBot> There are 10 minutes remaining in the current session.
 145 [16:51] <nigelb> heh, that too ;)
 146 [16:51] <nigelb> If you'd like to write a hook for your own package and need help, feel free to poke either me (nigelb) or Brian Murray (bdmurray) in #ubuntu-bugs.
 147 [16:52] <nigelb> Some of the fairly new hooks we've managed over the last few cycles is the rhythmbox book (I wrote that one), cheese hook (kermiac, a fellow bug control member wrote that one), and a few more that I now forget
 148 [16:53] <nigelb> ah, thanks techbreak.  rhythmbox *hook* :0
 149 [16:53] <nigelb> :)
 150 [16:53] <nigelb> I fail at typing :p
 151 [16:53] <nigelb> Anyway, that's the end of our session.
 152 [16:54] <nigelb> We'll take questions now :)
 153 [16:54] <nigelb> bdmurray: Anything you want to add?
 154 [16:55] <bdmurray> Once you have bugs reported by apport in Launchpad because the data is in a regular format it is also possible to some automated processing of those bug reports using the Launchpad API.
 155 === maxb_ is now known as maxb
 156 [16:56] <ClassBot> There are 5 minutes remaining in the current session.
 157 [16:56] <bdmurray> With the combination of high quality reports and some automatic processing your bug life can become much easier.
 158 [16:56] <nigelb> and our triaging life too ;)
 159 [16:58] <bdmurray> Another neat thing about the cheese hook is that it asks you to close cheese so that it gets run in debug mode.
 160 [16:58] <bdmurray> The possibilities of what you can do with apport really are amazing.
 161 [16:59] <bdmurray> Feel free to ask nigelb or I any questions.  We are always in #ubuntu-bugs.
 162 [17:00] <nigelb> ok, I guess we're done

MeetingLogs/devweek1103/GettingBetterBugReports (last edited 2011-03-05 04:39:10 by 111)