File: Bug_reporting.md

package info (click to toggle)
pitivi 2023.03-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,468 kB
  • sloc: python: 33,616; ansic: 104; sh: 82; makefile: 6
file content (225 lines) | stat: -rw-r--r-- 7,629 bytes parent folder | download | duplicates (2)
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
# Bug reporting

Welcome, testers!

Bug reporting and feature requests are managed with GNOME's
[GitLab](https://gitlab.gnome.org/). You need to create
an account to file issues and comment on them. Take a quick look at the
[existing list of bugs and feature
requests](https://gitlab.gnome.org/GNOME/pitivi/issues) to see if
your problem has already been reported.

To report a bug/problem in the software, [create an
issue](https://gitlab.gnome.org/GNOME/pitivi/issues/new?issue%5Bassignee_id%5D=&issue%5Bmilestone_id%5D=).
Ideally you can describe exactly the steps *anyone* can follow to
reproduce the bug. The more details, the better.

# Providing debugging information

## Sharing sample files, projects, and “scenarios”

To be able to reproduce an issue, we might ask you to share **sample
media files** with us. If the file is too large to attach to the GitLab
issue, you can use for example [Dropbox](https://www.dropbox.com/),
[Google Drive](https://drive.google.com/), [MEGA](https://mega.nz/) or
other service to share such media.

You can also share in a similar way a **project archive** containing the
project and all the media is uses:

1.  Use the “Select unused clips” feature to easily remove unused media
    from your project, this will help you save space (and upload time).
2.  Click the menu button top-right and choose the “Export project as
    tarball...” menu item. Save the `.xges_tar` file somewhere. It will
    contain your project file and its associated media.
3.  Upload it as described above.

In addition to the project archive, it is extremely helpful to provide
**“scenario” files**. 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 **how to provide scenario files to facilitate the
process:**

1.  Save your project, right before triggering the bug.
2.  Trigger the bug (make Pitivi crash or freeze).
3.  Get the last/newest scenario file from `~/.cache/pitivi/scenarios/`
    or `~/.var/app/org.pitivi.Pitivi/cache/pitivi/scenarios/`
4.  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!


## Back traces for crashes and deadlocks

When reporting a **crash** (application window disappears) or a
**deadlock** (application is frozen), we can't do much without a
**back trace**.

First try to see if you can locate a coredump file created by your
system automatically when a **crash** takes place. For example:

```
$ 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
```

A coredump can be investigated using gdb. Look below for the proper way
to start gdb, but at the end instead of `gdb python3 -ex ...` simply run
`gdb python3 ~/coredump`.

Alternatively, if you are missing a coredump, start Pitivi in gdb as
described below, then try to reproduce the crash.

Finally, in gdb run `bt full` to get the back trace for the crash.

> Tip: To avoid the need to press Enter to “scroll” in gdb,
> run `set pagination 0`.

For a **deadlock**, start Pitivi in gdb as described below, press Ctrl+Z
and run `thread apply all bt` to get the backtraces for all the threads.

### When running in the development environment

1. Install the GNOME SDK Debug symbols and update them, see below.

2. Enter the sandbox:

```
ptvenv
```

3. Start Pitivi inside gdb:

```
gdb python3 -ex "run $PITIVI_REPO_DIR/bin/pitivi"
```

### When running with Flatpak

1. Install the GNOME SDK and its Debug symbols and update them:

```
flatpak --user install flathub org.gnome.Sdk/x86_64/43
flatpak --user install flathub org.gnome.Sdk.Debug/x86_64/43
flatpak --user update          org.gnome.Sdk/x86_64/43
flatpak --user update          org.gnome.Sdk.Debug/x86_64/43
```

2. Start a shell in the Pitivi flatpak sandbox:

```
flatpak run -d --command=bash org.pitivi.Pitivi
```

3. Start Pitivi inside gdb:

```
gdb python3 -ex "run /app/bin/pitivi"
```

### When running from the packages of your Linux distro

GNOME's [Getting Stack Traces] 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.

When you want to “attach” to an existing Python process (useful for
deadlocks, where the application will be hung instead of crashed):

```
gdb python3 THE_PITIVI_PROCESS_NUMBER
```

When you want to run Pitivi entirely in gdb from the start:

```
gdb python3 -ex "run $(which pitivi)"
```


## Debug logs

When you need to know what’s going on inside Pitivi, you can launch it
with a debug level. In
[loggable.py](https://gitlab.gnome.org/GNOME/pitivi/blob/master/pitivi/utils/loggable.py#L61),
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

```
PITIVI_DEBUG=2 pitivi
```

...and if you want to see everything you do

```
PITIVI_DEBUG=6 pitivi
```

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 `Timeline`
and `MediaLibraryWidget` classes only:

```
PITIVI_DEBUG=timeline:6,medialibrarywidget:6 pitivi
```

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:

A basic log can be obtained by running:

```
PITIVI_DEBUG=*:5 GST_DEBUG=2 pitivi > debug.log 2>&1
```

To get debugging information from Non-Linear Engine, you could use:

```
PITIVI_DEBUG=5 GST_DEBUG=3,nle*:5,python:5 pitivi > debug.log 2>&1
```

The information most likely to be useful would probably be the debug
info from [GES](GES.md) in addition to Pitivi's:

```
PITIVI_DEBUG=5 GST_DEBUG=ges:5 pitivi > debug.log 2>&1;
```


> 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.


# Python performance profiling

In the rare cases where a performance problem is caused by our UI code,
you can profile Pitivi itself, with this command (and yes,
`JUMP_THROUGH_HOOPS` is needed for this case, it is an environment
variable of
[bin/pitivi](https://gitlab.gnome.org/GNOME/pitivi/blob/master/bin/pitivi.in):

```
JUMP_THROUGH_HOOPS=1 python3 -m cProfile -s time -o pitivi_performance.profile bin/pitivi
```

The resulting `pitivi_performance.profile` 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 [Jeff's
blog posts on profiling](http://jeff.ecchi.ca/blog/tag/profiling/).

[Getting Stack Traces]: https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces