Skip to content

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

Open
@fordcars

Description

@fordcars

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions