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

Stack Trace is wrong in release mode (Flutter/Android) #122

Open
fordcars opened this issue Nov 28, 2022 · 1 comment
Open

Stack Trace is wrong in release mode (Flutter/Android) #122

fordcars opened this issue Nov 28, 2022 · 1 comment

Comments

@fordcars
Copy link

Calling Trace.current() in debug works perfectly. However, calling Trace.current() in release mode yields a different stack which is definitely wrong (this code path is impossible). Most, if not all stack traces I get in release mode are like this (where one or two function calls are wrong).

Debug stack trace, showing correct GlobalChannelProxyService.createChannel call:

package:poly_scrabble_mobile/room_service/room_service.dart 52:36              RoomService._getCurrentFunctionName
package:poly_scrabble_mobile/room_service/room_service.dart 134:25             RoomService.callServer
package:poly_scrabble_mobile/services/global_channel_proxy_service.dart 17:33  GlobalChannelProxyService.createChannel
package:poly_scrabble_mobile/main_page/chat/create_channel_dialog.dart 14:10   CreateChannelDialog.submit
package:poly_scrabble_mobile/main_page/chat/create_channel_dialog.dart 44:17   CreateChannelDialog.build.<fn>
...

Release stack trace, showing impossible GameServiceProxy.executePlace call:

package:poly_scrabble_mobile/room_service/room_service.dart 52             RoomService._getCurrentFunctionName
package:poly_scrabble_mobile/room_service/room_service.dart 134            RoomService.callServer
package:poly_scrabble_mobile/services/game_proxy_service.dart 84           GameServiceProxy.executePlace
package:poly_scrabble_mobile/main_page/chat/create_channel_dialog.dart 16  CreateChannelDialog.submit.<fn>

Please note GameServiceProxy.executePlace is never even called in the app. It is, however, an async function, which may be related. If I comment the GameServiceProxy.executePlace function, the release stack trace will be different, but still wrong:

Release stack trace with commented GameServiceProxy.executePlace function:

package:poly_scrabble_mobile/room_service/room_service.dart 52              RoomService._getCurrentFunctionName
package:poly_scrabble_mobile/room_service/room_service.dart 111             RoomService.reflectProp
package:poly_scrabble_mobile/services/self_user_proxy_service.dart 12       SelfUserProxyService.user
package:poly_scrabble_mobile/room_service/room_service.dart 165             RoomService._callServerBase
package:poly_scrabble_mobile/room_service/room_service.dart 148             RoomService.callServer
package:poly_scrabble_mobile/services/global_channel_proxy_service.dart 17  GlobalChannelProxyService.createChannel
package:poly_scrabble_mobile/main_page/chat/create_channel_dialog.dart 14   CreateChannelDialog.submit
package:poly_scrabble_mobile/main_page/chat/create_channel_dialog.dart 33   CreateChannelDialog.build.<fn>
...

Please note the SelfUserProxyService.user, which is also an impossible path. It looks like 2 stack traces got mangled in this case.

@fordcars fordcars changed the title Stack Trace is wrong in release mode (Android) Stack Trace is wrong in release mode (Flutter/Android) Nov 28, 2022
@Mik77o
Copy link

Mik77o commented Aug 4, 2023

We have a similar problem. We use Trace.current(1) and get:

#0 new Trace.current (/Users/builder/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/lib/src/trace.dart:96:39)
#1 Datadog.addErrorInfo (/Users/builder/clone/lib/util/datadog/datadog_service.dart:95:39)

I also wanted to add that the same problem affects both platforms: android and ios.

ios arch: arm64 comp: no sim: no
isolate_dso_base: 1121dc000, vm_dso_base: 1121dc000
isolate_instructions: 1121e7a00, vm_instructions: 1121e1f00
android arch: arm64 comp: yes sim: no
build_id: '349b9003b6bfa1efaf40333affa5f802'
isolate_dso_base: 76b2a1f000, vm_dso_base: 76b2a1f000
isolate_instructions: 76b2d1cd00, vm_instructions: 76b2d17000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants