flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.37k stars 27.55k forks source link

StackTrace doesn't have virt column #153557

Closed intspt closed 2 months ago

intspt commented 3 months ago

Steps to reproduce

  1. create a demo project
  2. write a exception
  3. print the stackTrace

Normally the format should be like this

00 abs 00007f028098381e virt 000000000025c81e /.../sdk/snapshot.so

But in fact the virt column is missing from the stack, as shown in the figure

Actual results

image

Logs

Logs ```console 2024-08-16 19:05:56.265622+0800 Runner[15637:7218465] flutter: RangeError (length): Invalid value: Valid value range is empty: 0 2024-08-16 19:05:56.266105+0800 Runner[15637:7218465] flutter: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** pid: 15637, tid: 6167687168, name io.flutter.1.ui os: ios arch: arm64 comp: no sim: no build_id: 'b680d47610353b809e2161e43d6b062e' isolate_dso_base: 108000000, vm_dso_base: 108000000 isolate_instructions: 10800f040, vm_instructions: 108004740 #00 abs 000000010809cd7b _kDartIsolateSnapshotInstructions+0x8dd3b #01 abs 000000010809cce7 _kDartIsolateSnapshotInstructions+0x8dca7 #02 abs 0000000108055f37 _kDartIsolateSnapshotInstructions+0x46ef7 #03 abs 0000000108081937 _kDartIsolateSnapshotInstructions+0x728f7 #04 abs 00000001081a6763 _kDartIsolateSnapshotInstructions+0x197723 #05 abs 000000010815e127 _kDartIsolateSnapshotInstructions+0x14f0e7 #06 abs 000000010814d3af _kDartIsolateSnapshotInstructions+0x13e36f #07 abs 000000010814d2fb _kDartIsolateSnapshotInstructions+0x13e2bb #08 abs 00000001080b024b _kDartIsolateSnapshotInstructions+0xa120b #09 abs 00000001080b00a7 _kDartIsolateSnapshotInstructions+0xa1067 #10 abs 00000001081a0f8b _kDartIsolateSnapshotInstructions+0x191f4b #11 abs 00000001080935bb _kDartIsolateSnapshotInstructions+0x8457b #12 abs 00000001080934fb _kDartIsolateSnapshotInstructions+0x844bb #13 abs 0000000108092fe3 _kDartIsolateSnapshotInstructions+0x83fa3 #14 abs 00000001081b294f _kDartIsolateSnapshotInstructions+0x1a390f #15 abs 000000010818411f _kDartIsolateSnapshotInstructions+0x1750df #16 abs 0000000108193b0b _kDartIsolateSnapshotInstructions+0x184acb #17 abs 00000001080244df _kDartIsolateSnapshotInstructions+0x1549f #18 abs 0000000108147c4b _kDartIsolateSnapshotInstructions+0x138c0b #19 abs 00000001081aaaab _kDartIsolateSnapshotInstructions+0x19ba6b #20 abs 0000000108011d73 _kDartIsolateSnapshotInstructions+0x2d33 #21 abs 0000000108014c9b _kDartIsolateSnapshotInstructions+0x5c5b #22 abs 0000000108014c2b _kDartIsolateSnapshotInstructions+0x5beb #23 abs 00000001080158db _kDartIsolateSnapshotInstructions+0x689b 2024-08-16 19:05:56.267233+0800 Runner[15637:7218465] flutter: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** pid: 15637, tid: 6167687168, name io.flutter.1.ui os: ios arch: arm64 comp: no sim: no build_id: 'b680d47610353b809e2161e43d6b062e' isolate_dso_base: 108000000, vm_dso_base: 108000000 isolate_instructions: 10800f040, vm_instructions: 108004740 #00 abs 000000010818ef1f _kDartIsolateSnapshotInstructions+0x17fedf #01 abs 0000000108037cc3 _kDartIsolateSnapshotInstructions+0x28c83 #02 abs 00000001081a67bb _kDartIsolateSnapshotInstructions+0x19777b #03 abs 000000010815e127 _kDartIsolateSnapshotInstructions+0x14f0e7 #04 abs 000000010814d3af _kDartIsolateSnapshotInstructions+0x13e36f #05 abs 000000010814d2fb _kDartIsolateSnapshotInstructions+0x13e2bb #06 abs 00000001080b024b _kDartIsolateSnapshotInstructions+0xa120b #07 abs 00000001080b00a7 _kDartIsolateSnapshotInstructions+0xa1067 #08 abs 00000001081a0f8b _kDartIsolateSnapshotInstructions+0x191f4b #09 abs 00000001080935bb _kDartIsolateSnapshotInstructions+0x8457b #10 abs 00000001080934fb _kDartIsolateSnapshotInstructions+0x844bb #11 abs 0000000108092fe3 _kDartIsolateSnapshotInstructions+0x83fa3 #12 abs 00000001081b294f _kDartIsolateSnapshotInstructions+0x1a390f #13 abs 000000010818411f _kDartIsolateSnapshotInstructions+0x1750df #14 abs 0000000108193b0b _kDartIsolateSnapshotInstructions+0x184acb #15 abs 00000001080244df _kDartIsolateSnapshotInstructions+0x1549f #16 abs 0000000108147c4b _kDartIsolateSnapshotInstructions+0x138c0b #17 abs 00000001081aaaab _kDartIsolateSnapshotInstructions+0x19ba6b #18 abs 0000000108011d73 _kDartIsolateSnapshotInstructions+0x2d33 #19 abs 0000000108014c9b _kDartIsolateSnapshotInstructions+0x5c5b #20 abs 0000000108014c2b _kDartIsolateSnapshotInstructions+0x5beb #21 abs 00000001080158db _kDartIsolateSnapshotInstructions+0x689b ```

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-x64, locale zh-Hans-CN) • Flutter version 3.24.0 on channel stable at /Users/spt/.flutterHomeStable • Upstream repository git@github.com:flutter/flutter.git • Framework revision 80c2e84975 (2 周前), 2024-07-30 23:06:49 +0700 • Engine revision b8800d88be • Dart version 3.5.0 • DevTools version 2.37.2 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) • Android SDK at /Users/spt/Library/Android/sdk • Platform android-35, build-tools 35.0.0 • ANDROID_HOME = /Users/spt/Library/Android/sdk • Java binary at: /Users/spt/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.14.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2024.1) • Android Studio at /Users/spt/Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105) [✓] IntelliJ IDEA Community Edition (version 2024.1.4) • IntelliJ at /Applications/Applications/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] IntelliJ IDEA Community Edition (version 2024.1.4) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.91.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (3 available) • zidong (mobile) • 00008101-001D18E93C91001E • ios • iOS 16.3.1 20D67 • macOS (desktop) • macos • darwin-x64 • macOS 14.5 23F79 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 127.0.6533.120 ! Error: Browsing on the local area network for 三莅的iphone14p. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) ! Error: Browsing on the local area network for 狗木的iPhone Xs Max. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources • All expected network resources are available. • No issues found! ```
intspt commented 3 months ago

I have tried Xcode 14/15, iOS 18/iOS 17, etc., but none of them work

intspt commented 3 months ago

The parameters used are shown in the figure

image
darshankawar commented 3 months ago

@intspt This issue comment's log also shows the exception without virt column, so I think this isn't an issue but maybe depend upon certain conditions.

intspt commented 3 months ago

@intspt This issue comment's log also shows the exception without virt column, so I think this isn't an issue but maybe depend upon certain conditions.

Yes, I believe the problem is on my end, but I don't know why it happens. I followed the documentation and got unexpected results, which makes me very confused.

huycozy commented 3 months ago

@intspt Do you see any HeroController trace from the crash stack? If there is any, we should concentrate on https://github.com/flutter/flutter/issues/136356. Otherwise, please share the entire crash stack trace to see if Flutter trace is different.

intspt commented 3 months ago

@intspt Do you see any HeroController trace from the crash stack? If there is any, we should concentrate on #136356. Otherwise, please share the entire crash stack trace to see if Flutter trace is different.

no.

flutter: RangeError (length): Invalid value: Valid value range is empty: 0
flutter: #0      _MyHomePageState._incrementCounter (package:offical_flutter_demo/main.dart)
#1      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1170)
#2      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:351)
#3      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:656)
#4      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:313)
#5      BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:283)
#6      GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:169)
#7      GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:505)
#8      GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:481)
#9      RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:450)
#10     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:426)
#11     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:389)
#12     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:336)
#13     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:305)
#14     _rootRunUnary (dart:async/zone.dart:1415)
#15     _CustomZone.runUnary (dart:async/zone.dart:1308)
#16     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217)
#17     _invoke1 (dart:ui/hooks.dart:330)
#18     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:442)
#19     _dispatchPointerDataPacket (dart:ui/hooks.dart:262)
intspt commented 3 months ago

BTW, it works on Android.

huycozy commented 3 months ago

write a exception

Did you modify the default sample code (counter app)? Please provide the sample code so I can try it to see if I can see the same on my end. Thanks!

intspt commented 2 months ago

write a exception

Did you modify the default sample code (counter app)? Please provide the sample code so I can try it to see if I can see the same on my end. Thanks!

Sorry for the late reply. I added a throw statement to the counter demo, but other than that, I made no other changes. I raised this issue because I found that my stack traces was different from that in the documentation(https://github.com/dart-lang/sdk/blob/main/runtime/docs/dwarf_stack_traces.md), but now I think that maybe the stack traces on iOS and Android are different?

huycozy commented 2 months ago

I added a throw statement to the counter demo

@intspt I added throw Exception('This is a test exception') in _incrementCounter() method and see the trace below:

Output log ```console ════════ Exception caught by gesture ═══════════════════════════════════════════ The following _Exception was thrown while handling a gesture: Exception: This is a test exception When the exception was thrown, this was the stack: #0 _MyHomePageState._incrementCounter (package:repro_issues/main_counter.dart:69:5) #1 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1170:21) .... ```

But I don't see the trace you provided in the original comment. Did you see it from XCode only? Can you please share the complete sample code with detailed steps here so that I can verify and mark the issue to consult insight from domain team?

intspt commented 2 months ago

I added a throw statement to the counter demo

@intspt I added throw Exception('This is a test exception') in _incrementCounter() method and see the trace below:

Output log

════════ Exception caught by gesture ═══════════════════════════════════════════
The following _Exception was thrown while handling a gesture:
Exception: This is a test exception

When the exception was thrown, this was the stack:
#0      _MyHomePageState._incrementCounter (package:repro_issues/main_counter.dart:69:5)
#1      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1170:21)
....

But I don't see the trace you provided in the original comment. Did you see it from XCode only? Can you please share the complete sample code with detailed steps here so that I can verify and mark the issue to consult insight from domain team?

add "export SPLIT_DEBUG_INFO=symbol" in Run Script

image
intspt commented 2 months ago

I added a throw statement to the counter demo

@intspt I added throw Exception('This is a test exception') in _incrementCounter() method and see the trace below:

Output log

════════ Exception caught by gesture ═══════════════════════════════════════════
The following _Exception was thrown while handling a gesture:
Exception: This is a test exception

When the exception was thrown, this was the stack:
#0      _MyHomePageState._incrementCounter (package:repro_issues/main_counter.dart:69:5)
#1      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1170:21)
....

But I don't see the trace you provided in the original comment. Did you see it from XCode only? Can you please share the complete sample code with detailed steps here so that I can verify and mark the issue to consult insight from domain team?

Now I think this may not be a problem, the stack traces on iOS and Android platforms might be different.

darshankawar commented 2 months ago

See https://github.com/getsentry/sentry-dart/issues/1983 for further reference.

add "export SPLIT_DEBUG_INFO=symbol" in Run Script

This probably makes the difference in iOS hence you may be seeing the reported behavior, and hence the difference in Android. Will close this as non-issue. If you disagree, write in comments and I'll reopen it.

github-actions[bot] commented 2 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.