neiam
/vigil
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
Log in to mark this repository.
Slice 12: minidumps to events, raw dumps kept; docs, NOTICE and Dockerfile notes
0c2022d · gmorell · 2026-12-02 04:27
Files changed
modified
Dockerfile
+9
−6
| 17 | 17 | FROM ${BUILDER_IMAGE} AS builder |
| 18 | 18 | |
| 19 | 19 | # Build tools only: |
| 20 | −# * build-essential — bcrypt's C NIF, and the linker for the Rust NIFs | |
| 20 | +# * build-essential — bcrypt's C NIF, the linker for the Rust NIFs, and | |
| 21 | +# the C compiler zstd-sys builds zstd's vendored sources with (statically, | |
| 22 | +# for vigil_symbolic) | |
| 21 | 23 | # * git — the heroicons and daisyui dependencies are git checkouts, and |
| 22 | 24 | # neiam_auth comes from the forge over HTTPS |
| 23 | 25 | # * curl, ca-certificates — to bootstrap rustup |
| 28 | 30 | && apt-get clean && rm -rf /var/lib/apt/lists/* |
| 29 | 31 | |
| 30 | 32 | # Rust via rustup, pinned, for the NIF crates in native/ (vigil_codec, |
| 31 | −# vigil_ua, vigil_sourcemap), which Rustler builds from source during | |
| 32 | −# `mix compile`: nothing precompiled is downloaded. The crates' MSRV is | |
| 33 | −# 1.91; this is the toolchain gitgud builds with, and the one CI runs | |
| 34 | −# clippy and rustfmt with (.forgejo/workflows/checks.yml). The crates are | |
| 35 | −# pure Rust, so neither image needs a system library for them. | |
| 33 | +# vigil_ua, vigil_sourcemap, vigil_symbolic), which Rustler builds from | |
| 34 | +# source during `mix compile`: nothing precompiled is downloaded. The | |
| 35 | +# crates' MSRV is 1.91; this is the toolchain gitgud builds with, and the | |
| 36 | +# one CI runs clippy and rustfmt with (.forgejo/workflows/checks.yml). The | |
| 37 | +# crates link nothing from the system (vigil_symbolic's zstd is compiled in | |
| 38 | +# statically), so neither image needs a system library for them. | |
| 36 | 39 | ENV RUSTUP_HOME=/usr/local/rustup \ |
| 37 | 40 | CARGO_HOME=/usr/local/cargo \ |
| 38 | 41 | PATH=/usr/local/cargo/bin:${PATH} \ |
modified
NOTICE.md
+8
−0
| 50 | 50 | `utils/strings.py`, via GlitchTip's vendored copy), and the grouping |
| 51 | 51 | fixtures in `test/fixtures/grouping/` (`tests/sentry/grouping/`). |
| 52 | 52 | |
| 53 | +Native (slice 12): how a minidump becomes an event in `Vigil.Minidumps` | |
| 54 | +(crash reason, "Fatal Error"/"Assertion Error" values, the synthetic | |
| 55 | +`minidump` mechanism and its "Invalid Minidump" placeholder, the crashed | |
| 56 | +thread's stack trace on the exception, OS and device contexts; from | |
| 57 | +`lang/native/processing.py` and `lang/native/minidump.py`), and the | |
| 58 | +minidump fixture `test/support/fixtures/native/linux.dmp` | |
| 59 | +(`tests/fixtures/native/linux.dmp`). | |
| 60 | + | |
| 53 | 61 | > Copyright (c) 2019 Sentry (https://sentry.io) and individual contributors. |
| 54 | 62 | > All rights reserved. |
| 55 | 63 | > |
modified
ROADMAP.md
+8
−1
| 187 | 187 | | `vigil_codec` | Brotli decode with an output cap, on the `brotli` crate. ex_brotli (MIT) was considered, but its `decompress/1` reads to the end with no limit (a decompression bomb at the ingest edge) and fetches precompiled binaries by default, so the crate lives here | 1 | |
| 188 | 188 | | `vigil_ua` | User-Agent to browser, OS and device contexts, on the `uaparser` crate with the uap-core regexes compiled in | 2 | |
| 189 | 189 | | `vigil_sourcemap` | JS symbolication on the `sourcemap` crate (debug ids, index maps, `sourcesContent` context lines), plus zip and manifest reading for artifact bundles | 5 | |
| 190 | −| `vigil_symbolic` | Native, Proguard and minidump symbolication on `symbolic` and `minidump`. Optional; last | 12 | | |
| 190 | +| `vigil_symbolic` | Debug files, SymCaches and native symbolication on symbolic 12, Proguard deobfuscation on `proguard`, and minidump unwinding on rust-minidump | 12 | | |
| 191 | 191 | |
| 192 | 192 | --- |
| 193 | 193 |
| 496 | 496 | |
| 497 | 497 | ### 12. Native, mobile and the `vigil` CLI · large |
| 498 | 498 | - Debug information file assemble (`/projects/{o}/{p}/files/difs/assemble/`), Proguard mappings, minidump processing, and native and JVM symbolication through `vigil_symbolic`. |
| 499 | + - **As built (native):** | |
| 500 | + - `vigil_symbolic` NIF on getsentry's symbolic 12 (debuginfo, symcache, demangle without Swift), proguard 5 and rust-minidump 0.26; dirty schedulers, capped inputs and outputs. zstd (ELF's compressed debug sections) is compiled in statically; nothing links a system library. | |
| 501 | + - Chunk upload now also offers `debug_files`, `pdbs`, `portablepdbs` and `proguard` (source bundles, BCSymbolMaps and il2cpp are not offered). `difs/assemble/` answers per checksum (`not_found` with missing chunks, `created`, `assembling`, `ok` with Sentry's `DebugInfoFile`, `error` told once), assembled by an Oban job into `debug_files` (one row per object: debug id, code id, arch, kind, format, features). The legacy `files/dsyms/` zip upload (what `upload-proguard` sends by default), its list, `unknown/?checksums=` and `DELETE ?id=` work too. | |
| 502 | + - SymCaches are built at the first lookup and kept in storage. Native frames resolve against `debug_meta.images` by address or `addr_mode: rel:N`, return addresses adjusted with symbolic's heuristics, inlined frames expanded, `raw_stacktrace` kept, `in_app` false for system libraries; a missing file is one `native_missing_dsym` per image. Proguard frames and exception types are deobfuscated by the event's `proguard` images (inlined frames expanded). | |
| 503 | + - Minidumps (multipart `upload_file_minidump`, or an envelope `event.minidump` attachment folded with its event at the edge) are unwound without symbols (stack scanning and frame pointers) into threads, a synthetic crash exception, images and OS/device contexts as 2019 Sentry did, then symbolicated like any native event. The raw dump is kept in `event_attachments` (50 MiB cap, swept with the event retention). | |
| 504 | + - Tested with the real sentry-cli 2.58.2: `debug-files upload --wait` of a gcc-built ELF (committed with its source) to a symbolicated crash, and `upload-proguard` both ways. | |
| 505 | + - Not done: CFI from uploaded files for minidump unwinding (so scanned stacks can carry spurious frames), Swift demangling, source bundles and source context, a UI for debug files, Proguard caches (each event parses the mapping). | |
| 499 | 506 | - **Project management API**, in Sentry's shapes so Terraform-style tools work too: |
| 500 | 507 | - `GET /organizations/{o}/teams/`. |
| 501 | 508 | - `POST /teams/{o}/{team}/projects/`. |
modified
lib/vigil/debug_files.ex
+5
−2
| 365 | 365 | limit = opts |> Keyword.get(:limit, 100) |> min(1000) |
| 366 | 366 | |
| 367 | 367 | query = |
| 368 | − from f in DebugFile, where: f.project_id == ^project_id, order_by: [desc: f.id], limit: ^limit | |
| 368 | + from f in DebugFile, | |
| 369 | + where: f.project_id == ^project_id, | |
| 370 | + order_by: [desc: f.id], | |
| 371 | + limit: ^limit | |
| 369 | 372 | |
| 370 | 373 | query = |
| 371 | 374 | case opts |> Keyword.get(:query) |> string() do |
| 507 | 510 | def cleanup(max_age_seconds \\ 86_400) do |
| 508 | 511 | cutoff = DateTime.add(DateTime.utc_now(), -max_age_seconds) |
| 509 | 512 | Repo.delete_all(from a in Assembly, where: a.updated_at < ^cutoff) |
| 510 | − # MINIDUMPS_CLEANUP | |
| 513 | + Vigil.Minidumps.cleanup() | |
| 511 | 514 | :ok |
| 512 | 515 | end |
| 513 | 516 |
added
lib/vigil/events/attachment.ex
+20
−0
| 1 | +defmodule Vigil.Events.Attachment do | |
| 2 | + @moduledoc """ | |
| 3 | + A file an event arrived with (so far: its minidump), by project and | |
| 4 | + `event_id`, its bytes in `Vigil.Storage`. Swept with the instance's event | |
| 5 | + retention (`Vigil.Minidumps.cleanup/0`). | |
| 6 | + """ | |
| 7 | + use Vigil.Schema | |
| 8 | + | |
| 9 | + schema "event_attachments" do | |
| 10 | + field :organization_id, Ecto.UUID | |
| 11 | + field :project_id, Ecto.UUID | |
| 12 | + field :event_id, :string | |
| 13 | + field :name, :string | |
| 14 | + field :attachment_type, :string | |
| 15 | + field :size, :integer | |
| 16 | + field :storage_key, :string | |
| 17 | + | |
| 18 | + timestamps(type: :utc_datetime, updated_at: false) | |
| 19 | + end | |
| 20 | +end |
modified
lib/vigil/events/normalize.ex
+6
−1
Click to load diff…
modified
lib/vigil/ingest.ex
+6
−1
Click to load diff…
modified
lib/vigil/ingest/processor.ex
+2
−1
Click to load diff…
added
lib/vigil/minidumps.ex
+248
−0
Click to load diff…
added
lib/vigil/minidumps/processor.ex
+44
−0
Click to load diff…
modified
lib/vigil/symbolic.ex
+4
−2
Click to load diff…
modified
lib/vigil/symbolication/jvm.ex
+6
−2
Click to load diff…
modified
lib/vigil/symbolication/native.ex
+6
−4
Click to load diff…
modified
lib/vigil_web/ingest_plug.ex
+13
−5
Click to load diff…
modified
?
+0
−0
Click to load diff…
added
test/vigil/minidumps_test.exs
+181
−0
Click to load diff…
modified
test/vigil/symbolication/jvm_test.exs
+5
−1
Click to load diff…
modified
test/vigil/symbolication/native_test.exs
+7
−3
Click to load diff…
modified
test/vigil_web/api/debug_file_api_test.exs
+4
−1
Click to load diff…
Parents: 220a460