This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Log FlutterJSONMessageCodec decode errors before asserting #50163
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmagman
commented
Jan 30, 2024
| decoded = [NSJSONSerialization JSONObjectWithData:message options:0 error:&error]; | ||
| } | ||
| NSAssert(decoded, @"Invalid JSON message, decoding failed"); | ||
| NSAssert(decoded, @"Invalid JSON message, decoding failed: %@", error); |
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to what's already done in encode
| NSAssert(encoding, @"Invalid JSON message, encoding failed: %@", error); |
| #endif // FML_OS_IOS | ||
|
|
||
| ::testing::InitGoogleTest(&argc, argv); | ||
| GTEST_FLAG_SET(death_test_style, "threadsafe"); |
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to add this flag to allow EXPECT_EXIT.
https://github.com/google/googletest/blob/main/docs/advanced.md#death-test-styles
Otherwise:
[WARNING] ../../third_party/googletest/googletest/src/gtest-death-test.cc:1102:: Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected 2 threads. See https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads for more explanation and suggested solutions, especially if this is the last message you see before your test times out.
../../flutter/shell/platform/darwin/common/framework/Source/flutter_codecs_unittest.mm:52: Failure
Death test: [codec encode:value]
Result: died but not with expected error.
Expected: contains regular expression "failed to convert to UTF8"
Actual msg:
[ DEATH ] 2024-01-29 18:38:36.256 framework_common_unittests[31544:1799550] *** Assertion failure in -[FlutterJSONMessageCodec encode:], FlutterCodecs.mm:82
[ DEATH ] objc[31544]: +[NSNumber initialize] may have been in progress in another thread when fork() was called.
[ DEATH ] objc[31544]: +[NSNumber initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
LongCatIsLooong
approved these changes
Jan 31, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2024
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jan 31, 2024
…142628) flutter/engine@9ccd81d...20e5361 2024-01-31 [email protected] Roll Dart SDK from fbf1d8ebceb4 to 1f136c7b962d (1 revision) (flutter/engine#50203) 2024-01-31 [email protected] Log FlutterJSONMessageCodec decode errors before asserting (flutter/engine#50163) 2024-01-31 [email protected] [web] Final nail in FlutterViewEmbedder's coffin (flutter/engine#49769) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Merged
8 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects: desktop
autosubmit
Merge PR when tree becomes green via auto submit App
platform-ios
platform-macos
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Logging JSON decode errors on assertion will help track down bugs.
flutter/flutter#100891 (comment)
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.