google / google/gapid

DOS when opening Perfetto trace file

Open
#3,289 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.2k
Forks
329
PR merge metrics
No merged PRs in 30d

Description

When using `1.7.0-dev-20191021` I get a denial of service when opening the [trace.perfetto.gz](https://github.com/google/gapid/files/3755024/trace.perfetto.gz).

If I limit the memory through `ulimit` to around 14GB I can prevent it from making my system unresponsive. When opening the trace file a single thread is locked at 100% until I kill `gapid`. The trace viewer eventually renders but unresponsive.

![cpu](https://user-images.githubusercontent.com/1081113/67278075-2d27ec00-f4c0-11e9-996d-0523e3639931.png)

```
~ $ cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux
```
```
~ $ uname -a
Linux kratos 5.3.7-arch1-1-ARCH #1 SMP PREEMPT Fri Oct 18 00:17:03 UTC 2019 x86_64
```
```
~ $ ~/Downloads/gapid/gapid --version
To get a suitable JVM on Linux, install a regular (non-Google) JVM version >= 8 (e.g. openjdk-jre-8)
No suitable JVM found
Use --verbose-startup for additional details
~ [1] $ /usr/bin/java --version
openjdk 13 2019-09-17
OpenJDK Runtime Environment (build 13+33)
OpenJDK 64-Bit Server VM (build 13+33, mixed mode)
~ $ ~/Downloads/gapid/gapid --version --vm /usr/bin/java
Starting /usr/bin/java /home/matt-clarkson/Downloads/gapid/lib/gapic.jar
GAPID version 1.7.0:dev-20191021-b198af2dc0ae304eb7531ad2e23ff570ae2ead9eGNU/Linux
```
```
~ $ pacman -Qi gnome-shell gdm nvidia jre-openjdk | rg Version
Version : 1:3.34.1+5+g072a9a484-1
Version : 3.34.1-1
Version : 435.21-13
Version : 13.u33-1
~ $ loginctl
SESSION UID USER SEAT TTY
2 1000 matt-clarkson seat0 tty2
c1 120 gdm seat0 tty1

2 sessions listed.
~ $ loginctl show-session 2 -p Type
Type=x11
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.