Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[glance_integration_test][android] Incorrect stack traces with stub code #10

Closed
littleGnAl opened this issue Aug 28, 2024 · 2 comments · Fixed by #16
Closed

[glance_integration_test][android] Incorrect stack traces with stub code #10

littleGnAl opened this issue Aug 28, 2024 · 2 comments · Fixed by #16

Comments

@littleGnAl
Copy link
Owner

littleGnAl commented Aug 28, 2024

When I run the test example/glance_integration_test/touch_event_jank_test.dart multiple times locally, the issue typically occurs on the second run

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 littleGnAl changed the title [Android] In-correct stack traces with stub code [Android] Incorrect stack traces with stub code Aug 29, 2024
@littleGnAl
Copy link
Owner Author

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
Copy link
Owner Author

littleGnAl commented Sep 24, 2024

I finally identified the cause of the issue, which is likely related to the Flutter build cache, filed bug in this GitHub issue. The problem occurs because the debug symbols are not being regenerated, leading to the use of outdated symbols and resulting in incorrect stack traces. This explains why the issue appears on the second run.

To resolve this, run flutter clean before each test to ensure a clean build.

@littleGnAl littleGnAl changed the title [Android] Incorrect stack traces with stub code [glance_integration_test][android] Incorrect stack traces with stub code Sep 24, 2024
littleGnAl added a commit that referenced this issue Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant