SIGTRAP crash in FPDF_InitLibraryWithConfig on Android during pdfrxFlutterInitialize

Open
#607 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
android, dart, flutter
Domain
mobile

Research direction

Start by tracing pdfrxFlutterInitialize() to the call to FPDF_InitLibraryWithConfig; the issue does not name source files or tests. Investigate the native initialization crash on affected Android devices and chipsets, since it cannot be reproduced reliably from the report. Done means identifying and addressing the cause, with validation that initialization no longer crashes.

Written by the indexing model from the issue text.

Description

wait for response

Description

Calling pdfrxFlutterInitialize() at app startup causes a fatal SIGTRAP (native signal) on some Android devices. The crash occurs inside FPDF_InitLibraryWithConfig — the PDFium native initialization — before any PDF document is opened.

Since SIGTRAP is a native signal, it kills the entire process and cannot be caught from Dart.

Environment

  • pdfrx: 2.2.24
  • pdfrx_engine: 0.3.9
  • Flutter: 3.41.0 (Dart 3.10.1)
  • Platform: Android only (13, 14, 15, 16)

Affected devices (21 occurrences, 19 users)

Device Chipset Count
Samsung Galaxy A34 (SM-A346E) Mediatek MT6877 3
Samsung Galaxy M12 (SM-M127F) Exynos 850 3
Motorola moto g14 Mediatek 2
Motorola moto g24 Mediatek MT6769 1
Samsung Galaxy A26 (SM-A266B) — 1
Samsung Galaxy A52s (SM-A528B) — 1
Realme RMX3933 — 1
Xiaomi Redmi (22101316UG) — 1
+ others — 8

Mostly low/mid-range devices with Mediatek or Exynos chipsets. Spans Android 13 through 16, so not version-specific.

Stacktrace

SIGTRAP: Trap
    at __start_thread (<unknown>)
    at __pthread_start (<unknown>)
    at dart::ThreadStart (os_thread_android.cc:98)
    at dart::ThreadPool::Worker::Main (thread_pool.cc:367)
    at dart::ThreadPool::WorkerLoop (thread_pool.cc:207)
    at dart::MessageHandlerTask::Run (message_handler.cc:31)
    at dart::MessageHandler::TaskCallback (message_handler.cc:443)
    at dart::MessageHandler::HandleMessages (message_handler.cc:229)
    at dart::IsolateMessageHandler::HandleMessage (isolate.cc:1561)
    at dart::DartLibraryCalls::HandleMessage (dart_entry.cc:781)
    at dart::DartEntry::InvokeFunction (dart_entry.cc:41)
    at dart::DartEntry::InvokeFunction (dart_entry.cc:171)
    at dart::InvokeDartCode (dart_entry.cc:126)
    at _kDartVmSnapshotInstructions (<unknown>)
    [... unsymbolicated Dart frames ...]
    at _kDartVmSnapshotInstructions (<unknown>)
    at FPDF_InitLibraryWithConfig (<unknown>)
    at <unknown> (<unknown>)

Reproduction

Cannot reliably reproduce — happens on specific device/chipset combinations. Our app calls pdfrxFlutterInitialize() once at startup inside a Sentry wrapper.

Dominant language
Dart
Stars
276
Forks
176
Avg merge
3d 53m
Merged PRs (30d)
48

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from espresso3389/pdfrx

All issues in espresso3389/pdfrx

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.