littleGnAl / glance

An APM library for detecting UI jank in Flutter for mobile (Android/iOS).
https://pub.dev/packages/glance
MIT License
2 stars 0 forks source link

[Android] Incorrect stack traces with stub code #10

Open littleGnAl opened 3 weeks ago

littleGnAl commented 3 weeks ago

When running the test example/glance_integration_test/touch_event_jank_test.dart,

bash scripts/glance_integration_test.sh android > log.txt

The stack traces may include lines referencing stub xxx code, which leads to incorrect stack traces. An example of such a stack trace is shown below:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 15353, tid: 15412, name 1.ui
os: android arch: arm64 comp: yes sim: no
build_id: '4dbecf54286318dce1688d7392b0d927'
isolate_dso_base: 7ddf5cf000, vm_dso_base: 7ddf5cf000
isolate_instructions: 7ddf685840, vm_instructions: 7ddf66f000
...
#48     stub _iso_stub_AllocateMintSharedWithFPURegsStub+0x40
#49     stub _iso_stub_StackOverflowSharedWithFPURegsStub+0xcc
...

It's not sure if it is related to logic in the Dart SDK https://github.com/dart-lang/sdk/blob/8fa0f56f453a1e22406f0e057be27787bf49b3be/runtime/vm/profiler.cc#L1370, but it most likely that there is no way check the stub code outside the Dart VM.

littleGnAl commented 2 weeks ago

It's weird that it works fine on the example, which is the same as this scenario, simulates the expensive function call in the click event.

littleGnAl commented 1 day ago

Maybe related https://github.com/getsentry/sentry-dart/issues/1106#issuecomment-1657846953