-
Notifications
You must be signed in to change notification settings - Fork 1
/
Bug_reporting.html
316 lines (283 loc) · 13.5 KB
/
Bug_reporting.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!DOCTYPE html>
<html lang="en">
<head>
<base href=".">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bug reporting</title>
<link rel="stylesheet" href="assets/css/dark-frontend.css" type="text/css" title="dark">
<link rel="alternate stylesheet" href="assets/css/light-frontend.css" type="text/css" title="light">
<link rel="stylesheet" href="assets/css/bootstrap-toc.min.css" type="text/css">
<link rel="stylesheet" href="assets/css/jquery.mCustomScrollbar.min.css">
<link rel="stylesheet" href="assets/js/search/enable_search.css" type="text/css">
<link rel="stylesheet" href="assets/css/prism-tomorrow.css" type="text/css" title="dark">
<link rel="alternate stylesheet" href="assets/css/prism.css" type="text/css" title="light">
<script src="assets/js/mustache.min.js"></script>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="assets/js/scrollspy.js"></script>
<script src="assets/js/typeahead.jquery.min.js"></script>
<script src="assets/js/search.js"></script>
<script src="assets/js/compare-versions.js"></script>
<script src="assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="assets/js/bootstrap-toc.min.js"></script>
<script src="assets/js/jquery.touchSwipe.min.js"></script>
<script src="assets/js/anchor.min.js"></script>
<script src="assets/js/tag_filtering.js"></script>
<script src="assets/js/language_switching.js"></script>
<script src="assets/js/styleswitcher.js"></script>
<script src="assets/js/lines_around_headings.js"></script>
<script src="assets/js/prism-core.js"></script>
<script src="assets/js/prism-autoloader.js"></script>
<script src="assets/js/prism_autoloader_path_override.js"></script>
<script src="assets/js/trie.js"></script>
<link rel="shortcut icon" href="assets/images/favicon.png">
</head>
<body class="no-script
">
<script>
$('body').removeClass('no-script');
</script>
<nav class="navbar navbar-fixed-top navbar-default" id="topnav">
<div class="container-fluid">
<div class="navbar-right">
<a id="toc-toggle">
<span class="glyphicon glyphicon-menu-right"></span>
<span class="glyphicon glyphicon-menu-left"></span>
</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-wrapper" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span title="light mode switch" class="glyphicon glyphicon-sunglasses pull-right" id="lightmode-icon"></span>
<form class="navbar-form pull-right" id="navbar-search-form">
<div class="form-group has-feedback">
<input type="text" class="form-control input-sm" name="search" id="sidenav-lookup-field" placeholder="search" disabled>
<span class="glyphicon glyphicon-search form-control-feedback" id="search-mgn-glass"></span>
</div>
</form>
</div>
<div class="navbar-header">
<a id="sidenav-toggle">
<span class="glyphicon glyphicon-menu-right"></span>
<span class="glyphicon glyphicon-menu-left"></span>
</a>
<a id="home-link" href="index.html" class="hotdoc-navbar-brand">
<img src="assets/images/pitivi.svg" alt="Home">
</a>
</div>
<div class="navbar-collapse collapse" id="navbar-wrapper">
<ul class="nav navbar-nav" id="menu">
</ul>
<div class="hidden-xs hidden-sm navbar-text navbar-center">
<p><b>The Pitivi Developer Documentation</b></p>
</div>
</div>
</div>
</nav>
<main>
<div data-extension="core" data-hotdoc-in-toplevel="True" data-hotdoc-project="Pitivi" data-hotdoc-ref="Bug_reporting.html" class="page_container" id="page-wrapper">
<script src="assets/js/utils.js"></script>
<div class="panel panel-collapse oc-collapsed" id="sidenav" data-hotdoc-role="navigation">
<script src="assets/js/full-width.js"></script>
<div id="sitenav-wrapper">
<iframe src="hotdoc-sitemap.html" id="sitenav-frame"></iframe>
</div>
</div>
<div id="body">
<div id="main">
<div id="page-description" data-hotdoc-role="main">
<h1 id="bug-reporting">Bug reporting</h1>
<p>Welcome, testers!</p>
<p>Bug reporting and feature requests are managed with GNOME's
<a href="https://gitlab.gnome.org/">GitLab</a>. You need to create
an account to file issues and comment on them. Take a quick look at the
<a href="https://gitlab.gnome.org/GNOME/pitivi/issues">existing list of bugs and feature
requests</a> to see if
your problem has already been reported.</p>
<p>To report a bug/problem in the software, <a href="https://gitlab.gnome.org/GNOME/pitivi/-/issues/">create an
issue</a>.
Ideally you can describe exactly the steps <em>anyone</em> can follow to
reproduce the bug. The more details, the better.</p>
<h1 id="providing-debugging-information">Providing debugging information</h1>
<h2 id="sharing-sample-files-projects-and-scenarios">Sharing sample files, projects, and “scenarios”</h2>
<p>To be able to reproduce an issue, we might ask you to share <strong>sample
media files</strong> with us. If the file is too large to attach to the GitLab
issue, you can use for example <a href="https://www.dropbox.com/">Dropbox</a>,
<a href="https://drive.google.com/">Google Drive</a>, <a href="https://mega.nz/">MEGA</a> or
other service to share such media.</p>
<p>You can also share in a similar way a <strong>project archive</strong> containing the
project and all the media is uses:</p>
<ol>
<li>Use the “Select unused clips” feature to easily remove unused media
from your project, this will help you save space (and upload time).</li>
<li>Click the menu button top-right and choose the “Export project as
tarball...” menu item. Save the <code>.xges_tar</code> file somewhere. It will
contain your project file and its associated media.</li>
<li>Upload it as described above.</li>
</ol>
<p>In addition to the project archive, it is extremely helpful to provide
<strong>“scenario” files</strong>. These are automatically generated each time you
use a project and contain the operations you made. Combined with the
project archive, these allow us to perform exactly the actions that have
occurred to trigger the bug. This makes reproducing the issue on our
machines a very easy and reliable process, which saves you a ton of
time! Here's <strong>how to provide scenario files to facilitate the
process:</strong></p>
<ol>
<li>Save your project, right before triggering the bug.</li>
<li>Trigger the bug (make Pitivi crash or freeze).</li>
<li>Get the last/newest scenario file from <code>~/.cache/pitivi/scenarios/</code>
or <code>~/.var/app/org.pitivi.Pitivi/cache/pitivi/scenarios/</code>
</li>
<li>Upload it as described above, so we can reproduce your issue and
integrate it into our test suite so that it does not happen again in
the future!</li>
</ol>
<h2 id="back-traces-for-crashes-and-deadlocks">Back traces for crashes and deadlocks</h2>
<p>When reporting a <strong>crash</strong> (application window disappears) or a
<strong>deadlock</strong> (application is frozen), we can't do much without a
<strong>back trace</strong>.</p>
<p>First try to see if you can locate a coredump file created by your
system automatically when a <strong>crash</strong> takes place. For example:</p>
<pre><code>$ coredumpctl list | tail
Wed 2019-08-28 23:02:20 CEST 31783 1000 100 11 present /usr/bin/python3.7
$ coredumpctl info 31783
PID: 31783 (python3)
Storage: /var/lib/systemd/coredump/core.python3.1000.e907bb24f9c14aafb3ec0c900ee5bc4a.31783.1567026134000000.lz4
$ lz4 -d /var/lib/systemd/coredump/core.python3.1000.e907bb24f9c14aafb3ec0c900ee5bc4a.31783.1567026134000000.lz4 ~/coredump
</code></pre>
<p>A coredump can be investigated using gdb. Look below for the proper way
to start gdb, but at the end instead of <code>gdb python3 -ex ...</code> simply run
<code>gdb python3 ~/coredump</code>.</p>
<p>Alternatively, if you are missing a coredump, start Pitivi in gdb as
described below, then try to reproduce the crash.</p>
<p>Finally, in gdb run <code>bt full</code> to get the back trace for the crash.</p>
<blockquote>
<p>Tip: To avoid the need to press Enter to “scroll” in gdb,
run <code>set pagination 0</code>.</p>
</blockquote>
<p>For a <strong>deadlock</strong>, start Pitivi in gdb as described below, press Ctrl+Z
and run <code>thread apply all bt</code> to get the backtraces for all the threads.</p>
<h3 id="when-running-in-the-development-environment">When running in the development environment</h3>
<ol>
<li>
<p>Install the GNOME SDK Debug symbols and update them, see below.</p>
</li>
<li>
<p>Enter the sandbox:</p>
</li>
</ol>
<pre><code>ptvenv
</code></pre>
<ol start="3">
<li>Start Pitivi inside gdb:</li>
</ol>
<pre><code>gdb python3 -ex "run $PITIVI_REPO_DIR/bin/pitivi"
</code></pre>
<h3 id="when-running-with-flatpak">When running with Flatpak</h3>
<ol>
<li>Install the GNOME SDK and its Debug symbols and update them:</li>
</ol>
<pre><code>flatpak --user install flathub org.gnome.Sdk/x86_64/46
flatpak --user install flathub org.gnome.Sdk.Debug/x86_64/46
flatpak --user update org.gnome.Sdk/x86_64/46
flatpak --user update org.gnome.Sdk.Debug/x86_64/46
</code></pre>
<ol start="2">
<li>Start a shell in the Pitivi flatpak sandbox:</li>
</ol>
<pre><code>flatpak run -d --command=bash org.pitivi.Pitivi
</code></pre>
<ol start="3">
<li>Start Pitivi inside gdb:</li>
</ol>
<pre><code>gdb python3 -ex "run /app/bin/pitivi"
</code></pre>
<h3 id="when-running-from-the-packages-of-your-linux-distro">When running from the packages of your Linux distro</h3>
<p>GNOME's <a href="https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces">Getting Stack Traces</a> has excellent documentation and tips
on the subject, including how to install the relevant debug
packages. Below is a quick reminder for those already familiar with
the process.</p>
<p>When you want to “attach” to an existing Python process (useful for
deadlocks, where the application will be hung instead of crashed):</p>
<pre><code>gdb python3 THE_PITIVI_PROCESS_NUMBER
</code></pre>
<p>When you want to run Pitivi entirely in gdb from the start:</p>
<pre><code>gdb python3 -ex "run $(which pitivi)"
</code></pre>
<h2 id="debug-logs">Debug logs</h2>
<p>When you need to know what’s going on inside Pitivi, you can launch it
with a debug level. In
<a href="https://gitlab.gnome.org/GNOME/pitivi/blob/master/pitivi/utils/loggable.py#L61">loggable.py</a>,
there are six levels: ( <span style="color:red;">ERROR</span>,
<span style="color:yellow; background-color:gray;">WARN</span>,
<span style="color:magenta;">FIXME</span>,
<span style="color:green;">INFO</span>,
<span style="color:blue;">DEBUG</span>,
<span style="color:cyan;">LOG</span> ) = range(1, 7). As such, if you
want to see errors and warnings only, you launch</p>
<pre><code>PITIVI_DEBUG=2 pitivi
</code></pre>
<p>...and if you want to see everything you do</p>
<pre><code>PITIVI_DEBUG=6 pitivi
</code></pre>
<p>If that's “too much” and you want to focus on particular parts of the
code, you can do so. For example, you can get output from the <code>Timeline</code>
and <code>MediaLibraryWidget</code> classes only:</p>
<pre><code>PITIVI_DEBUG=timeline:6,medialibrarywidget:6 pitivi
</code></pre>
<p>Here are various examples of commands you can use to generate detailed
debug logs that include not only Pitivi's debug output, but also
GStreamer's:</p>
<p>A basic log can be obtained by running:</p>
<pre><code>PITIVI_DEBUG=*:5 GST_DEBUG=2 pitivi > debug.log 2>&1
</code></pre>
<p>To get debugging information from Non-Linear Engine, you could use:</p>
<pre><code>PITIVI_DEBUG=5 GST_DEBUG=3,nle*:5,python:5 pitivi > debug.log 2>&1
</code></pre>
<p>The information most likely to be useful would probably be the debug
info from <a href="GES.html">GES</a> in addition to Pitivi's:</p>
<pre><code>PITIVI_DEBUG=5 GST_DEBUG=ges:5 pitivi > debug.log 2>&1;
</code></pre>
<blockquote>
<p>When using GST_DEBUG, the resulting logs will most likely be too
big to be attached to a bug report directly. Instead, compress them
(in gzip, bzip2 or lzma format) before attaching them to a bug report.</p>
</blockquote>
<h1 id="python-performance-profiling">Python performance profiling</h1>
<p>In the rare cases where a performance problem is caused by our UI code,
you can profile Pitivi itself, with this command (and yes,
<code>JUMP_THROUGH_HOOPS</code> is needed for this case, it is an environment
variable of
<a href="https://gitlab.gnome.org/GNOME/pitivi/blob/master/bin/pitivi.in">bin/pitivi</a>:</p>
<pre><code>JUMP_THROUGH_HOOPS=1 python3 -m cProfile -s time -o pitivi_performance.profile bin/pitivi
</code></pre>
<p>The resulting <code>pitivi_performance.profile</code> file can then be processed
to create a visual representation of where the most time was spent and
which functions were called the most often in the code. See also <a href="http://jeff.ecchi.ca/blog/tag/profiling/">Jeff's
blog posts on profiling</a>.</p>
</div>
</div>
<div id="search_results">
<p>The results of the search are</p>
</div>
<div id="footer">
</div>
</div>
<div id="toc-column">
<div class="edit-button">
<a href="https://gitlab.gnome.org/GNOME/pitivi/edit/master/docs/Bug_reporting.md" data-hotdoc-role="edit-button">Edit on GitLab</a>
</div>
<div id="toc-wrapper">
<nav id="toc"></nav>
</div>
</div>
</div>
</main>
<script src="assets/js/navbar_offset_scroller.js"></script>
</body>
</html>